Open LucaMarconato opened 1 year ago
Opened an issue in the geopandas
repo: https://github.com/geopandas/geopandas/issues/2920
A workaround for deepcopy
that overcomes this must be used in
sdata_blobs()
(conftest.py
)test_aggregate_requiring_alignment()
(test_aggregations.py
)Added this to spatialdata._utils
and using this in the above mentioned locations.
def _deepcopy_geodataframe(gdf: GeoDataFrame) -> GeoDataFrame:
"""
temporary fix for https://github.com/scverse/spatialdata/issues/286
Parameters
----------
gdf
The GeoDataFrame to deepcopy
Returns
-------
A deepcopy of the GeoDataFrame
"""
#
new_gdf = deepcopy(gdf)
new_attrs = deepcopy(gdf.attrs)
new_gdf.attrs = new_attrs
return new_gdf
This fails: