Skip to content

abstract

Standard interface for springtime datasets.

All springtime datasets should inherit from the abstract Dataset class and implement the basic functionality described here.

Dataset

Bases: BaseModel, ABC

Base class for springtime datasets.

Attributes:

Name Type Description
dataset str

The name of the dataset.

years YearRange | None

timerange. For example years=[2000, 2002] downloads data for three years.

download() abstractmethod

Download the data.

Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.

raw_load()

Loads from disk with minimal modification.

Mostly intended to provide insight into the modifications made in the load method.

load() abstractmethod

Load, harmonize, and optionally pre-process the data.

Default output of load should be compatible with recipe execution.

kwargs can be used to control behaviour that is useful in API, but breaks the recipe. For example, don't convert to geopandas.

to_recipe()

Print out a recipe to reproduce this dataset.