Skip to content

Commit

Permalink
Remove sentinel2 __init__ & fix landsat test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Aug 13, 2022
1 parent 71f028a commit ddf0bec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
3 changes: 2 additions & 1 deletion torchgeo/datasets/landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def __init__(
Raises:
FileNotFoundError: if no files are found in ``root``
"""
self.filename_glob = self.filename_glob.format(bands[0])
if bands:
self.filename_glob = self.filename_glob.format(bands[0])

super().__init__(root, crs, res, bands, transforms, cache)

Expand Down
30 changes: 1 addition & 29 deletions torchgeo/datasets/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

"""Sentinel datasets."""

from typing import Any, Callable, Dict, Optional, Sequence
from typing import Any, Dict, Optional

import matplotlib.pyplot as plt
import torch
from rasterio.crs import CRS

from .geo import RasterDataset

Expand Down Expand Up @@ -72,33 +71,6 @@ class Sentinel2(Sentinel):

separate_files = True

def __init__(
self,
root: str = "data",
crs: Optional[CRS] = None,
res: Optional[float] = None,
bands: Optional[Sequence[str]] = None,
transforms: Optional[Callable[[Dict[str, Any]], Dict[str, Any]]] = None,
cache: bool = True,
) -> None:
"""Initialize a new Dataset instance.
Args:
root: root directory where dataset can be found
crs: :term:`coordinate reference system (CRS)` to warp to
(defaults to the CRS of the first file found)
res: resolution of the dataset in units of CRS
(defaults to the resolution of the first file found)
bands: bands to return (defaults to all bands)
transforms: a function/transform that takes an input sample
and returns a transformed version
cache: if True, cache file handle to speed up repeated sampling
Raises:
FileNotFoundError: if no files are found in ``root``
"""
super().__init__(root, crs, res, bands, transforms, cache)

def plot(
self,
sample: Dict[str, Any],
Expand Down

0 comments on commit ddf0bec

Please sign in to comment.