* 0.5.0 release

* Fix caching hash

* Warnings not raised because not final layer

* Skip tests that require optional deps

* Isort fixes

* Fix? ChesapeakeCVPR tests

* Hack to avoid GeoDataset bug
This commit is contained in:
Adam J. Stewart 2023-09-30 16:43:39 -05:00 коммит произвёл GitHub
Родитель 18139b440b
Коммит 68f37da155
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 36 добавлений и 34 удалений

6
.github/workflows/release.yaml поставляемый
Просмотреть файл

@ -22,7 +22,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[tests]
@ -48,7 +48,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[datasets,tests]
@ -74,7 +74,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[docs,tests] planetary_computer pystac

2
.github/workflows/tutorials.yaml поставляемый
Просмотреть файл

@ -26,7 +26,7 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[docs,tests] planetary_computer pystac

Просмотреть файл

@ -189,6 +189,7 @@
"outputs": [],
"source": [
"chesapeake_root = os.path.join(tempfile.gettempdir(), \"chesapeake\")\n",
"os.makedirs(chesapeake_root, exist_ok=True)\n",
"chesapeake = ChesapeakeDE(chesapeake_root, crs=naip.crs, res=naip.res, download=True)"
]
},

Просмотреть файл

@ -81,6 +81,7 @@ class TestADVANCE:
dataset[0]
def test_plot(self, dataset: ADVANCE) -> None:
pytest.importorskip("scipy", minversion="1.6.2")
x = dataset[0].copy()
dataset.plot(x, suptitle="Test")
plt.close()

Просмотреть файл

@ -18,6 +18,8 @@ from pytest import MonkeyPatch
import torchgeo.datasets.utils
from torchgeo.datasets import SKIPPD
pytest.importorskip("h5py", minversion="3")
def download_url(url: str, root: str, *args: str, **kwargs: str) -> None:
shutil.copy(url, root)

Просмотреть файл

@ -17,6 +17,9 @@ from torchgeo.datasets import NASAMarineDebris
from torchgeo.main import main
from torchgeo.trainers import ObjectDetectionTask
# MAP metric requires pycocotools to be installed
pytest.importorskip("pycocotools")
class PredictObjectDetectionDataModule(NASAMarineDebrisDataModule):
def setup(self, stage: str) -> None:

Просмотреть файл

@ -128,20 +128,16 @@ class TestMoCoTask:
@pytest.mark.slow
def test_weight_enum_download(self, weights: WeightsEnum) -> None:
match = "num classes .* != num classes in pretrained model"
with pytest.warns(UserWarning, match=match):
MoCoTask(
model=weights.meta["model"],
weights=weights,
in_channels=weights.meta["in_chans"],
)
MoCoTask(
model=weights.meta["model"],
weights=weights,
in_channels=weights.meta["in_chans"],
)
@pytest.mark.slow
def test_weight_str_download(self, weights: WeightsEnum) -> None:
match = "num classes .* != num classes in pretrained model"
with pytest.warns(UserWarning, match=match):
MoCoTask(
model=weights.meta["model"],
weights=str(weights),
in_channels=weights.meta["in_chans"],
)
MoCoTask(
model=weights.meta["model"],
weights=str(weights),
in_channels=weights.meta["in_chans"],
)

Просмотреть файл

@ -66,6 +66,9 @@ class TestRegressionTask:
def test_trainer(
self, monkeypatch: MonkeyPatch, name: str, fast_dev_run: bool
) -> None:
if name == "skippd":
pytest.importorskip("h5py", minversion="3")
config = os.path.join("tests", "conf", name + ".yaml")
monkeypatch.setattr(timm, "create_model", self.create_model)

Просмотреть файл

@ -126,20 +126,16 @@ class TestSimCLRTask:
@pytest.mark.slow
def test_weight_enum_download(self, weights: WeightsEnum) -> None:
match = "num classes .* != num classes in pretrained model"
with pytest.warns(UserWarning, match=match):
SimCLRTask(
model=weights.meta["model"],
weights=weights,
in_channels=weights.meta["in_chans"],
)
SimCLRTask(
model=weights.meta["model"],
weights=weights,
in_channels=weights.meta["in_chans"],
)
@pytest.mark.slow
def test_weight_str_download(self, weights: WeightsEnum) -> None:
match = "num classes .* != num classes in pretrained model"
with pytest.warns(UserWarning, match=match):
SimCLRTask(
model=weights.meta["model"],
weights=str(weights),
in_channels=weights.meta["in_chans"],
)
SimCLRTask(
model=weights.meta["model"],
weights=str(weights),
in_channels=weights.meta["in_chans"],
)

Просмотреть файл

@ -11,4 +11,4 @@ common image transformations for geospatial data.
"""
__author__ = "Adam J. Stewart"
__version__ = "0.5.0.dev0"
__version__ = "0.5.0"

Просмотреть файл

@ -93,7 +93,7 @@ class ChesapeakeCVPRDataModule(GeoDataModule):
"""
# This is a rough estimate of how large of a patch we will need to sample in
# EPSG:3857 in order to guarantee a large enough patch in the local CRS.
self.original_patch_size = patch_size * 2
self.original_patch_size = patch_size * 3
kwargs["transforms"] = _Transform(K.CenterCrop(patch_size))
super().__init__(