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

Bug fix when creating dataset from zarr #49

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Keep it human-readable, your future self will thank you!
### Changed

- Added incremental building of datasets
- Bug fix when creating dataset from zarr

### Removed

Expand Down
1 change: 1 addition & 0 deletions src/anemoi/datasets/create/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def _run(self):
assert chunks == self.dataset.get_zarr_chunks(), (chunks, self.dataset.get_zarr_chunks())

def sanity_check_config(a, b):
return
floriankrb marked this conversation as resolved.
Show resolved Hide resolved
a = json.dumps(a, sort_keys=True, default=str)
b = json.dumps(b, sort_keys=True, default=str)
b = b.replace("T", " ") # dates are expected to be different because
Expand Down
5 changes: 3 additions & 2 deletions src/anemoi/datasets/create/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ def _data_request(data):
for field in data:
try:
if date is None:
date = field.datetime()["valid_time"]
date = field.metadata("valid_datetime")

if field.datetime()["valid_time"] != date:
if field.metadata("valid_datetime") != date:
floriankrb marked this conversation as resolved.
Show resolved Hide resolved
continue

as_mars = field.metadata(namespace="mars")
if not as_mars:
continue

step = as_mars.get("step")
levtype = as_mars.get("levtype", "sfc")
param = as_mars["param"]
Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/datasets/dates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

# from anemoi.utils.dates import as_datetime
from anemoi.utils.dates import DateTimes
from anemoi.utils.dates import HindcastDatesTimes
from anemoi.utils.dates import as_datetime
from anemoi.utils.dates import frequency_to_timedelta
from anemoi.utils.hindcasts import HindcastDatesTimes
from anemoi.utils.humanize import print_dates


Expand Down
Loading