abc

climatebenchpress.data_loader.datasets.abc

Classes:

  • Dataset

    Abstract base class for datasets.

Dataset

Bases: ABC

Abstract base class for datasets.

Each dataset has a unique name associated with it that will be used to name the directory where the dataset is stored.

The dataset should implement the download and open methods to handle downloading the dataset (in whatever data format the original data comes) and opening it as an xarray Dataset, respectively.

Methods:

  • download

    Download the dataset to the specified path. The download function is responsible

  • open

    Open the dataset from the specified path as an xarray Dataset.

name instance-attribute

name: str

download abstractmethod staticmethod

download(download_path: Path, progress: bool = True)

Download the dataset to the specified path. The download function is responsible for checking whether the download is complete or not. If the previous download was interrupted, it will resume the download. If the download is complete, it will skip the download.

Parameters:
  • download_path (Path) –

    The path where the dataset should be downloaded to

  • progress (bool, default: True ) –

    Whether to show a progress bar during the download, by default True

open abstractmethod staticmethod

open(download_path: Path) -> xr.Dataset

Open the dataset from the specified path as an xarray Dataset.

Parameters:
  • download_path (Path) –

    The path where the dataset is stored

Returns:
  • xr.Dataset

    The dataset as an xarray Dataset