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

address shapely 2.0 deprecations #1914

Merged
merged 2 commits into from
Oct 27, 2021
Merged

Conversation

akrherz
Copy link
Contributor

@akrherz akrherz commented Oct 26, 2021

Rationale

Addresses ShapelyDeprecationWarnings raised with the newly released Shapely 1.8 that is preparing for the upcoming Shapely 2.0 breaking API release.

Implications

No known implications nor previously supported shapely version conflicts.

fixes #1913

NB: My fork CI still emits three warnings, I am unsure if I am missing things yet or this is in other packages

Update, I ran pytest once with -W error::shapely.errors.ShapelyDeprecationWarning and believe I have found the source of the three previously listed warnings below.

  • /usr/share/miniconda/envs/test-environment/lib/python3.8/site-packages/numpy/testing/_private/utils.py:1046: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
  • <array_function internals>:5: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
  • /usr/share/miniconda/envs/test-environment/lib/python3.8/site-packages/numpy/lib/function_base.py:4817: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.

@akrherz
Copy link
Contributor Author

akrherz commented Oct 26, 2021

Darn, CI error py37+Mac appears to be unrelated to this PR.

@akrherz akrherz force-pushed the gh1913_shapely2 branch 2 times, most recently from 9a2ba26 to 33cd127 Compare October 27, 2021 03:16
@akrherz akrherz marked this pull request as draft October 27, 2021 03:31
@akrherz
Copy link
Contributor Author

akrherz commented Oct 27, 2021

I'm gonna track down those three warnings yet shown and then mark the PR ready once done.

@akrherz akrherz marked this pull request as ready for review October 27, 2021 03:54
@akrherz
Copy link
Contributor Author

akrherz commented Oct 27, 2021

OK and whew, I think I have found all the ShapelyDeprecationWarnings now.

@QuLogic
Copy link
Member

QuLogic commented Oct 27, 2021

Hmm, it looks like the Minimum dependency CI run does not pin Shapely. We should probably do that to be sure that this doesn't break older versions.

@akrherz
Copy link
Contributor Author

akrherz commented Oct 27, 2021

We should probably do that to be sure that this doesn't break older versions.

@QuLogic I think I have accomplished that now

@QuLogic QuLogic added this to the 0.21 milestone Oct 27, 2021
@QuLogic QuLogic merged commit 313f02f into SciTools:master Oct 27, 2021
@QuLogic
Copy link
Member

QuLogic commented Oct 27, 2021

Thanks @akrherz!

@jorisvandenbossche
Copy link
Contributor

Thanks for already addressing those warnings! (and glad that it didn't seem too problematic to address them)

A question and suggestion:

  • Would this be considered for a 0.20.2 release? (I don't know how far a 0.21 release is) Because right now everybody installing the latest versions of packages will see lots of warnings
  • I would suggest to add a upper pin to the shapely dependency in the install_requirements to be <2. That would prevent users to run into problems in the future if Shapely 2.0 is released and if the released version of cartopy at that moment does not yet support it (which is currently not yet the case, since you are also using shapely.geos.lgeos, for which we didn't add a deprecation warning ... updating for this is related to Minimizing incompatibility between cartopy and shapely #805 (comment))

@greglucas
Copy link
Contributor

Seems reasonable to include this in a patch release. I also don't have a huge issue with making a new minor release either.

@greglucas
Copy link
Contributor

@akrherz, do you want to point these two commits at v0.20.x? We can also add the shapely pin to that branch too then.

@akrherz akrherz deleted the gh1913_shapely2 branch November 12, 2021 16:08
@akrherz
Copy link
Contributor Author

akrherz commented Nov 12, 2021

@akrherz, do you want to point these two commits at v0.20.x?

Hopefully I did what you requested in #1930

@greglucas greglucas mentioned this pull request Nov 14, 2021
@dopplershift dopplershift modified the milestones: 0.21, 0.20.2 Nov 15, 2021
wx4stg added a commit to wx4stg/hdwx-hlma that referenced this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address Shapely 2.0 Deprecations
5 participants