cartopy icon indicating copy to clipboard operation
cartopy copied to clipboard

Compatibility with shapely 2.0 (remove usage of lgeos)

Open jorisvandenbossche opened this issue 3 years ago • 1 comments

Rationale

See https://github.com/SciTools/cartopy/issues/2076.

It is actually relatively easy to remove the usage of shapely.geos.lgeos, which is removed in Shapely 2.0, as a first step to make cartopy compatible with Shapely 2.0 (without making use of new features).

I think this should actually be a safe change to include in a 0.21.1 bug-fix release, in case that would be planned.

Now, while this is a necessary change to run the test suite with Shapely 2.0, there are still some other failures, but for things that potentially can be fixed on Shapely's side (see https://github.com/SciTools/cartopy/issues/2076#issuecomment-1243294605 for details)

jorisvandenbossche avatar Sep 12 '22 06:09 jorisvandenbossche

@jorisvandenbossche, thanks for the patch! I agree that this seems reasonable for a patch release. Can you revert all the pins throughout the documentation? https://github.com/SciTools/cartopy/commit/ad1ec1a4b901556a2111d6f87dbd09d9b4f920a2

Cartopy was not compatible with MPL 3.6 or Shapely 2.0, so we were trying to get ahead of the MPL 3.6 release. I am not opposed to turning this around for a quick v0.21.1 tag to remove the pin on Shapely though so more people can test.

greglucas avatar Sep 12 '22 20:09 greglucas

Reverted the pins (and all required PRs on the Shapely side are now fixed)

jorisvandenbossche avatar Sep 27 '22 20:09 jorisvandenbossche

The doc build failure seems unrelated?

jorisvandenbossche avatar Sep 29 '22 11:09 jorisvandenbossche

I dug into the doc failure and it's from Matplotlib 3.6: matplotlib/matplotlib#24053.

dopplershift avatar Sep 29 '22 18:09 dopplershift

The Shapely team just published version 2.0b1, so this might be a good point in time to publish this Cartopy improvement and (let the community) test them together. 😄

felixdivo avatar Oct 18 '22 08:10 felixdivo

Yes, shapely 2.0b1 should contain all fixes to have this working.

You could replace the pip install git+https://github.com/shapely/shapely.git@main with pip install --pre

jorisvandenbossche avatar Oct 18 '22 13:10 jorisvandenbossche