Skip to content

Commit 7681f7c

Browse files
authored
bump oldest dependency versions as per spec000 – 2025-10 (#717)
* initial attempt at Python 3.14 support * bump oldest dependency version - #715 * remove 314 stuff snuck in from #716 * bump oldest numba * remove unneeded lower bound logic
1 parent fca1ba1 commit 7681f7c

File tree

7 files changed

+19
-64
lines changed

7 files changed

+19
-64
lines changed

ci/envs/311-oldest.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.11
6-
- geopandas=0.14
6+
- geopandas=1.0
77
- inequality
88
- libpysal=4.12.0
99
- mapclassify
10-
- networkx=3.2
11-
- numpy=1.25
10+
- networkx=3.3
11+
- numpy=2.0
1212
- packaging
13-
- pandas=2.0
13+
- pandas=2.2
1414
- shapely=2.0
15-
- tqdm=4.65
16-
- numba=0.58
15+
- tqdm=4.67
16+
- numba=0.60
1717
- fiona=1.10
1818
# testing
1919
- codecov

docs/install.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ Dependencies
8484

8585
Required dependencies:
8686

87-
- `geopandas`_ (>= 0.12.0)
87+
- `geopandas`_ (>= 1.0)
8888
- `libpysal`_ (>= 4.12.0)
8989
- `networkx`_
9090
- `tqdm`_
9191

9292
Some functions also depend on additional packages, which are optional:
9393

94-
- `mapclassify`_ (>= 2.4.2)
94+
- `mapclassify`_
9595
- `inequality`_
9696
- `numba`_
9797
- `esda`_
@@ -111,7 +111,7 @@ Some functions also depend on additional packages, which are optional:
111111

112112
.. _numba: https://numba.pydata.org
113113

114-
.. _tqdm: http://networkx.github.io
114+
.. _tqdm: https://tqdm.github.io
115115

116116
.. _pysal: http://pysal.org
117117

momepy/diversity.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from libpysal.graph import Graph
44
from libpysal.graph._utils import _percentile_filtration_grouper
55
from numpy.typing import NDArray
6-
from packaging.version import Version
76
from pandas import DataFrame, Series
87

98
try:
@@ -162,9 +161,6 @@ def describe_agg(
162161
6.0 652.432194 32.829824
163162
""" # noqa: E501
164163

165-
if Version(pd.__version__) <= Version("2.1.0"):
166-
raise ImportError("pandas 2.1.0 or newer is required to use this function.")
167-
168164
# series indice needs renaming, since multiindices
169165
# without explicit names cannot be joined
170166
if isinstance(y, np.ndarray):
@@ -289,9 +285,6 @@ def describe_reached_agg(
289285
4 683.514930 NaN
290286
""" # noqa: E501
291287

292-
if Version(pd.__version__) <= Version("2.1.0"):
293-
raise ImportError("pandas 2.1.0 or newer is required to use this function.")
294-
295288
# series indice needs renaming, since multiindices
296289
# without explicit names cannot be joined
297290
if isinstance(y, np.ndarray):

momepy/elements.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from shapely.geometry.base import BaseGeometry
1414
from shapely.ops import polygonize
1515

16-
GPD_GE_10 = Version(gpd.__version__) >= Version("1.0dev")
1716
SHPLY_GE_210 = Version(shapely.__version__) >= Version("2.1.0")
1817

1918
__all__ = [
@@ -127,7 +126,7 @@ def morphological_tessellation(
127126
)
128127

129128
if isinstance(clip, GeoSeries | GeoDataFrame):
130-
clip = clip.union_all() if GPD_GE_10 else clip.unary_union
129+
clip = clip.union_all()
131130

132131
mt = voronoi_frames(
133132
geometry,
@@ -772,11 +771,7 @@ def buffered_limit(
772771
elif not isinstance(buffer, int | float):
773772
raise ValueError("`buffer` must be either 'adaptive' or a number.")
774773

775-
return (
776-
gdf.buffer(buffer, **kwargs).union_all()
777-
if GPD_GE_10
778-
else gdf.buffer(buffer, **kwargs).unary_union
779-
)
774+
return gdf.buffer(buffer, **kwargs).union_all()
780775

781776

782777
def get_network_ratio(df, edges, initial_buffer=500):
@@ -921,7 +916,7 @@ def enclosures(
921916
barriers = pd.concat([primary_barriers.geometry, limit_b.geometry])
922917
else:
923918
barriers = primary_barriers
924-
unioned = barriers.union_all() if GPD_GE_10 else barriers.unary_union
919+
unioned = barriers.union_all()
925920
polygons = polygonize(unioned)
926921
enclosures = gpd.GeoSeries(list(polygons), crs=primary_barriers.crs)
927922

momepy/tests/test_diversity.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
import pandas as pd
44
import pytest
55
from libpysal.graph import Graph
6-
from packaging.version import Version
76
from pandas.testing import assert_frame_equal, assert_series_equal
87

98
import momepy as mm
109

1110
from .conftest import assert_frame_result, assert_result
1211

13-
PD_210 = Version(pd.__version__) >= Version("2.1.0")
14-
1512

1613
class TestDescribe:
1714
def setup_method(self):
@@ -394,9 +391,6 @@ def test_unique(self):
394391
un_nan_drop, un_nan_drop_expected, self.df_tessellation, check_names=False
395392
)
396393

397-
@pytest.mark.skipif(
398-
not PD_210, reason="aggregation is different in previous pandas versions"
399-
)
400394
def test_describe_agg(self):
401395
df = mm.describe_agg(
402396
self.df_buildings["area"],
@@ -469,9 +463,6 @@ def test_describe_agg(self):
469463
assert_result(df["sum"], expected_fl_area_sum, result_index)
470464
assert_result(df["mean"], expected_fl_area_mean, result_index)
471465

472-
@pytest.mark.skipif(
473-
not PD_210, reason="aggregation is different in previous pandas versions"
474-
)
475466
def test_describe_cols(self):
476467
df = mm.describe_agg(
477468
self.df_buildings["area"],
@@ -480,9 +471,6 @@ def test_describe_cols(self):
480471
)
481472
assert list(df.columns) == ["min", "max"]
482473

483-
@pytest.mark.skipif(
484-
not PD_210, reason="aggregation is different in previous pandas versions"
485-
)
486474
def test_describe_reached_agg(self):
487475
df_sw = mm.describe_reached_agg(
488476
self.df_buildings["fl_area"], self.df_buildings["nID"], graph=self.graph_sw
@@ -512,9 +500,6 @@ def test_describe_reached_agg(self):
512500
filtered_df["count"], filtered_expected, self.df_streets, check_names=False
513501
)
514502

515-
@pytest.mark.skipif(
516-
not PD_210, reason="aggregation is different in previous pandas versions"
517-
)
518503
def test_describe_reached_input_equality(self):
519504
island_result_df = mm.describe_agg(
520505
self.df_buildings["area"], self.df_buildings["nID"]
@@ -529,9 +514,6 @@ def test_describe_reached_input_equality(self):
529514
island_result_df.values, island_result_ndarray.values, equal_nan=True
530515
)
531516

532-
@pytest.mark.skipif(
533-
not PD_210, reason="aggregation is different in previous pandas versions"
534-
)
535517
def test_describe_reached_cols(self):
536518
df = mm.describe_reached_agg(
537519
self.df_buildings["fl_area"],
@@ -542,9 +524,6 @@ def test_describe_reached_cols(self):
542524
)
543525
assert list(df.columns) == ["min", "max"]
544526

545-
@pytest.mark.skipif(
546-
not PD_210, reason="aggregation is different in previous pandas versions"
547-
)
548527
def test_na_results(self):
549528
nan_areas = self.df_buildings["area"]
550529
nan_areas.iloc[range(0, len(self.df_buildings), 3),] = np.nan
@@ -614,9 +593,6 @@ def test_density(self):
614593
check_names=False,
615594
)
616595

617-
@pytest.mark.skipif(
618-
not PD_210, reason="aggregation is different in previous pandas versions"
619-
)
620596
def test_unweighted_percentile(self):
621597
perc = mm.percentile(self.df_tessellation["area"], self.diversity_graph)
622598
perc_expected = {
@@ -662,9 +638,6 @@ def test_unweighted_percentile(self):
662638
perc = mm.percentile(self.df_tessellation["area"].iloc[:100], graph)
663639
assert perc.loc[0].isna().all()
664640

665-
@pytest.mark.skipif(
666-
not PD_210, reason="aggregation is different in previous pandas versions"
667-
)
668641
def test_distance_decay_linearly_weighted_percentiles(self):
669642
# setup weight decay graph
670643

momepy/tests/test_intensity.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
import networkx as nx
33
import numpy as np
44
import pandas as pd
5-
import pytest
65
from libpysal.graph import Graph
7-
from packaging.version import Version
86
from pandas.testing import assert_series_equal
97

108
import momepy as mm
119

1210
from .conftest import assert_result
1311

14-
PD_210 = Version(pd.__version__) >= Version("2.1.0")
15-
1612

1713
class TestIntensity:
1814
def setup_method(self):
@@ -95,9 +91,6 @@ def test_node_density(self):
9591
assert_series_equal(alternative_density, density)
9692
assert_series_equal(alternative_weighted, weighted)
9793

98-
@pytest.mark.skipif(
99-
not PD_210, reason="aggregation is different in previous pandas versions"
100-
)
10194
def test_area_ratio(self):
10295
def area_ratio(overlay, covering, agg_key):
10396
res = mm.describe_agg(covering, agg_key)

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ classifiers = [
3434
]
3535
requires-python = ">=3.11"
3636
dependencies = [
37-
"geopandas>=0.14.0",
37+
"geopandas>=1.0",
3838
"libpysal>=4.12.0",
39-
"networkx>=3.2",
39+
"networkx>=3.3",
40+
"numpy>=2.0",
4041
"packaging",
41-
"pandas>=2.0",
42-
"shapely>=2",
43-
"tqdm>=4.65",
42+
"pandas>=2.2",
43+
"shapely>=2.0",
44+
"tqdm>=4.67",
4445
]
4546

4647
[project.urls]
@@ -49,7 +50,7 @@ Repository = "https://github.com/pysal/momepy"
4950

5051
[project.optional-dependencies]
5152
plus = [
52-
"numba",
53+
"numba>=0.60",
5354
"inequality",
5455
"mapclassify",
5556
"esda",

0 commit comments

Comments
 (0)