ValidDataset#
- class ethology.validators.utils.ValidDataset(dataset)[source]#
Bases:
ABCAn abstract base class for valid
ethologydatasets.This class validates that the input dataset:
is an xarray Dataset
contains all required dimensions
contains all required data variables
has the correct dimensions for each data variable
Subclasses must define
required_dimsandrequired_data_varsattributes.- dataset#
The xarray dataset to validate.
- Type:
- required_dims#
A set of required dimension names. This attribute should be defined by any subclass inheriting from this class.
- required_data_vars#
A dictionary mapping data variable names to their required dimensions. This attribute should be defined by any subclass inheriting from this class.
- Raises:
TypeError – If the input is not an xarray Dataset.
ValueError – If the dataset is missing required data variables or dimensions, or if any required dimensions are missing for any data variable.
Notes
The dataset can have other data variables and dimensions, but only the required ones are checked.