From f1367a28e5c5b2dd045e7132a2c070df34a66156 Mon Sep 17 00:00:00 2001 From: Gert Mertes Date: Mon, 13 Jan 2025 14:26:06 +0000 Subject: [PATCH] fix: typing --- src/anemoi/inference/checkpoint.py | 3 ++- src/anemoi/inference/metadata.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/anemoi/inference/checkpoint.py b/src/anemoi/inference/checkpoint.py index de09388..bfaaeb1 100644 --- a/src/anemoi/inference/checkpoint.py +++ b/src/anemoi/inference/checkpoint.py @@ -13,6 +13,7 @@ from collections import defaultdict from functools import cached_property from pathlib import Path +from typing import Optional from anemoi.utils.checkpoints import load_metadata from earthkit.data.utils.dates import to_datetime @@ -179,7 +180,7 @@ def validate_environment( *, all_packages: bool = False, on_difference: str = "warn", - exempt_packages: list[str] | None = None, + exempt_packages: Optional[list[str]] = None, ) -> bool: return self._metadata.validate_environment( all_packages=all_packages, on_difference=on_difference, exempt_packages=exempt_packages diff --git a/src/anemoi/inference/metadata.py b/src/anemoi/inference/metadata.py index c12b833..25f29f6 100644 --- a/src/anemoi/inference/metadata.py +++ b/src/anemoi/inference/metadata.py @@ -15,6 +15,7 @@ from functools import cached_property from types import MappingProxyType as frozendict from typing import Literal +from typing import Optional import numpy as np from anemoi.transform.variables import Variable @@ -461,7 +462,7 @@ def validate_environment( *, all_packages: bool = False, on_difference: Literal["warn", "error", "ignore"] = "warn", - exempt_packages: list[str] | None = None, + exempt_packages: Optional[list[str]] = None, ) -> bool: """ Validate environment of the checkpoint against the current environment.