Skip to content

Commit

Permalink
Merge pull request openscm#6 from znicholls/ciceroscm-zn
Browse files Browse the repository at this point in the history
Test output units
  • Loading branch information
maritsandstad authored Apr 22, 2021
2 parents 53ec5eb + a3e65b9 commit 3da7eba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
27 changes: 3 additions & 24 deletions tests/integration/test_ciceroSCM.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,11 @@ def test_run(
quantiles = calculate_quantiles(res, [0, 0.05, 0.17, 0.5, 0.83, 0.95, 1])
assert "run_id" not in quantiles.meta

assert res.filter(variable="Atmospheric Concentrations|CO2").get_unique_meta("unit", True) == "ppm"
assert res.filter(variable="Emissions|CO2").get_unique_meta("unit", True) == "PgC / yr"

self._check_output(res, expected_output_file, update_expected_values)

# to add into the json file

# [
# {
# "variable": "Atmospheric Concentrations|CO2",
# "unit": "ppm",
# "region": "World",
# "year": 2100,
# "scenario": "ssp370",
# "quantile": 1
# },
# 2400.88
# ],
# [
# {
# "variable": "Emissions|CO2",
# "unit": "Pg/C",
# "region": "World",
# "year": 2100,
# "scenario": "ssp370",
# "quantile": 1
# },
# 2400.88
# ],

@pytest.mark.ciceroscm
def test_variable_naming(self, test_scenarios):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,28 @@
"quantile": 0.95
},
3.6048250000000004
],
[
{
"variable": "Atmospheric Concentrations|CO2",
"region": "World",
"year": 2100,
"scenario": "ssp370",
"unit": "ppm",
"quantile": 1
},
240
],
[
{
"variable": "Emissions|CO2",
"region": "World",
"year": 2100,
"scenario": "ssp370",
"unit": "Pg/C",
"quantile": 1
},
2400.88
]
]
}
}

0 comments on commit 3da7eba

Please sign in to comment.