Skip to content

Commit 5dbc78b

Browse files
authored
include numba in dev CI env, compat with dev libpysal (#710)
* include numba in dev CI env * conditional expecation * fix the assertion order
1 parent 4d352b5 commit 5dbc78b

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

ci/envs/313-dev.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ dependencies:
55
- python=3.13
66
- packaging
77
- tqdm
8-
# - numba
8+
- numba
99
# testing
1010
- codecov
1111
- pytest
1212
- pytest-cov
1313
- pip
1414
- pip:
1515
- --pre --index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --extra-index-url https://pypi.org/simple
16-
- numpy
1716
- pandas
1817
- shapely
1918
- git+https://github.com/geopandas/geopandas.git

momepy/tests/test_elements.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import uuid
22

33
import geopandas as gpd
4+
import libpysal
45
import numpy as np
56
import pandas as pd
67
import pytest
@@ -14,6 +15,7 @@
1415
import momepy as mm
1516

1617
SHPLY_GE_210 = Version(shapely.__version__) >= Version("2.1.0")
18+
LPS_G_4_13_0 = Version(libpysal.__version__) > Version("4.13.0")
1719

1820

1921
class TestElements:
@@ -285,22 +287,35 @@ def test_get_nearest_node_missing(self):
285287
def test_buffered_limit(self):
286288
limit = mm.buffered_limit(self.df_buildings, 50)
287289
assert limit.geom_type == "Polygon"
288-
assert pytest.approx(limit.area) == 366525.967849688
290+
exp = 366525.967849688
291+
assert exp == pytest.approx(limit.area)
289292

290293
def test_buffered_limit_adaptive(self):
291294
limit = mm.buffered_limit(self.df_buildings, "adaptive")
292295
assert limit.geom_type == "Polygon"
293-
assert pytest.approx(limit.area) == 355819.18954170
296+
if LPS_G_4_13_0:
297+
exp = 347096.5835217
298+
else:
299+
exp = 355819.1895417
300+
assert exp == pytest.approx(limit.area)
294301

295302
limit = mm.buffered_limit(self.df_buildings, "adaptive", max_buffer=30)
296303
assert limit.geom_type == "Polygon"
297-
assert pytest.approx(limit.area) == 304200.301833294
304+
if LPS_G_4_13_0:
305+
exp = 304712.451361391
306+
else:
307+
exp = 304200.301833294
308+
assert exp == pytest.approx(limit.area)
298309

299310
limit = mm.buffered_limit(
300311
self.df_buildings, "adaptive", min_buffer=30, max_buffer=300
301312
)
302313
assert limit.geom_type == "Polygon"
303-
assert pytest.approx(limit.area) == 357671.831894244
314+
if LPS_G_4_13_0:
315+
exp = 348777.778371144
316+
else:
317+
exp = 357671.831894244
318+
assert exp == pytest.approx(limit.area)
304319

305320
def test_buffered_limit_error(self):
306321
with pytest.raises(

0 commit comments

Comments
 (0)