esda icon indicating copy to clipboard operation
esda copied to clipboard

Is `geopandas` a hard dependency for `esda` now?

Open weikang9009 opened this issue 5 years ago • 3 comments

Is geopandas a hard dependency for esda now?

adbscan imports geopandas:

from geopandas import GeoSeries

weikang9009 avatar Jun 09 '20 21:06 weikang9009

Good catch! Yes, as of now it is. However, it's only called to instantiate the return of clusters found:

https://github.com/pysal/esda/blob/c0118207bbf6427e4d7ab2637441d9ae9f4745d9/esda/adbscan.py#L519

So we could remove the hard requirement. If the machine has geopandas, it returns a GeoSeries (a lot more convenient), otherwise it returns a list of shapely polygons from the alpha shape algo.

This is if we don't want to make it a hard dependency, that is. I'm ambivalent.

darribas avatar Jun 10 '20 07:06 darribas

Thanks for the explanation. I prefer to make it a soft dependency as esda is considered to be light-weighted to me and has a bunch of upstream packages (e.g. giddy) which are currently not (hard) dependent on geopandas. Since only geopandas is not extensively used in esda, it might be more reasonable to not make it a hard dependency for now?

weikang9009 avatar Jun 10 '20 14:06 weikang9009

It should be easy to move it to a function-level import?

ljwolf avatar Jun 10 '20 14:06 ljwolf

This has been resolved.

jGaboardi avatar Nov 23 '22 18:11 jGaboardi