Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: data indices import. typo documentation #34

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading