uxarray
uxarray copied to clipboard
Are `spatialpandas` and `antimeridian` optional dependencies?
Discussed in https://github.com/UXARRAY/uxarray/discussions/756
Originally posted by tomvothecoder April 8, 2024 Hello, I'm going through the Visualizing Grid Topology notebook in the documentation.
I tried to run grid.plot
but get ModuleNotFoundError: No module named 'spatialpandas'
.
File ~/miniforge3/envs/xcdat_test_uxarray/lib/python3.12/site-packages/uxarray/grid/geometry.py:134, in _build_geodataframe_with_antimeridian(polygon_shells, antimeridian_face_indices)
131 """Builds a ``spatialpandas.GeoDataFrame`` including any faces that cross
132 the antimeridian."""
133 # import optional dependencies
--> 134 from spatialpandas.geometry import MultiPolygonArray
135 from spatialpandas import GeoDataFrame
137 polygons = _build_corrected_shapely_polygons(
138 polygon_shells, antimeridian_face_indices
139 )
ModuleNotFoundError: No module named 'spatialpandas'
I assumed that uxarray
would include spatialpandas
since the Installation page doesn't list optional dependencies. However, I see that the conda recipe doesn't list spatialpandas
and the stack trace says it is an optional dependency (line 133 above).
I'm just making sure if I should install spatialpandas
alongside uxarray
. Thanks!