checkpoint
- anemoi.inference.checkpoint.get_multi_dataset_metadata(metadata: dict, supporting_arrays: dict, base_class=<class 'anemoi.inference.metadata.Metadata'>) dict[str, SingleDatasetMetadata | MultiDatasetMetadata]
Metadata objects for all datasets in the raw metadata, as a mapping from dataset name to Metadata object. For legacy checkpoints, the dataset name defaults to data
- class anemoi.inference.checkpoint.Checkpoint(source: str | ~anemoi.inference.metadata.Metadata | dict[~typing.Literal['huggingface'], str | dict], *, metadata_base: type[~anemoi.inference.metadata.Metadata] = <class 'anemoi.inference.metadata.Metadata'>, patch_metadata: dict[str, ~typing.Any] | None = None)
Bases:
objectRepresents an inference checkpoint.
- property multi_dataset_metadata: dict[str, SingleDatasetMetadata | MultiDatasetMetadata]
Metadata for all datasets in the checkpoint, as a mapping from dataset name to Metadata object. For legacy checkpoints, the dataset name defaults to data
- property sources: list[SourceCheckpoint]
Get the sources.
- validate_environment(*, all_packages: bool = False, on_difference: Literal['warn', 'error', 'ignore', 'return'] = 'warn', exempt_packages: list[str] | None = None) bool | str
Validate the environment.
- Parameters:
all_packages (bool, optional) – Check all packages in the environment (True) or just anemoi’s (False), by default False.
on_difference (Literal['warn', 'error', 'ignore', 'return'], optional) – What to do on difference, by default “warn”
exempt_packages (list[str], optional) – List of packages to exempt from the check, by default EXEMPT_PACKAGES
- Returns:
boolean if on_difference is not ‘return’, otherwise formatted text of the differences True if environment is valid, False otherwise
- Return type:
- provenance_training() Any
Get the provenance of the training.
- Returns:
The provenance of the training.
- Return type:
Any
- update_metadata_from_zarr() tuple[dict[str, Any], dict[str, Any]]
Get new metadata and supporting array dictionaries from the original training dataset. Useful if the training dataset metadata has been patched/updated. Updates the internal _raw_metadata and returns a new (metadata, supporting_arrays).
- class anemoi.inference.checkpoint.SourceCheckpoint(owner: Checkpoint, metadata: Any)
Bases:
CheckpointA checkpoint that represents a source.