dekamps / miind

http://miind.sf.net
MIT License
13 stars 7 forks source link

python-descartes is no longer maintained, please consider dropping it as a dependency #48

Open sanjayankur31 opened 3 years ago

sanjayankur31 commented 3 years ago

Hello,

thanks @hugh-osborne for dropping in to our weekly NeuroFedora meeting to tell us about MIIND. It looks great, and we're working on including it in NeuroFedora now:

https://pagure.io/neuro-sig/NeuroFedora/issue/449

We noticed that MIIND currently depends on descartes, which unfortunately is no longer maintained. The last release was in 2017, and the bitbucket project also does not exist any more. As a result, its tests are now failing and it is on the verge of being retired from Fedora:

https://bugzilla.redhat.com/show_bug.cgi?id=1907389

The Fedora maintainer also notes that other libraries like geopandas are also preparing to drop descartes as a dependency:

https://bugzilla.redhat.com/show_bug.cgi?id=1907389#c3

Would it be possible to please move away from using descartes in MIINDS too?

Cheers,

hugh-osborne commented 3 years ago

This shouldn't be a difficult fix. Descartes is used to conveniently build a PatchCollection from shapely.geometry.polygon.Polygons so that the density and mesh can be rendered using matplotlib. This can be done manually instead (as it was in an older version of MIIND).

Tasks required to fix: Remove the "from descartes.patch import PolygonPatch" dependency from python/miind_api/MeshTools.py python/miind_api/Result.py python/miind_api/Density.py python/miind_api/Marginal.py

In MeshTools.plotMesh remove the patches local variable. Convert the list of shapely.Polygon, polygons, to a list of matplotlib.patches.Polygon and pass to PatchCollection.

In Density.patches, as in MeshTools, return a list of matplotlib.patches.Polygon instead of shapely.Polygon.

Check for any other references to Descartes.

Confirm that there is no effect on the speed of rendering plots with this change.

Extra points:

We might not need shapely either. Check to see if this is the case and remove if possible.