Skip to content

Commit 9a4d894

Browse files
authored
Merge pull request #2074 from greglucas/doc-v0.21
DOC: What's new for v0.21 release
2 parents 34402c7 + ad1ec1a commit 9a4d894

File tree

9 files changed

+149
-12
lines changed

9 files changed

+149
-12
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ deps-run: &deps-install
4545
pyshp \
4646
scipy \
4747
setuptools_scm \
48-
shapely \
48+
'shapely<2' \
4949
$EXTRA_PACKAGES \
5050
--file docs/doc-requirements.txt
5151
conda list -n test-environment

.github/workflows/ci-testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Latest packages
3636
if: steps.minimum-packages.conclusion == 'skipped'
3737
run: |
38-
echo "PACKAGES=cython fiona matplotlib-base numpy pyproj pykdtree scipy shapely" >> $GITHUB_ENV
38+
echo "PACKAGES=cython fiona matplotlib-base numpy pyproj pykdtree scipy shapely<2" >> $GITHUB_ENV
3939
4040
- name: Coverage packages
4141
id: coverage
@@ -49,7 +49,7 @@ jobs:
4949
- name: Install dependencies
5050
run: |
5151
PACKAGES="$PACKAGES owslib pep8 pillow pyshp pytest pytest-mpl!=0.16.0"
52-
PACKAGES="$PACKAGES pytest-xdist setuptools_scm shapely"
52+
PACKAGES="$PACKAGES pytest-xdist setuptools_scm shapely<2"
5353
conda install $PACKAGES
5454
conda info -a
5555
conda list

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
PACKAGES="cython fiona matplotlib-base numpy pyproj pykdtree scipy"
2828
PACKAGES="$PACKAGES owslib pep8 pillow pyshp pytest"
29-
PACKAGES="$PACKAGES pytest-xdist setuptools_scm shapely"
29+
PACKAGES="$PACKAGES pytest-xdist setuptools_scm shapely<2"
3030
conda install $PACKAGES
3131
3232
- name: Create sdist

INSTALL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ For macOS, the required dependencies can be installed in the following way::
8585
pip3 install --upgrade pyshp
8686
# shapely needs to be built from source to link to geos. If it is already
8787
# installed, uninstall it by: pip3 uninstall shapely
88-
pip3 install shapely --no-binary shapely
88+
pip3 install "shapely<2" --no-binary shapely
8989

9090
Still on macOS, make sure you have installed pkg-config and set the
9191
`PKG_CONFIG_PATH` environment variable as follows::
@@ -117,7 +117,7 @@ Further information about the required dependencies can be found here:
117117
GEOS is an API of spatial predicates and functions for processing geometry
118118
written in C++.
119119

120-
**Shapely** 1.6.4 or later (https://github.com/Toblerity/Shapely)
120+
**Shapely** between 1.6.4 and 1.8.4 (https://github.com/Toblerity/Shapely)
121121
Python package for the manipulation and analysis of planar geometric
122122
objects.
123123

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@
371371

372372
############ extlinks extension ############
373373
extlinks = {'issues': ('https://github.com/SciTools/cartopy/labels/%s',
374-
'issues labeled with '),
374+
'issues labeled with %s'),
375375
'issue': ('https://github.com/SciTools/cartopy/issues/%s',
376-
'Issue #'),
377-
'pull': ('https://github.com/SciTools/cartopy/pull/%s', 'PR #'),
376+
'Issue #%s'),
377+
'pull': ('https://github.com/SciTools/cartopy/pull/%s', 'PR #%s'),
378378
}
379379

380380

docs/source/whatsnew/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Versions
1414
.. toctree::
1515
:maxdepth: 2
1616

17+
v0.21
1718
v0.20
1819
v0.19
1920
v0.18

docs/source/whatsnew/v0.21.rst

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
Version 0.21 (September 9, 2022)
2+
================================
3+
4+
Cartopy v0.21 is not compatible with Shapely 2.0, so this release
5+
has an upper pin on Shapely to avoid installing newer versions.
6+
7+
For a full list of included Pull Requests and closed Issues, please see the
8+
`0.21 milestone <https://github.com/SciTools/cartopy/milestone/30>`_.
9+
10+
Features
11+
--------
12+
13+
* The requirement to install with a local PROJ installation has been removed.
14+
The previous C PROJ library calls have been replaced by pyproj.
15+
(:pull:`2069`)
16+
17+
* Many test improvements, including moving to pytest-mpl for image comparisons
18+
and parametrizing many tests where possible.
19+
(:pull:`1887`, :pull:`1891`, :pull:`1900`)
20+
21+
* The UTF8 degree symbol is now used for latitude and longitude labels.
22+
(:pull:`1885`)
23+
24+
* Clément fixed an issue that would ignore the alpha channel when
25+
reprojecting RGBA images. (:pull:`1906`)
26+
27+
.. plot::
28+
:width: 400pt
29+
30+
import matplotlib.pyplot as plt
31+
import numpy as np
32+
import cartopy.crs as ccrs
33+
34+
dy, dx = (4, 10)
35+
rgba = np.linspace(0, 255*31, dx*dy*4, dtype=np.uint8).reshape((dy, dx, 4))
36+
rgba[:, :, 3] = np.linspace(0, 255, dx, dtype=np.uint8).reshape(1, dx)
37+
38+
fig = plt.figure(figsize=(10, 5))
39+
ax = plt.axes(projection=ccrs.Orthographic(central_latitude=45))
40+
ax.imshow(rgba, transform=ccrs.PlateCarree())
41+
42+
plt.show()
43+
44+
* Filled features no longer set the edgecolor by default. The edgecolor can
45+
still be explicitly set when adding the feature
46+
``ax.add_feature(LAND, edgecolor='k')``. (:pull:`1933`)
47+
48+
* The **approx** keyword to TransverseMercator, OSGB, and OSNI projections
49+
now defaults to False. (:pull:`1957`)
50+
51+
* ``geoaxes.add_geometries()`` now accepts both a list of geometries and a
52+
single geometry. (:pull:`1999`)
53+
54+
* Better handling of non-ndarray inputs like ``xarray.DataArray``.
55+
(:pull:`2050`)
56+
57+
* Alan Brammer added the ability to pass CRS's for the text and xy coordinates
58+
used in ``ax.annotate()``. (:pull:`2065`)
59+
60+
.. plot::
61+
:width: 400pt
62+
63+
import matplotlib.pyplot as plt
64+
import numpy as np
65+
import cartopy.crs as ccrs
66+
67+
map_projection = ccrs.InterruptedGoodeHomolosine()
68+
69+
fig = plt.figure(figsize=(10, 5))
70+
ax = fig.add_subplot(1, 1, 1, projection=map_projection)
71+
ax.set_global()
72+
ax.coastlines()
73+
arrowprops = {'facecolor': 'red',
74+
'arrowstyle': "-|>",
75+
'connectionstyle': "arc3,rad=-0.2",
76+
}
77+
platecarree = ccrs.PlateCarree()
78+
mpltransform = platecarree._as_mpl_transform(ax)
79+
80+
ax.annotate('mpl xycoords', (-45, 43), xycoords=mpltransform,
81+
size=5)
82+
83+
# Add annotation with xycoords as projection
84+
ax.annotate('crs xycoords', (-75, 13), xycoords=platecarree,
85+
size=5)
86+
87+
# set up coordinates in map projection space
88+
map_coords = map_projection.transform_point(-175, -35, platecarree)
89+
# Dont specifiy any args, default xycoords='data', transform=map projection
90+
ax.annotate('default crs', map_coords, size=5)
91+
92+
# data in map projection using default transform, with
93+
# text positioned in platecaree transform
94+
ax.annotate('mixed crs transforms', map_coords, xycoords='data',
95+
xytext=(-175, -55),
96+
textcoords=platecarree,
97+
size=5,
98+
arrowprops=arrowprops,
99+
)
100+
101+
# Add annotation with point and text via transform
102+
ax.annotate('crs transform', (-75, -20), xytext=(0, -55),
103+
transform=platecarree,
104+
arrowprops=arrowprops,
105+
)
106+
107+
# Add annotation with point via transform and text non transformed
108+
ax.annotate('offset textcoords', (-149.8, 61.22), transform=platecarree,
109+
xytext=(-35, 10), textcoords='offset points',
110+
size=5,
111+
ha='right',
112+
arrowprops=arrowprops,
113+
)
114+
115+
plt.show()
116+
117+
Deprecations
118+
------------
119+
120+
* Passing **map_projection** as a keyword when manually creating a GeoAxes
121+
object is deprecated, use **projection** instead.
122+
123+
Removals
124+
--------
125+
126+
The following functions and classes have been removed after being deprecated
127+
multiple versions prior. See the previous What's New notes for replacements.
128+
129+
* ``geoaxes.outline_patch()``
130+
* ``geoaxes.background_patch()``
131+
* ``geoaxes.natural_earth_shp()``
132+
* The argument ``secant_latitudes`` to the LambertConformal projection.
133+
* ``img_tiles.StamenTerrain``
134+
* ``srtm.SRTM3_retrieve``, ``srtm.srtm``, ``srtm.srtm_composite``, and
135+
``srtm.fill_gaps``
136+
* ``clip_path.clip_path``

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
# conda activate cartopy-dev
55
# pip install -e .
66
#
7-
name: cartopy-dev
7+
name: cartopy-dev2
88
channels:
99
- conda-forge
1010
dependencies:
1111
- cython>=0.28.5
1212
- numpy>=1.18
13-
- shapely>=1.6.4
13+
- shapely>=1.6.4,<2
1414
- geos>=3.7.2
1515
- pyshp>=2.1
1616
- pyproj>=3.0.0

requirements/default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy>=1.18
22
matplotlib>=3.1
3-
shapely>=1.6.4
3+
shapely>=1.6.4,<2
44
pyshp>=2.1
55
pyproj>=3.0.0

0 commit comments

Comments
 (0)