diff --git a/src/anemoi/datasets/create/config.py b/src/anemoi/datasets/create/config.py index b761d24..79686f3 100644 --- a/src/anemoi/datasets/create/config.py +++ b/src/anemoi/datasets/create/config.py @@ -215,15 +215,14 @@ def _prepare_serialisation(o): def set_to_test_mode(cfg): NUMBER_OF_DATES = 4 - dates = cfg["dates"] LOG.warning(f"Running in test mode. Changing the list of dates to use only {NUMBER_OF_DATES}.") groups = Groups(**LoadersConfig(cfg).dates) - dates = groups.dates + dates = groups.provider.values cfg["dates"] = dict( start=dates[0], end=dates[NUMBER_OF_DATES - 1], - frequency=dates.frequency, + frequency=groups.provider.frequency, group_by=NUMBER_OF_DATES, ) diff --git a/tests/create/test_create.py b/tests/create/test_create.py index 6e3f381..14e0ffc 100755 --- a/tests/create/test_create.py +++ b/tests/create/test_create.py @@ -253,12 +253,13 @@ def compare(self): @pytest.mark.parametrize("name", NAMES) @pytest.mark.skipif(not extensive_tests, reason="Skipping to run the test faster") +@pytest.mark.parametrize("is_test", [False, True]) @mockup_from_source -def test_run(name): +def test_run(name, is_test=False): config = os.path.join(HERE, name + ".yaml") output = os.path.join(HERE, name + ".zarr") - creator_factory("init", config=config, path=output, overwrite=True).run() + creator_factory("init", config=config, path=output, overwrite=True, test=is_test).run() creator_factory("load", path=output).run() creator_factory("finalise", path=output).run() creator_factory("patch", path=output).run()