code-lab-org / tatc

Tradespace Analysis Toolkit for Constellations (version 3) Library
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

geoplot compatibility issue with shapely 2.0 #26

Closed mpj15 closed 1 year ago

mpj15 commented 1 year ago

Shapely 2.0.1 has deprecated some features that prevent the example CollectOrbitGroundTrack.ipynb from running. This is not an issue with TATC per se, but rather with geoplot as used in the TATC example notebook.

There are three options:

  1. Since geoplot is not being actively developed, could just drop geoplot from the examples.
  2. Pin shapely to version 1.8.5. But Shapely 2.0 seems to have some good features and speedups.
  3. Adjust the example code to work with shapely 2.0. I tried to do this, but it wasn't easily able to figure out how. It's not as simple as reading the shapely 1.8 to 2.0 migration doc here: https://shapely.readthedocs.io/en/stable/migration.html#migration

I found the error on Windows and Mac, with TATC installed from Conda-Forge (v3.1.2), Shapely v2.0.1, Geoplot v.0.5.1. Python version 3.9.

The specific errors are:

geoplot.choropleth() and geoplot.polyplot() both throw two errors

Screenshot below:

image
ptgrogan commented 1 year ago

Thanks for posting the issue. I have been cleaning up the dependencies and have opted for Shapely 2.0 for the reasons mentioned. I have had good experiences recently using GeoPandas for plotting so the GeoPlot dependency can be phased out of the examples. I will update them as time allows.

ptgrogan commented 1 year ago

30 replaces the geoplot examples with native geopandas and de-conflicts some of the dependencies to allow better compatibility. Dependency management is still a work in progress.