Closed jmon12 closed 2 years ago
Hum I just saw that catching the warnings is already used in network.py
, e.g. in geoms_to_array
...
I probably had a too strict vision of what direct dependencies are.
I will add warning filters when it is safe and necessary for similar shapely
deprecation warnings.
Description
Using recent versions of
shapely
(here1.8.2
), every timesnkit.network.split_edge_at_points
is used, the following warning is shown:This relates to the attempts to harmonize the handling of errors in
shapely
, see the related issue. I didn't find anything related ingeopandas
issues.Investigation and potential solutions
For
shapely >= 1.8
, it seems that the correct usage would be usingexcept GeometryTypeError
(to verify), but this is problematic in terms of requirements:shapely
is not a direct requirement ofsnkit
(and shouldn't be)snkit
requiresgeopandas>=0.10
, which requiresshapely>=1.6
geopandas
dev version still requiresshapely>=1.7
, not yetshapely>=1.8
The current solution is to catch the warning:
Conclusions
The problem would be solved upstream when
geopandas
increments theshapely
requirements. But even so, I don't think it is worth a highergeopandas
requirements, e.g.geopandas >=0.12
.What are the possibilities?
snkit
, but this would have the ironical consequence to makeshapely
a direct dependency by importingShapelyDeprecationWarning
shapely 2.0
?