Skip to content

Commit

Permalink
Update type of paths in childred of Raster
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantre committed Sep 28, 2023
1 parent b7cc5f4 commit 5f532a0
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 16 deletions.
3 changes: 2 additions & 1 deletion torchgeo/datasets/agb_live_woody_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import os
from collections.abc import Iterable
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -58,7 +59,7 @@ class AbovegroundLiveWoodyBiomassDensity(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
transforms: Optional[Callable[[dict[str, Any]], dict[str, Any]]] = None,
Expand Down
3 changes: 2 additions & 1 deletion torchgeo/datasets/cdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""CDL dataset."""

import os
from collections.abc import Iterable
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -204,7 +205,7 @@ class CDL(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
years: list[int] = [2022],
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/chesapeake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import abc
import os
import sys
from collections.abc import Sequence
from collections.abc import Iterable, Sequence
from typing import Any, Callable, Optional, Union, cast

import fiona
Expand Down Expand Up @@ -89,7 +89,7 @@ def url(self) -> str:

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
transforms: Optional[Callable[[dict[str, Any]], dict[str, Any]]] = None,
Expand Down
3 changes: 2 additions & 1 deletion torchgeo/datasets/esri2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"""Esri 2020 Land Cover Dataset."""

from collections.abc import Iterable
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -65,7 +66,7 @@ class Esri2020(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
transforms: Optional[Callable[[dict[str, Any]], dict[str, Any]]] = None,
Expand Down
3 changes: 2 additions & 1 deletion torchgeo/datasets/eudem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""European Digital Elevation Model (EU-DEM) dataset."""

import os
from collections.abc import Iterable
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -81,7 +82,7 @@ class EUDEM(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
transforms: Optional[Callable[[dict[str, Any]], dict[str, Any]]] = None,
Expand Down
3 changes: 2 additions & 1 deletion torchgeo/datasets/globbiomass.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""GlobBiomass dataset."""

import os
from collections.abc import Iterable
from typing import Any, Callable, Optional, Union, cast

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -117,7 +118,7 @@ class GlobBiomass(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
measurement: str = "agb",
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/l7irish.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""L7 Irish dataset."""

import os
from collections.abc import Sequence
from collections.abc import Iterable, Sequence
from typing import Any, Callable, Optional, Union, cast

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -90,7 +90,7 @@ class L7Irish(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = CRS.from_epsg(3857),
res: Optional[float] = None,
bands: Sequence[str] = all_bands,
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/l8biome.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""L8 Biome dataset."""

from collections.abc import Sequence
from collections.abc import Iterable, Sequence
from typing import Any, Callable, Optional, Union, cast

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -88,7 +88,7 @@ class L8Biome(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]],
crs: Optional[CRS] = CRS.from_epsg(3857),
res: Optional[float] = None,
bands: Sequence[str] = all_bands,
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""Landsat datasets."""

import abc
from collections.abc import Sequence
from collections.abc import Iterable, Sequence
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -58,7 +58,7 @@ def default_bands(self) -> list[str]:

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
bands: Optional[Sequence[str]] = None,
Expand Down
3 changes: 2 additions & 1 deletion torchgeo/datasets/nlcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""NLCD dataset."""

import os
from collections.abc import Iterable
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -105,7 +106,7 @@ class NLCD(RasterDataset):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
years: list[int] = [2019],
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/datasets/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"""Sentinel datasets."""

from collections.abc import Sequence
from collections.abc import Iterable, Sequence
from typing import Any, Callable, Optional, Union

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -296,7 +296,7 @@ class Sentinel2(Sentinel):

def __init__(
self,
paths: Union[str, list[str]] = "data",
paths: Union[str, Iterable[str]] = "data",
crs: Optional[CRS] = None,
res: float = 10,
bands: Optional[Sequence[str]] = None,
Expand Down

0 comments on commit 5f532a0

Please sign in to comment.