Commit 8b5958f3 authored by BorjaEst's avatar BorjaEst
Browse files

Test correct merging of composed metadata

parent bfd21b18
...@@ -2,10 +2,14 @@ SourceSplit: ...@@ -2,10 +2,14 @@ SourceSplit:
metadata: metadata:
meta_0: Source metadata string example meta_0: Source metadata string example
meta_1: Source metadata to be replaced by model meta_1: Source metadata to be replaced by model
meta_2:
meta_20: Sub-metadata from Source
meta_21: Sub-metadata to be replaced by model
ModelTCO3: ModelTCO3:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
tco3_zm: tco3_zm:
name: tco3 name: tco3
paths: SourceSplit/tco3_????.nc paths: SourceSplit/tco3_????.nc
...@@ -19,7 +23,8 @@ SourceSplit: ...@@ -19,7 +23,8 @@ SourceSplit:
ModelVMRO3: ModelVMRO3:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
vmro3_zm: vmro3_zm:
name: vmro3 name: vmro3
paths: SourceSplit/vmro3_????.nc paths: SourceSplit/vmro3_????.nc
...@@ -34,18 +39,22 @@ SourceSplit: ...@@ -34,18 +39,22 @@ SourceSplit:
ModelALL: ModelALL:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
tco3_zm: tco3_zm:
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
name: tco3 name: tco3
paths: SourceSplit/tco3_????.nc paths: SourceSplit/tco3_????.nc
coordinates: coordinates:
time: time time: time
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
vmro3_zm: vmro3_zm:
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
name: vmro3 name: vmro3
paths: SourceSplit/vmro3_????.nc paths: SourceSplit/vmro3_????.nc
coordinates: coordinates:
...@@ -53,32 +62,37 @@ SourceSplit: ...@@ -53,32 +62,37 @@ SourceSplit:
plev: pressure_level plev: pressure_level
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
SourceMerged: SourceMerged:
metadata: metadata:
meta_0: Source metadata string example meta_0: Source metadata string example
meta_1: Source metadata to be replaced by model meta_1: Source metadata to be replaced by model
meta_2:
meta_20: Sub-metadata from Source
meta_21: Sub-metadata to be replaced by model
ModelTCO3: ModelTCO3:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
tco3_zm: tco3_zm:
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
name: tco3 name: tco3
paths: SourceMerged/merged_????.nc paths: SourceMerged/merged_????.nc
coordinates: coordinates:
time: time time: time
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
ModelVMRO3: ModelVMRO3:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
vmro3_zm: vmro3_zm:
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
name: vmro3 name: vmro3
paths: SourceMerged/merged_????.nc paths: SourceMerged/merged_????.nc
coordinates: coordinates:
...@@ -86,24 +100,25 @@ SourceMerged: ...@@ -86,24 +100,25 @@ SourceMerged:
plev: pressure_level plev: pressure_level
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
ModelALL: ModelALL:
metadata: metadata:
meta_1: Model metadata string example meta_1: Model metadata string example
meta_2: 0 meta_2:
meta_21: Sub-metadata from model
tco3_zm: tco3_zm:
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
name: tco3 name: tco3
paths: SourceMerged/merged_????.nc paths: SourceMerged/merged_????.nc
coordinates: coordinates:
time: time time: time
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_tco3_1: TCO3 metadata string example
meta_tco3_2: 0
vmro3_zm: vmro3_zm:
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
name: vmro3 name: vmro3
paths: SourceMerged/merged_????.nc paths: SourceMerged/merged_????.nc
coordinates: coordinates:
...@@ -111,6 +126,3 @@ SourceMerged: ...@@ -111,6 +126,3 @@ SourceMerged:
plev: pressure_level plev: pressure_level
lat: latitude lat: latitude
lon: longitude lon: longitude
metadata:
meta_vmro3_1: VMRO3 metadata string example
meta_vmro3_2: 0
...@@ -98,7 +98,9 @@ class TestSkimming_Common: ...@@ -98,7 +98,9 @@ class TestSkimming_Common:
def test_metadata_commons(self, metadata_dict, variable): def test_metadata_commons(self, metadata_dict, variable):
assert metadata_dict["meta_0"] == "Source metadata string example" assert metadata_dict["meta_0"] == "Source metadata string example"
assert metadata_dict["meta_1"] == "Model metadata string example" assert metadata_dict["meta_1"] == "Model metadata string example"
assert metadata_dict["meta_2"] == 0 submeta_dict = metadata_dict["meta_2"]
assert submeta_dict["meta_20"] == "Sub-metadata from Source"
assert submeta_dict["meta_21"] == "Sub-metadata from Model"
@pytest.mark.parametrize('model_name', conftest.models_tco3, indirect=True) @pytest.mark.parametrize('model_name', conftest.models_tco3, indirect=True)
def test_metadata_tco3(self, metadata_dict, variable): def test_metadata_tco3(self, metadata_dict, variable):
......
...@@ -99,7 +99,9 @@ class TestSkimming_Common: ...@@ -99,7 +99,9 @@ class TestSkimming_Common:
def test_metadata_commons(self, metadata_dict, variable): def test_metadata_commons(self, metadata_dict, variable):
assert metadata_dict["meta_0"] == "Source metadata string example" assert metadata_dict["meta_0"] == "Source metadata string example"
assert metadata_dict["meta_1"] == "Model metadata string example" assert metadata_dict["meta_1"] == "Model metadata string example"
assert metadata_dict["meta_2"] == 0 submeta_dict = metadata_dict["meta_2"]
assert submeta_dict["meta_20"] == "Sub-metadata from Source"
assert submeta_dict["meta_21"] == "Sub-metadata from Model"
@pytest.mark.parametrize('model_name', conftest.models_vmro3, indirect=True) @pytest.mark.parametrize('model_name', conftest.models_vmro3, indirect=True)
def test_metadata_vmro3(self, metadata_dict, variable): def test_metadata_vmro3(self, metadata_dict, variable):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment