зеркало из https://github.com/microsoft/torchgeo.git
Style and test fixes
This commit is contained in:
Родитель
334c34a149
Коммит
3d40ecb72b
|
@ -164,7 +164,7 @@ def main(args: argparse.Namespace) -> None:
|
|||
dataloader = DataLoader(
|
||||
dataset,
|
||||
batch_size=args.batch_size,
|
||||
sampler=sampler, # type: ignore[arg-type]
|
||||
sampler=sampler,
|
||||
num_workers=args.num_workers,
|
||||
)
|
||||
|
||||
|
|
|
@ -72,6 +72,15 @@ class TestSo2Sat:
|
|||
with pytest.raises(RuntimeError, match="Dataset not found or corrupted."):
|
||||
So2Sat(str(tmp_path))
|
||||
|
||||
def test_mock_missing_module(
|
||||
self, dataset: So2Sat, mock_missing_module: None
|
||||
) -> None:
|
||||
with pytest.raises(
|
||||
ImportError,
|
||||
match="h5py is not installed and is required to use this dataset",
|
||||
):
|
||||
So2Sat(dataset.root)
|
||||
|
||||
|
||||
class TestSo2SatDataModule:
|
||||
@pytest.fixture(scope="class", params=zip([True, False], ["rgb", "s2"]))
|
||||
|
|
|
@ -14,6 +14,8 @@ from torchgeo.trainers.so2sat import So2SatClassificationTask
|
|||
|
||||
from .test_utils import mocked_log
|
||||
|
||||
pytest.importorskip("h5py")
|
||||
|
||||
|
||||
class TestSo2SatClassificationTask:
|
||||
@pytest.fixture(scope="class", params=[("rgb", 3), ("s2", 10)])
|
||||
|
|
|
@ -12,7 +12,7 @@ common image transformations for geospatial data.
|
|||
|
||||
# Fix circular import issue, see:
|
||||
# https://github.com/microsoft/torchgeo/issues/276
|
||||
import torchgeo.datasets
|
||||
import torchgeo.datasets # noqa: F401
|
||||
|
||||
__author__ = "Adam J. Stewart"
|
||||
__version__ = "0.1.1"
|
||||
|
|
Загрузка…
Ссылка в новой задаче