pysal / spopt

Spatial Optimization
https://pysal.org/spopt/
BSD 3-Clause "New" or "Revised" License
306 stars 46 forks source link

FutureWarning: The 'unary_union' attribute is deprecated – ignore for now? #453

Closed jGaboardi closed 7 months ago

jGaboardi commented 7 months ago

As a follow up & confirmation of #437, this is still being thrown in the DEV environment. Was I correct in thinking that this was fixed in #437 or did I misunderstand something?

spopt/tests/test_clscp-so.py: 5 warnings
spopt/tests/test_locate_util.py: 18 warnings
spopt/tests/test_c_p_median.py: 3 warnings
spopt/tests/test_lscp.py: 8 warnings
spopt/tests/test_lscpb.py: 8 warnings
spopt/tests/test_mclp.py: 8 warnings
spopt/tests/test_p_center.py: 7 warnings
spopt/tests/test_p_dispersion.py: 4 warnings
spopt/tests/test_p_median.py: 8 warnings
  /home/runner/work/spopt/spopt/spopt/tests/conftest.py:87: FutureWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.
    net_space = net_buffer.union_all() if GPD_GE_10 else net_buffer.unary_union

spopt/tests/test_clscp-so.py: 10 warnings
spopt/tests/test_c_p_median.py: 6 warnings
spopt/tests/test_lscp.py: 16 warnings
spopt/tests/test_locate_util.py: 2 warnings
spopt/tests/test_lscpb.py: 16 warnings
spopt/tests/test_mclp.py: 16 warnings
spopt/tests/test_p_center.py: 14 warnings
spopt/tests/test_p_dispersion.py: 4 warnings
spopt/tests/test_p_median.py: 16 warnings
  /home/runner/work/spopt/spopt/spopt/locate/util.py:70: FutureWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.
    geom = in_data.geometry.unary_union

xref #449

martinfleis commented 7 months ago

We have the check as

Version(geopandas.__version__) >= Version("1.0")

which means that the dev version returns False here. You can do Version("1.0dev") to include the alpha in the checks but in any case, the warning will not show up with the stable GeoPandas 1.0.

jGaboardi commented 7 months ago

Got it. We'll keep as is then.