Skip to content

Commit 6d45f38

Browse files
committed
fix tests
1 parent 5043391 commit 6d45f38

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,5 @@ _build/
188188
*.sync
189189
*.dot
190190
_dev/
191+
*.to_upload
192+
*.tmp

src/anemoi/datasets/create/loaders.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,8 @@ def __init__(self, path, delta=None, **kwargs):
906906
)
907907
self.delta = delta
908908
idelta = delta.total_seconds() // frequency.total_seconds()
909+
assert int(idelta) == idelta, idelta
910+
idelta = int(idelta)
909911

910912
super().__init__(path=path, **kwargs)
911913

@@ -929,10 +931,7 @@ def final_storage_name(self, k):
929931

930932
@classmethod
931933
def final_storage_name_from_delta(_, k, delta):
932-
if isinstance(delta, int):
933-
delta = str(delta)
934-
if not delta.endswith("h"):
935-
delta = delta + "h"
934+
delta = frequency_to_string(delta)
936935
return f"statistics_tendencies_{delta}_{k}"
937936

938937
def run(self, parts):

tests/create/test_create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from anemoi.datasets.create import Creator
2323
from anemoi.datasets.data.stores import open_zarr
2424

25-
TEST_DATA_ROOT = "https://object-store.os-api.cci1.ecmwf.int/ml-tests/test-data/anemoi-datasets/pytest/create"
25+
TEST_DATA_ROOT = "https://object-store.os-api.cci1.ecmwf.int/ml-tests/test-data/anemoi-datasets/create"
2626

2727

2828
HERE = os.path.dirname(__file__)
@@ -58,7 +58,7 @@ def get_data(self, args, kwargs, path):
5858
print()
5959
print("⚠️ To upload the test data, run this:")
6060
print()
61-
print(f"{exe} {upload_path} anemoi-datasets/pytest/create/{os.path.basename(path)}")
61+
print(f"{exe} {upload_path} anemoi-datasets/create/{os.path.basename(path)} --overwrite")
6262
print()
6363
exit(1)
6464
raise ValueError("Test data is missing")

0 commit comments

Comments
 (0)