Skip to content

Commit

Permalink
Add dependencies, add test for refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
sfalkena committed Sep 18, 2024
1 parent 60539ad commit bc3300a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions requirements/min-reqs.old
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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
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
Expand Down
2 changes: 2 additions & 0 deletions requirements/required.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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
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
Expand Down
8 changes: 8 additions & 0 deletions tests/samplers/test_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit bc3300a

Please sign in to comment.