Skip to content

Commit

Permalink
Update test minversions, pyvista min version (#1276)
Browse files Browse the repository at this point in the history
* Update test minversions

* Test newer pyvista

* Add headless server

* try pyvista 0.30.0

* try pyvista 0.27.0

* try pyvista 0.28.0

* try pyvista 0.29.0

* try pyvista 0.28.1

* pyvista 0.29 confirmed as min version
  • Loading branch information
adamjstewart authored Apr 24, 2023
1 parent e13de26 commit 5b74c97
Show file tree
Hide file tree
Showing 27 changed files with 35 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/min-reqs.old') }}-${{ hashFiles('requirements/mins-cons.old') }}
- name: Setup headless display for pyvista
uses: pyvista/setup-headless-display-action@v2
- name: Install apt dependencies (Linux)
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ repos:
hooks:
- id: mypy
args: [--strict, --ignore-missing-imports, --show-error-codes]
additional_dependencies: [torch>=2, torchmetrics>=0.10, lightning>=1.8, pytest>=6, pyvista>=0.20, omegaconf>=2.0.1, hydra-core>=1, kornia>=0.6, numpy>=1.22]
additional_dependencies: [torch>=2, torchmetrics>=0.10, lightning>=1.8, pytest>=6.1.2, pyvista>=0.29, omegaconf>=2.0.1, hydra-core>=1, kornia>=0.6.5, numpy>=1.22]
exclude: (build|data|dist|logo|logs|output)/
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pyproj>=3
- python>=3.9
- pytorch>=1.12
- pyvista>=0.25.2
- pyvista>=0.29
- rarfile>=4
- rasterio>=1.2
- shapely>=1.7.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/min-reqs.old
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ laspy==2.0.0
opencv-python==4.4.0.46
pandas==1.1.3
pycocotools==2.0.4
pyvista==0.25.2
pyvista==0.29.0
radiant-mlhub==0.3.0
rarfile==4.0
scikit-image==0.18.0
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ datasets =
pandas>=1.1.3,<3
# pycocotools 2.0.4+ required to avoid use of deprecated setuptools fetch_build_eggs
pycocotools>=2.0.4,<3
# pyvista 0.25.2 required for wheels
pyvista>=0.25.2,<0.39
# pyvista 0.29+ required for to avoid segfault during testing
pyvista>=0.29,<0.39
# radiant-mlhub 0.3+ required for newer tqdm support required by lightning
radiant-mlhub>=0.3,<0.6
# rarfile 4+ required for wheels
Expand Down
2 changes: 1 addition & 1 deletion tests/datamodules/test_usavars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TestUSAVarsDataModule:
@pytest.fixture
def datamodule(self, request: SubRequest) -> USAVarsDataModule:
pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")
root = os.path.join("tests", "data", "usavars")
batch_size = 1
num_workers = 0
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_benin_cashews.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TestBeninSmallHolderCashews:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path
) -> BeninSmallHolderCashews:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)
source_md5 = "255efff0f03bc6322470949a09bc76db"
labels_md5 = "ed2195d93ca6822d48eb02bc3e81c127"
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_cloud_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def fetch(dataset_id: str, **kwargs: str) -> Collection:
class TestCloudCoverDetection:
@pytest.fixture
def dataset(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> CloudCoverDetection:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)

test_image_meta = {
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_cv4a_kenya_crop_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fetch(dataset_id: str, **kwargs: str) -> Collection:
class TestCV4AKenyaCropType:
@pytest.fixture
def dataset(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> CV4AKenyaCropType:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)
source_md5 = "7f4dcb3f33743dddd73f453176308bfb"
labels_md5 = "95fc59f1d94a85ec00931d4d1280bec9"
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_cyclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TestTropicalCyclone:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest
) -> TropicalCyclone:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)
md5s = {
"train": {
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_eddmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from torchgeo.datasets import BoundingBox, EDDMapS, IntersectionDataset, UnionDataset

pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")


class TestEDDMapS:
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_gbif.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from torchgeo.datasets import GBIF, BoundingBox, IntersectionDataset, UnionDataset

pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")


class TestGBIF:
Expand Down
4 changes: 2 additions & 2 deletions tests/datasets/test_idtrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import torchgeo.datasets.utils
from torchgeo.datasets import IDTReeS

pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")
pytest.importorskip("laspy", minversion="2")


Expand Down Expand Up @@ -140,7 +140,7 @@ def test_plot(self, dataset: IDTReeS) -> None:
plt.close()

def test_plot_las(self, dataset: IDTReeS) -> None:
pyvista = pytest.importorskip("pyvista", minversion="0.35.1")
pyvista = pytest.importorskip("pyvista", minversion="0.29")

# Test point cloud without colors
point_cloud = dataset.plot_las(index=0)
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_inaturalist.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
UnionDataset,
)

pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")


class TestINaturalist:
Expand Down
4 changes: 2 additions & 2 deletions tests/datasets/test_landcoverai.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TestLandCoverAI:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest
) -> LandCoverAI:
pytest.importorskip("cv2", minversion="3.4.2.17")
pytest.importorskip("cv2", minversion="4.4.0.46")
monkeypatch.setattr(torchgeo.datasets.landcoverai, "download_url", download_url)
md5 = "ff8998857cc8511f644d3f7d0f3688d0"
monkeypatch.setattr(LandCoverAI, "md5", md5)
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_already_extracted(self, dataset: LandCoverAI) -> None:
LandCoverAI(root=dataset.root, download=True)

def test_already_downloaded(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> None:
pytest.importorskip("cv2", minversion="3.4.2.17")
pytest.importorskip("cv2", minversion="4.4.0.46")
sha256 = "ecec8e871faf1bbd8ca525ca95ddc1c1f5213f40afb94599884bd85f990ebd6b"
monkeypatch.setattr(LandCoverAI, "sha256", sha256)
url = os.path.join("tests", "data", "landcoverai", "landcover.ai.v1.zip")
Expand Down
4 changes: 2 additions & 2 deletions tests/datasets/test_nasa_marine_debris.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def fetch_corrupted(collection_id: str, **kwargs: str) -> Collection_corrupted:
class TestNASAMarineDebris:
@pytest.fixture()
def dataset(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> NASAMarineDebris:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)
md5s = ["6f4f0d2313323950e45bf3fc0c09b5de", "540cf1cf4fd2c13b609d0355abe955d7"]
monkeypatch.setattr(NASAMarineDebris, "md5s", md5s)
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_corrupted_new_download(
self, tmp_path: Path, monkeypatch: MonkeyPatch
) -> None:
with pytest.raises(RuntimeError, match="Dataset checksum mismatch."):
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch_corrupted)
NASAMarineDebris(root=str(tmp_path), download=True, checksum=True)

Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_openbuildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
UnionDataset,
)

pd = pytest.importorskip("pandas", minversion="0.23.2")
pd = pytest.importorskip("pandas", minversion="1.1.3")


class TestOpenBuildings:
Expand Down
4 changes: 2 additions & 2 deletions tests/datasets/test_reforestree.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def download_url(url: str, root: str, *args: str) -> None:
class TestReforesTree:
@pytest.fixture
def dataset(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> ReforesTree:
pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")
monkeypatch.setattr(torchgeo.datasets.utils, "download_url", download_url)
data_dir = os.path.join("tests", "data", "reforestree")

Expand Down Expand Up @@ -79,7 +79,7 @@ def test_len(self, dataset: ReforesTree) -> None:
assert len(dataset) == 2

def test_not_extracted(self, tmp_path: Path) -> None:
pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")
url = os.path.join("tests", "data", "reforestree", "reforesTree.zip")
shutil.copy(url, tmp_path)
ReforesTree(root=str(tmp_path))
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_resisc45.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestRESISC45:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest
) -> RESISC45:
pytest.importorskip("rarfile", minversion="3")
pytest.importorskip("rarfile", minversion="4")

monkeypatch.setattr(torchgeo.datasets.resisc45, "download_url", download_url)
md5 = "5895dea3757ba88707d52f5521c444d3"
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_so2sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from torchgeo.datasets import So2Sat

pytest.importorskip("h5py", minversion="2.6")
pytest.importorskip("h5py", minversion="3")


class TestSo2Sat:
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_spacenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

TEST_DATA_DIR = "tests/data/spacenet"
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")


class Collection:
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_usavars.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import torchgeo.datasets.utils
from torchgeo.datasets import USAVars

pytest.importorskip("pandas", minversion="0.23.2")
pytest.importorskip("pandas", minversion="1.1.3")


def download_url(url: str, root: str, *args: str, **kwargs: str) -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/datasets/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_mock_missing_module(mock_missing_module: None) -> None:
)
def test_extract_archive(src: str, tmp_path: Path) -> None:
if src.endswith(".rar"):
pytest.importorskip("rarfile", minversion="3")
pytest.importorskip("rarfile", minversion="4")
if src.startswith("chesapeake"):
pytest.importorskip("zipfile_deflate64")
extract_archive(os.path.join("tests", "data", src), str(tmp_path))
Expand Down Expand Up @@ -134,15 +134,15 @@ def test_download_and_extract_archive(tmp_path: Path, monkeypatch: MonkeyPatch)
def test_download_radiant_mlhub_dataset(
tmp_path: Path, monkeypatch: MonkeyPatch
) -> None:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Dataset, "fetch", fetch_dataset)
download_radiant_mlhub_dataset("", str(tmp_path))


def test_download_radiant_mlhub_collection(
tmp_path: Path, monkeypatch: MonkeyPatch
) -> None:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch_collection)
download_radiant_mlhub_collection("", str(tmp_path))

Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_vhr10.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestVHR10:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest
) -> VHR10:
pytest.importorskip("rarfile", minversion="3")
pytest.importorskip("rarfile", minversion="4")
monkeypatch.setattr(torchgeo.datasets.vhr10, "download_url", download_url)
monkeypatch.setattr(torchgeo.datasets.utils, "download_url", download_url)
url = os.path.join("tests", "data", "vhr10", "NWPU VHR-10 dataset.rar")
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_western_usa_live_fuel_moisture.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TestWesternUSALiveFuelMoisture:
def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path
) -> WesternUSALiveFuelMoisture:
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.3")
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch)
md5 = "ecbc9269dd27c4efe7aa887960054351"
monkeypatch.setattr(WesternUSALiveFuelMoisture, "md5", md5)
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_zuericrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import torchgeo.datasets.utils
from torchgeo.datasets import ZueriCrop

pytest.importorskip("h5py", minversion="2.6")
pytest.importorskip("h5py", minversion="3")


def download_url(url: str, root: str, *args: str, **kwargs: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/trainers/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_trainer(
self, monkeypatch: MonkeyPatch, name: str, fast_dev_run: bool
) -> None:
if name.startswith("so2sat"):
pytest.importorskip("h5py", minversion="2.6")
pytest.importorskip("h5py", minversion="3")

conf = OmegaConf.load(os.path.join("tests", "conf", name + ".yaml"))

Expand Down

0 comments on commit 5b74c97

Please sign in to comment.