Types¶
ArrayCHW = Float[NDArray[float32], 'channels height width']
module-attribute
¶
ArrayHW = Float[NDArray[float32], 'height width']
module-attribute
¶
ArrayHWV = Float[NDArray[float32], 'height width variable']
module-attribute
¶
ArrayIndices2D = Int[NDArray[int64], 'height width']
module-attribute
¶
ArrayTCHW = Float[NDArray[float32], 'time channels height width']
module-attribute
¶
ArrayTHW = Float[NDArray[float32], 'time height width']
module-attribute
¶
TensorNCHW = Float[Tensor, 'batch channels height width']
module-attribute
¶
TensorNTCHW = Float[Tensor, 'batch time channels height width']
module-attribute
¶
CF_VARIABLE_ATTRIBUTES = {'ice_conc': {'long_name': 'sea ice concentration', 'standard_name': 'sea_ice_area_fraction', 'units': '1', 'valid_min': 0.0, 'valid_max': 1.0}}
module-attribute
¶
NDIM_HW = 2
module-attribute
¶
NDIM_NHW = 3
module-attribute
¶
NDIM_NTCHW = 5
module-attribute
¶
NDIM_THW = 3
module-attribute
¶
SEA_ICE_THRESHOLD = 0.15
module-attribute
¶
ColourScale
dataclass
¶
Specify how to colour a rendered panel, for a variable or a difference.
Attributes:
| Name | Type | Description |
|---|---|---|
cmap |
str
|
Matplotlib colourmap name (e.g., "viridis", "RdBu_r"). |
vmin |
float | None
|
Lower bound for the colour scale. |
vmax |
float | None
|
Upper bound for the colour scale. |
units |
str | None
|
Display units for the variable (e.g., "K", "m/s"). |
DataSpace
¶
Immutable description of a CHW data space, compared and hashed by value.
area
property
¶
Return the area of the data space.
channels
property
¶
Return the number of channels.
chw
property
¶
Return a tuple of [channels, height, width].
name
property
¶
Return the name.
shape
property
¶
Return the (height, width) shape.
from_dict(config)
classmethod
¶
to_dict()
¶
Return the DataSpace as a DictConfig.
Metadata
dataclass
¶
Structured metadata extracted from training configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
model |
str | None
|
Model name (if available). |
n_history_steps |
int | None
|
Number of history steps used as model input window (days). |
n_samples |
int | None
|
Number of training points per epoch (if available). |
trained_epochs |
int | None
|
Number of epochs the model has been trained for. |
training_start |
str | None
|
Training start date string (if available). |
training_end |
str | None
|
Training end date string (if available). |
vars_by_source |
dict[str, list[str]] | None
|
Dictionary mapping dataset source names to lists of variable names. |
model = None
class-attribute
instance-attribute
¶
n_history_steps = None
class-attribute
instance-attribute
¶
n_samples = None
class-attribute
instance-attribute
¶
trained_epochs = None
class-attribute
instance-attribute
¶
training_end = None
class-attribute
instance-attribute
¶
training_start = None
class-attribute
instance-attribute
¶
vars_by_source = None
class-attribute
instance-attribute
¶
from_dataset(dataset, *, model_name=None, trained_epochs=None)
classmethod
¶
Build structured metadata from a dataset-like source.
ModelStepOutput
dataclass
¶
PlotSpec
dataclass
¶
Configure how sea-ice plots are rendered.
Attributes:
| Name | Type | Description |
|---|---|---|
title_groundtruth |
str
|
Title above the ground-truth panel. |
title_prediction |
str
|
Title above the prediction panel. |
title_difference |
str
|
Title above the difference panel. |
colourmap |
str
|
colourmap used for GT/prediction panels. |
dpi |
int
|
Dots per inch for figure rendering (default 300). |
include_difference |
bool
|
Whether to draw a difference panel. |
diff_mode |
DiffMode
|
Difference definition (e.g. "signed", "absolute", "smape"). |
selected_timestep |
int
|
Slice index when a single timestep is needed. |
vmin |
float | None
|
Lower bound for GT/prediction colour scale (None = infer). |
vmax |
float | None
|
Upper bound for GT/prediction colour scale (None = infer). |
include_ice_edge |
bool
|
Whether to overlay the sea ice edge contour in red. |
ice_edge_threshold |
float
|
Concentration value defining the sea ice edge contour. |
uncertainty_variables |
dict[str, str]
|
Maps each target variable to the variable in the same dataset group holding its reported standard uncertainty (used for the z-score panel). This does not need to be selected as an input variable. |
title_groundtruth = 'Ground Truth'
class-attribute
instance-attribute
¶
title_prediction = 'Prediction'
class-attribute
instance-attribute
¶
title_difference = 'Difference'
class-attribute
instance-attribute
¶
colourmap = 'viridis'
class-attribute
instance-attribute
¶
dpi = 300
class-attribute
instance-attribute
¶
include_difference = True
class-attribute
instance-attribute
¶
diff_mode = DiffMode.SIGNED
class-attribute
instance-attribute
¶
selected_timestep = 0
class-attribute
instance-attribute
¶
vmin = 0.0
class-attribute
instance-attribute
¶
vmax = 1.0
class-attribute
instance-attribute
¶
include_ice_edge = True
class-attribute
instance-attribute
¶
ice_edge_threshold = SEA_ICE_THRESHOLD
class-attribute
instance-attribute
¶
hemisphere = None
class-attribute
instance-attribute
¶
video_fps = 2
class-attribute
instance-attribute
¶
video_format = 'mp4'
class-attribute
instance-attribute
¶
per_variable_styles = field(default_factory=lambda: {'sic-osisaf:ice_conc': {'cmap': 'Blues_r'}, 'sic-ssmis:ice_conc': {'cmap': 'Blues_r'}})
class-attribute
instance-attribute
¶
uncertainty_variables = field(default_factory=lambda: {'ice_conc': 'total_standard_uncertainty'})
class-attribute
instance-attribute
¶
RolloutStrategy
dataclass
¶
Describe how EncodeProcessDecode advances its forecast loop.
Attributes:
| Name | Type | Description |
|---|---|---|
space |
RolloutSpace
|
Where the forecast loop runs: in latent space, or in physical space where each step is decoded and re-encoded. |
anchor |
SkipAnchorType
|
The frame that a finaliser skip connection adds to each forecast step: the last observed frame (INITIAL) or the previous forecast step (PREVIOUS). A physical rollout needs a PREVIOUS anchor. |
relaxation_tau |
float | None
|
The folding time, in forecast steps, of the relaxation of each forecast step towards climatology, or None for no relaxation. Relaxation needs a PREVIOUS anchor, so that it carries over between steps. |
space
instance-attribute
¶
anchor
instance-attribute
¶
relaxation_tau = None
class-attribute
instance-attribute
¶
is_physical
property
¶
Return True if the forecast loop runs in physical space.
from_options(space=RolloutSpace.LATENT, anchor=None, relaxation_tau=None)
classmethod
¶
Create a RolloutStrategy from enums or strings.
If the anchor is unset, use the default anchor for the space. A latent rollout anchors every step on the last observed frame. A physical rollout anchors each step on the previous forecast step.
Timespan
¶
A span of time.
MIN_DATES_FOR_FREQUENCY = 2
class-attribute
instance-attribute
¶
end
cached
property
¶
Return the end date of the timespan.
frequency
cached
property
¶
Return the spacing between consecutive steps, or None if unknown.
Assumes uniform spacing derived from the first and last dates.
start
cached
property
¶
Return the start date of the timespan.
steps
cached
property
¶
Return the number of steps (dates) in the timespan.
BetaSchedule
¶
DiffMode
¶
Bases: StrEnum
Enum for difference-panel computation modes.
- SIGNED: target - prediction (can be ±, so symmetric colour scale around 0)
- ABSOLUTE: |target - prediction| (>= 0, sequential scale)
- SMAPE: |pred - target| / ((|pred|+|target|)/2) (>= 0, sequential scale)
Hemisphere
¶
MaskType
¶
RangeRestriction
¶
RolloutSpace
¶
SkipAnchorType
¶
Bases: StrEnum
Enum for the anchor that a finaliser skip connection adds to each forecast step.
- INITIAL: every step uses the last observed frame as its anchor
- PREVIOUS: each step uses the output of the previous step as its anchor
SkipConnectionType
¶
SupportsMetadataFromDataset
¶
SupportsPerLeadTimeLoss
¶
AnemoiCleanupArgs
dataclass
¶
AnemoiDatasetStatus
¶
Bases: NamedTuple
Status of an Anemoi dataset.
AnemoiFinaliseArgs
dataclass
¶
AnemoiInitArgs
dataclass
¶
AnemoiInspectArgs
dataclass
¶
AnemoiLoadArgs
dataclass
¶
ProcessorOutput
dataclass
¶
Output of a processor rollout.
Attributes:
| Name | Type | Description |
|---|---|---|
prediction |
TensorNTCHW
|
Latent prediction of shape (N, T, C, H, W). At inference, T is n_forecast_steps. During training, a processor that computes its loss in latent space can return a prediction with gradients back to the network, and T can be 1. For example, an autoregressive diffusion processor predicts only the first forecast step. |
loss |
Tensor | None
|
Latent loss for the backward pass. A processor must set it during training
if |
sample_mask |
Tensor | None
|
Optional boolean mask of shape (N,). True for the samples to use in the prediction loss. None means that all samples are used. |