climate_ref_core.datasets
#
Dataset management and filtering
Selector = tuple[tuple[str, str], ...]
module-attribute
#
Type describing the key used to identify a group of datasets
This is a tuple of tuples, where each inner tuple contains a metadata and dimension value that was used to group the datasets together.
This type must be hashable, as it is used as a key in a dictionary.
DatasetCollection
#
Group of datasets required for a given diagnostic execution for a specific source dataset type.
Source code in packages/climate-ref-core/src/climate_ref_core/datasets.py
datasets
instance-attribute
#
DataFrame containing the datasets that were selected for the execution.
The columns in this dataframe depend on the source dataset type, but always include: * path * [slug_column]
selector = field(converter=sort_selector, factory=tuple)
class-attribute
instance-attribute
#
Unique key, value pairs that were selected during the initial groupby
slug_column
instance-attribute
#
Column in datasets that contains the unique identifier for the dataset
ExecutionDatasetCollection
#
The complete set of datasets required for an execution of a diagnostic.
This may cover multiple source dataset types.
Source code in packages/climate-ref-core/src/climate_ref_core/datasets.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
hash
property
#
Unique identifier for the collection
A SHA1 hash is calculated of the combination of the hashes of the individual collections. The value isn't reversible but can be used to uniquely identify the aggregate of the collections.
Returns:
| Type | Description |
|---|---|
str
|
SHA1 hash of the collections |
selectors
property
#
Collection of selectors used to identify the datasets
These are the key, value pairs that were selected during the initial group-by, for each data requirement.
items()
#
keys()
#
FacetFilter
#
A filter to apply to a data catalog of datasets.
Source code in packages/climate-ref-core/src/climate_ref_core/datasets.py
facets = field(converter=_clean_facets)
class-attribute
instance-attribute
#
Filters to apply to the data catalog.
The keys are the metadata fields to filter on, and the values are the values to filter on. The result will only contain datasets where for all fields, the value of the field is one of the given values.
SourceDatasetType
#
Bases: Enum
Types of supported source datasets