Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leifdenby committed Sep 27, 2024
1 parent 39bda14 commit 9460967
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ds = mdp.create_dataset(config=config)
A full example configuration file is given in [example.danra.yaml](example.danra.yaml), and reproduced here for completeness:

```yaml
schema_version: v0.2.0
schema_version: v0.2.0+dev
dataset_version: v0.1.0

output:
Expand Down
2 changes: 1 addition & 1 deletion example.danra.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema_version: v0.2.0
schema_version: v0.2.0+dev
dataset_version: v0.1.0

output:
Expand Down
2 changes: 1 addition & 1 deletion mllam_data_prep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ class Config(dataclass_wizard.YAMLWizard):

output: Output
inputs: Dict[str, InputDataset]
extra: Dict[str, Any] = None
schema_version: str
dataset_version: str
extra: Dict[str, Any] = None


if __name__ == "__main__":
Expand Down
5 changes: 3 additions & 2 deletions mllam_data_prep/create_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,10 @@ def create_dataset_zarr(fp_config, fp_zarr: str = None):
"""
config = Config.from_yaml_file(file=fp_config)

expected_schema_version = "v0.2.0+dev"
assert (
config.schema_version == "v0.2.0"
), f"Expected schema version v0.2.0, got {config.schema_version}"
config.schema_version == expected_schema_version
), f"Expected schema version {expected_schema_version}, got {config.schema_version}"

ds = create_dataset(config=config)

Expand Down
2 changes: 2 additions & 0 deletions tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pandas as pd
import xarray as xr

SCHEMA_VERSION = "v0.2.0+dev"

NX, NY = 10, 8
NT_ANALYSIS, NT_FORECAST = 5, 12
NZ = 3
Expand Down
6 changes: 3 additions & 3 deletions tests/test_from_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_merging_static_and_surface_analysis():
t_test_end = testdata.T_END_ANALYSIS

config = dict(
schema_version="v0.2.0",
schema_version=testdata.SCHEMA_VERSION,
dataset_version="v0.1.0",
output=dict(
variables=dict(
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_time_selection(source_data_contains_time_range, time_stepsize):
t_end_config = t_end_dataset + testdata.DT_ANALYSIS

config = dict(
schema_version="v0.2.0",
schema_version=testdata.SCHEMA_VERSION,
dataset_version="v0.1.0",
output=dict(
variables=dict(
Expand Down Expand Up @@ -215,7 +215,7 @@ def test_feature_collision(use_common_feature_var_name):
state_feature_var_name = "state_feature"

config = dict(
schema_version="v0.2.0",
schema_version=testdata.SCHEMA_VERSION,
dataset_version="v0.1.0",
output=dict(
variables=dict(
Expand Down

0 comments on commit 9460967

Please sign in to comment.