grib templates
templates.builtin
- class anemoi.inference.grib.templates.builtin.BuiltinTemplates(manager: TemplateManager, index_path: str | None = None)
Bases:
IndexTemplateProviderBuiltin templates provider.
Initialize the index template provider.
- Parameters:
manager (TemplateManager) – The manager for the template provider.
index (str | list) – The path to the index.yaml file, or its contents directly as a list.
templates.file
templates.input
- class anemoi.inference.grib.templates.input.InputTemplates(manager: TemplateManager, **fallback: dict[str, str])
Bases:
TemplateProviderUse input fields as the output GRIB template.
Initialize the template provider.
- Parameters:
manager (TemplateManager) – The manager for the template provider.
**fallback (dict[str, str]) – A mapping of output to input variable names to use as templates from the input, used as fallback when the output variable is not present in the input state (e.g., for diagnostic variables).
templates.manager
- class anemoi.inference.grib.templates.manager.TemplateManager(owner: Output, templates: list[str] | str | None = None)
Bases:
objectA class to manage GRIB template providers.
Initialize the TemplateManager.
- Parameters:
- log_summary() None
Log a summary of the loaded templates. Repeated calls will only log newly loaded templates since the last call.
- template(name: str, state: dict[str, Any], typed_variables: dict[str, Any]) Field | None
Get the template for a given name and state.
templates.samples
- class anemoi.inference.grib.templates.samples.SamplesTemplates(manager: TemplateManager, *args, index_path: str | None = None)
Bases:
IndexTemplateProviderClass to provide GRIB templates from sample files.
Initialize the index template provider.
- Parameters:
manager (TemplateManager) – The manager for the template provider.
index (str | list) – The path to the index.yaml file, or its contents directly as a list.