Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/74.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated the cell methods and description of `esn_tavg-u-hxy-sn` to clarify the meaning (see [DR #84](https://github.com/CMIP-Data-Request/Harmonised-Public-Consultation/issues/84))
39 changes: 39 additions & 0 deletions scripts/84-dr-fixes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Fixes from DR #84
"""

from __future__ import annotations

import json
from pathlib import Path


def main():
"""
Apply the fixes
"""
REPO_ROOT = Path(__file__).parents[1]

for branded_variable, new_cell_methods, new_description in (
(
"esn_tavg-u-hxy-sn",
"area: mean where snow (on land only) time: mean",
"Evapotranspiration flux due to conversion of liquid or solid water into vapor at the surface where there is snow on land",
),
):
with open(
REPO_ROOT / "src-data" / "variable" / f"{branded_variable}.json"
) as fh:
working = json.load(fh)

working["cell-methods"] = new_cell_methods
working["description"] = new_description

with open(
REPO_ROOT / "src-data" / "variable" / f"{branded_variable}.json", "w"
) as fh:
json.dump(working, fh, indent=4)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions src-data/variable/esn_tavg-u-hxy-sn.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"id": "esn_tavg-u-hxy-sn",
"validation-key": "esn_tavg-u-hxy-sn",
"ui-label": "Snow Evaporation",
"description": "liquid\\_water\\_evaporation\\_flux\\_from\\_surface\\_snow",
"description": "Evapotranspiration flux due to conversion of liquid or solid water into vapor at the surface where there is snow on land",
"area-label": "sn",
"cell-measures": "area: areacella",
"cell-methods": "area: mean where land time: mean",
"cell-methods": "area: mean where snow (on land only) time: mean",
"dimensions": [
"longitude",
"latitude",
Expand Down
Loading