diff --git a/CHANGELOG.md b/CHANGELOG.md index 9da050f..48c52c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,7 @@ Keep it human-readable, your future self will thank you! ### Added - CI workflow to update the changelog on release - -- Remapper: Preprocessor for remapping one variable to multiple ones. Includes changes to the data indices since the remapper changes the number of variables. + - Remapper: Preprocessor for remapping one variable to multiple ones. Includes changes to the data indices since the remapper changes the number of variables. ### Changed diff --git a/docs/modules/data_indices.rst b/docs/modules/data_indices.rst index d28fa04..c546795 100644 --- a/docs/modules/data_indices.rst +++ b/docs/modules/data_indices.rst @@ -53,7 +53,7 @@ remapper-preprocessor. data: remapped: - - d: + d: - "d_1" - "d_2" diff --git a/src/anemoi/models/preprocessing/__init__.py b/src/anemoi/models/preprocessing/__init__.py index 1368046..53017fb 100644 --- a/src/anemoi/models/preprocessing/__init__.py +++ b/src/anemoi/models/preprocessing/__init__.py @@ -8,15 +8,13 @@ # import logging -from typing import TYPE_CHECKING from typing import Optional import torch from torch import Tensor from torch import nn -if TYPE_CHECKING: - from anemoi.models.data_indices.collection import IndexCollection +from anemoi.models.data_indices.collection import IndexCollection LOGGER = logging.getLogger(__name__) diff --git a/tests/data_indices/test_collection.py b/tests/data_indices/test_collection.py index 78b3ecd..8505f8a 100644 --- a/tests/data_indices/test_collection.py +++ b/tests/data_indices/test_collection.py @@ -19,12 +19,10 @@ def data_indices(): "data": { "forcing": ["x", "e"], "diagnostic": ["z", "q"], - "remapped": [ - { - "e": ["e_1", "e_2"], - "d": ["d_1", "d_2"], - } - ], + "remapped": { + "e": ["e_1", "e_2"], + "d": ["d_1", "d_2"], + }, }, }, ) diff --git a/tests/preprocessing/test_preprocessor_imputer.py b/tests/preprocessing/test_preprocessor_imputer.py index e161c12..5218efc 100644 --- a/tests/preprocessing/test_preprocessor_imputer.py +++ b/tests/preprocessing/test_preprocessor_imputer.py @@ -26,7 +26,7 @@ def non_default_input_imputer(): "imputer": {"default": "none", "mean": ["y"], "maximum": ["x"], "none": ["z"], "minimum": ["q"]}, "forcing": ["z", "q"], "diagnostic": ["other"], - "remapped": [], + "remapped": {}, }, }, ) diff --git a/tests/preprocessing/test_preprocessor_normalizer.py b/tests/preprocessing/test_preprocessor_normalizer.py index 9432b83..cc527e7 100644 --- a/tests/preprocessing/test_preprocessor_normalizer.py +++ b/tests/preprocessing/test_preprocessor_normalizer.py @@ -25,7 +25,7 @@ def input_normalizer(): "normalizer": {"default": "mean-std", "min-max": ["x"], "max": ["y"], "none": ["z"], "mean-std": ["q"]}, "forcing": ["z", "q"], "diagnostic": ["other"], - "remapped": [], + "remapped": {}, }, }, ) diff --git a/tests/preprocessing/test_preprocessor_remapper.py b/tests/preprocessing/test_preprocessor_remapper.py index d5bd52a..86bdfde 100644 --- a/tests/preprocessing/test_preprocessor_remapper.py +++ b/tests/preprocessing/test_preprocessor_remapper.py @@ -28,11 +28,9 @@ def input_remapper(): }, "forcing": ["z", "q"], "diagnostic": ["other"], - "remapped": [ - { - "d": ["cos_d", "sin_d"], - } - ], + "remapped": { + "d": ["cos_d", "sin_d"], + }, }, }, )