csdms / pymt

A Python toolkit for running and coupling Earth surface models
https://pymt.readthedocs.io
MIT License
52 stars 20 forks source link

shapely>=2.0 is incompatible with pymt #164

Closed mdpiper closed 1 month ago

mdpiper commented 1 year ago

shapely had a major release recently, and it looks like the geometry types changed, which causes pymt to fail:

 ______________________ ERROR collecting pymt/grids/map.py ______________________
Traceback (most recent call last):
  File "/Users/runner/work/pymt/pymt/pymt/grids/map.py", line 49, in <module>
    from shapely.geometry import Point, asLineString, asPoint, asPolygon
ImportError: cannot import name 'asLineString' from 'shapely.geometry' (/usr/local/miniconda/envs/test/lib/python3.8/site-packages/shapely/geometry/__init__.py)
mdpiper commented 1 year ago

Requiring shapely<2 works.

The solution might be as simple as changing the asLineString type to LineString.

mdpiper commented 1 month ago

This is blocking building pymt on Python 3.12.