Skip to content

Commit

Permalink
fix: data indices import. typo documentation (#34)
Browse files Browse the repository at this point in the history
* fix: data indices import. typo documentation

* fix: data indices import. typo documentation

* typo

* tests: remapped variables need to be given as dictionary not list
  • Loading branch information
sahahner authored Sep 10, 2024
1 parent 80787ce commit 79fd11a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/data_indices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ remapper-preprocessor.
data:
remapped:
- d:
d:
- "d_1"
- "d_2"
Expand Down
4 changes: 1 addition & 3 deletions src/anemoi/models/preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
10 changes: 4 additions & 6 deletions tests/data_indices/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion tests/preprocessing/test_preprocessor_imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion tests/preprocessing/test_preprocessor_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
},
},
)
Expand Down
8 changes: 3 additions & 5 deletions tests/preprocessing/test_preprocessor_remapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ def input_remapper():
},
"forcing": ["z", "q"],
"diagnostic": ["other"],
"remapped": [
{
"d": ["cos_d", "sin_d"],
}
],
"remapped": {
"d": ["cos_d", "sin_d"],
},
},
},
)
Expand Down

0 comments on commit 79fd11a

Please sign in to comment.