diff --git a/pyproject.toml b/pyproject.toml index ca5159fde52..b3f1eba68ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,8 @@ dependencies = [ "einops>=0.3", # fiona 1.8.21+ required for Python 3.10 wheels "fiona>=1.8.21", + # geopandas 0.13.2 is the last version to support pandas 1.3, but has feather support + "geopandas=0.13.2", # kornia 0.7.3+ required for instance segmentation support in AugmentationSequential "kornia>=0.7.3", # lightly 1.4.5+ required for LARS optimizer @@ -58,6 +60,8 @@ dependencies = [ "pandas>=1.3.3", # pillow 8.4+ required for Python 3.10 wheels "pillow>=8.4", + # pyarrow 12.0+ required for feather support + "pyarrow>=17.0.0", # pyproj 3.3+ required for Python 3.10 wheels "pyproj>=3.3", # rasterio 1.3+ required for Python 3.10 wheels diff --git a/requirements/min-reqs.old b/requirements/min-reqs.old index a6e91f70fe9..24e15ba962a 100644 --- a/requirements/min-reqs.old +++ b/requirements/min-reqs.old @@ -4,6 +4,7 @@ setuptools==61.0.0 # install einops==0.3.0 fiona==1.8.21 +geopandas==0.13.2 kornia==0.7.3 lightly==1.4.5 lightning[pytorch-extra]==2.0.0 @@ -11,6 +12,7 @@ matplotlib==3.5.0 numpy==1.21.2 pandas==1.3.3 pillow==8.4.0 +pyarrow==17.0.0 pyproj==3.3.0 rasterio==1.3.0.post1 rtree==1.0.0 diff --git a/requirements/required.txt b/requirements/required.txt index 2fbcd75f732..27ae0610102 100644 --- a/requirements/required.txt +++ b/requirements/required.txt @@ -4,6 +4,7 @@ setuptools==75.1.0 # install einops==0.8.0 fiona==1.10.1 +geopandas==0.14.4 kornia==0.7.3 lightly==1.5.12 lightning[pytorch-extra]==2.4.0 @@ -11,6 +12,7 @@ matplotlib==3.9.2 numpy==2.1.1 pandas==2.2.2 pillow==10.4.0 +pyarrow==17.0.0 pyproj==3.6.1 rasterio==1.3.11 rtree==1.3.0 diff --git a/tests/samplers/test_single.py b/tests/samplers/test_single.py index 764a100c727..00f5889a22f 100644 --- a/tests/samplers/test_single.py +++ b/tests/samplers/test_single.py @@ -189,6 +189,14 @@ def test_empty(self, dataset: CustomGeoDataset) -> None: sampler = RandomGeoSampler(dataset, 5, length=0) assert len(sampler) == 0 + def test_refresh_samples(self, dataset: CustomGeoDataset) -> None: + sampler = RandomGeoSampler(dataset, 5, length=1) + samples = list(sampler) + assert len(sampler) == 1 + sampler.refresh_samples() + assert list(sampler) != samples + assert len(sampler) == 1 + def test_small_area(self) -> None: ds = CustomGeoDataset(res=1) ds.index.insert(0, (0, 10, 0, 10, 0, 10))