Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REF: Use pyproj 3+ for PROJ 8+ migration #1808

Merged
merged 52 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
726ebac
REF: Use pyproj 2+ for PROJ 6+ migration
snowman2 Aug 25, 2020
b6a879c
MAINT: Changing PlateCarree projection to be more lat/lon like
greglucas May 9, 2021
5d567ab
BUG: Handle 0-360 to -180,180 for special case of PlateCarree
snowman2 Jun 28, 2021
48ccf7d
Address some comments by greglucas
snowman2 Jun 30, 2021
3311d7f
REF: PROJ4_VERSION -> PROJ_VERSION
snowman2 Jun 30, 2021
017f989
FIX: Update to fix image transforms
greglucas Jul 1, 2021
b33a69e
TST: Use the Longitude/Latitude Formatters inside tests
greglucas Jul 1, 2021
0617650
More trap=True and ensure inf converted to nan if trap=False
snowman2 Jul 2, 2021
72be991
TST: fix test_transform_points_outside_domain
snowman2 Jul 2, 2021
9ed268c
FIX: Add RotatedPole to list of mod-180 transforms
greglucas Jul 2, 2021
c57b399
TST: Remove Squashed Mercator Test due to bad cellestial body
greglucas Jul 2, 2021
f9e7b12
TST: Update expected for Test_vector_scalar_to_grid::test_with_transform
snowman2 Jul 3, 2021
a3e50dd
Build globe if input non-standard; fix for pyproj.CRS as input
snowman2 Jul 3, 2021
9311aa2
REF: Use ellipsoid instead of globe for axis; Use PROJ JSON for geoce…
snowman2 Jul 3, 2021
3b15a54
FIX: Force Projections to not be Geodetic
greglucas Jul 3, 2021
178bec0
LNT: Address flake8 errors
snowman2 Jul 3, 2021
20c5391
TST: Swap longitude/latitude to correct places
greglucas Jul 3, 2021
3fc24f5
FIX: Always copy input array when wrapping coordinates
greglucas Jul 3, 2021
a4011ff
TST: Updating the tolerance for global wrap test
greglucas Jul 3, 2021
28e52b1
TST: Update test for set_extent in RotatedPole coordinates
greglucas Jul 3, 2021
40b7fc8
FIX: Update all Globes to use proper semimajor axes
greglucas Jul 3, 2021
4db5f18
TST: Update split polygon test to exceed bounds
greglucas Jul 3, 2021
e65cd85
FIX: Enable Geodetic to wrap to 180
greglucas Jul 3, 2021
870c387
TST: Updating test images and tolerances
greglucas Jul 3, 2021
9a1dd29
FIX: Pass globe as keyword argument in the extent calcs
greglucas Jul 3, 2021
52664f2
CI: Run python 3.7 & 3.8
snowman2 Jul 4, 2021
5aed835
DOC: Updating the eccentric ellipse image
greglucas Jul 4, 2021
22dc737
DOC: Remove explicit datum definition from effects of ellipse example
greglucas Jul 5, 2021
ed5c471
CI: Update the minimum Python to 3.7 and numpy to 1.18
greglucas Jul 5, 2021
3481906
TST: Removing old MPL images and updating test tolerances
greglucas Jul 7, 2021
5de38a4
DEP: pin minumum pyproj as 2.6
snowman2 Jul 10, 2021
545168a
CI: Pin proj=7 for minimal test
snowman2 Jul 10, 2021
40a6e0a
CI: Appveyor remove proj=7 pin
snowman2 Jul 10, 2021
b397b1c
CI: pin pyproj=3.0 for min
snowman2 Jul 10, 2021
8e06257
CI: PROJ 8.0 in ci
snowman2 Jul 10, 2021
1ad3e3a
TST: Update testing tolerances for minimum versions
greglucas Jul 11, 2021
013a72e
REF: Move project method to base Interpolator class
snowman2 Jul 20, 2021
af24b7e
CLN: Remove ACCEPT_USE_OF_DEPRECATED_PROJ_API_H macro
snowman2 Jul 20, 2021
8d06f38
DOC: Update recommended pyproj/proj versions
snowman2 Jul 20, 2021
65d91cc
DEP: pin pyproj 3+ and warn if PROJ 8+ not installed
snowman2 Jul 23, 2021
b1e14d2
MNT: Clean up image transform routines
greglucas Jul 31, 2021
f0908a4
Revert "TST: Update test for set_extent in RotatedPole coordinates"
greglucas Jul 31, 2021
1152eab
CI: Speed up doc build by allowing pyproj global context
greglucas Jul 31, 2021
02ecb6e
CLN: Remove TODO comment that was addressed
snowman2 Aug 7, 2021
234b0a9
REF: Move code to convert to 180 to after the transformation
snowman2 Aug 7, 2021
9bdeade
BUG: Update new PROJ4_VERSION to PROJ_VERSION
snowman2 Aug 14, 2021
73c5641
BUG: Update threshold for Projection with area of use
snowman2 Aug 14, 2021
60c5b38
Update url to PROJ docs
snowman2 Aug 18, 2021
e763573
MNT: Add cache for creating interpolator
greglucas Aug 22, 2021
6867415
BUG: Handle CustomConstructorCRS change in pyproj 3.2
snowman2 Aug 24, 2021
bc63290
MNT: Add an equals method on CRS objects
greglucas Aug 29, 2021
2db5efc
BUG: use pyproj for CRS comparison when string not equal
snowman2 Aug 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ environment:
matrix:
- PYTHON_VERSION: "3.9"
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
PACKAGES: "cython numpy matplotlib-base proj=7 pykdtree scipy"
PACKAGES: "cython numpy matplotlib-base pyproj pykdtree scipy"

install:
# Install miniconda
Expand All @@ -15,7 +15,7 @@ install:
- conda config --add channels conda-forge
- conda config --add channels conda-forge/label/testing
- set ENV_NAME=test-environment
- set PACKAGES=%PACKAGES% flufl.lock owslib pep8 pillow pyepsg pyshp pytest
- set PACKAGES=%PACKAGES% flufl.lock owslib pep8 pillow pyshp pytest
- set PACKAGES=%PACKAGES% requests setuptools_scm setuptools_scm_git_archive
- set PACKAGES=%PACKAGES% shapely
- conda create -n %ENV_NAME% python=%PYTHON_VERSION% %PACKAGES%
Expand All @@ -37,6 +37,7 @@ build_script:

test_script:
- set MPLBACKEND=Agg
- set PYPROJ_GLOBAL_CONTEXT=ON
- pytest --pyargs cartopy

artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ deps-run: &deps-install
numpy \
owslib \
pillow \
'proj<8' \
pyepsg \
pyproj \
pykdtree \
pyshp \
requests \
Expand All @@ -59,6 +58,7 @@ doc-run: &doc-build
name: Build documentation
command: |
source activate test-environment
PYPROJ_GLOBAL_CONTEXT=ON
make -C docs html


Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.9]
python-version: [3.7, 3.8, 3.9]
defaults:
run:
shell: bash -l {0}
Expand All @@ -26,16 +26,16 @@ jobs:
- name: Minimum packages
# Only run on macos for now
# Conda's linux packages don't grab the testing label of matplotlib causing failures due to freetype differences
if: matrix.python-version == '3.6' && matrix.os == 'macos-latest'
if: matrix.python-version == '3.7' && matrix.os == 'macos-latest'
id: minimum-packages
run: |
echo "PACKAGES=cython=0.28.5 matplotlib=2.2.2 numpy=1.16 owslib=0.17 proj4=5.2.0 scipy=1.2.0" >> $GITHUB_ENV
echo "PACKAGES=cython=0.28.5 matplotlib=3.1 numpy=1.18 owslib=0.17 pyproj=3.0 proj=8.0 scipy=1.2.0" >> $GITHUB_ENV
echo "CFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Latest packages
if: steps.minimum-packages.conclusion == 'skipped'
run: |
echo "PACKAGES=cython fiona matplotlib-base numpy proj<8 pykdtree scipy" >> $GITHUB_ENV
echo "PACKAGES=cython fiona matplotlib-base numpy pyproj pykdtree scipy" >> $GITHUB_ENV

- name: Coverage packages
id: coverage
Expand All @@ -48,7 +48,7 @@ jobs:

- name: Install dependencies
run: |
PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyepsg pyshp pytest"
PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyshp pytest"
PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm"
PACKAGES="$PACKAGES setuptools_scm_git_archive shapely"
conda install $PACKAGES
Expand All @@ -70,7 +70,7 @@ jobs:
# Check that the downloader tool at least knows where to get the data from (but don't actually download it)
python tools/cartopy_feature_download.py gshhs physical --dry-run
CARTOPY_GIT_DIR=$PWD
pytest -n 4 --doctest-modules --pyargs cartopy ${EXTRA_TEST_ARGS}
PYPROJ_GLOBAL_CONTEXT=ON pytest -n 4 --doctest-modules --pyargs cartopy ${EXTRA_TEST_ARGS}
snowman2 marked this conversation as resolved.
Show resolved Hide resolved

- name: Coveralls
if: steps.coverage.conclusion == 'success'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:

- name: Install dependencies
run: |
PACKAGES="cython fiona matplotlib-base numpy proj<8 pykdtree scipy"
PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyepsg pyshp pytest"
PACKAGES="cython fiona matplotlib-base numpy pyproj pykdtree scipy"
PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyshp pytest"
PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm"
PACKAGES="$PACKAGES setuptools_scm_git_archive shapely"
conda install $PACKAGES
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ benchmarks/envs/
*.swp
.ipynb_checkpoints/
.idea/
.vscode/

# Operating system files
\.DS_Store
Expand Down
9 changes: 4 additions & 5 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ Further information about the required dependencies can be found here:
**pyshp** 2.0 or later (https://pypi.python.org/pypi/pyshp)
Pure Python read/write support for ESRI Shapefile format.

**PROJ** 4.9.0 or later (https://proj4.org/)
Cartographic Projections library.
**PROJ** 8.0.0 or later (https://proj.org/).

**pyproj** 3.0.0 or later (https://github.com/pyproj4/pyproj/)
Python interface to PROJ (cartographic projections and coordinate transformations library).

Optional Dependencies
~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -109,9 +111,6 @@ to install these optional dependencies.
**Pillow** 1.7.8 or later (https://pypi.python.org/pypi/Pillow/2.3.0)
A popular fork of PythonImagingLibrary.

**pyepsg** 0.4.0 or later (https://github.com/rhattersley/pyepsg)
A simple Python interface to https://epsg.io

**pykdtree** 1.2.2 or later (https://github.com/storpipfugl/pykdtree)
A fast kd-tree implementation that is used for faster warping
of images than SciPy.
Expand Down
6 changes: 2 additions & 4 deletions examples/lines_and_polygons/effects_of_the_ellipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ def transform_fn(x, y, z=None):

def main():
# Define the two coordinate systems with different ellipses.
wgs84 = ccrs.PlateCarree(globe=ccrs.Globe(datum='WGS84',
ellipse='WGS84'))
sphere = ccrs.PlateCarree(globe=ccrs.Globe(datum='WGS84',
ellipse='sphere'))
wgs84 = ccrs.PlateCarree(globe=ccrs.Globe(ellipse='WGS84'))
sphere = ccrs.PlateCarree(globe=ccrs.Globe(ellipse='sphere'))

# Define the coordinate system of the data we have from Natural Earth and
# acquire the 1:10m physical coastline shapefile.
Expand Down
6 changes: 3 additions & 3 deletions examples/miscellanea/eccentric_ellipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def vesta_image():
img_globe = ccrs.Globe(semimajor_axis=285000., semiminor_axis=229000.,
ellipse=None)
img_proj = ccrs.PlateCarree(globe=img_globe)
img_extent = (-895353.906273091, 895353.906273091,
447676.9531365455, -447676.9531365455)
img_extent = (-180, 180,
-90, 90)
dopplershift marked this conversation as resolved.
Show resolved Hide resolved
return img, img_globe, img_proj, img_extent


Expand All @@ -60,7 +60,7 @@ def main():
projection = ccrs.Geostationary(globe=globe)

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=projection)
ax = fig.add_subplot(1, 1, 1, projection=projection, frameon=False)
dopplershift marked this conversation as resolved.
Show resolved Hide resolved
ax.imshow(img, transform=crs, extent=extent)
fig.text(.075, .012, "Image credit: NASA/JPL-Caltech/UCLA/MPS/DLR/IDA/PSI",
bbox={'facecolor': 'w', 'edgecolor': 'k'})
Expand Down
20 changes: 0 additions & 20 deletions lib/cartopy/_crs.pxd

This file was deleted.