esda
esda copied to clipboard
Is `geopandas` a hard dependency for `esda` now?
Is geopandas a hard dependency for esda now?
from geopandas import GeoSeries
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.
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?
It should be easy to move it to a function-level import?
This has been resolved.