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/48.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed `depth0m` dimension from `uos_tavg-u-hxy-sea`, `vos_tavg-u-hxy-sea`, `dpco2_tavg-u-hxy-sea` and `spco2_tavg-u-hxy-sea` (see [#21](https://github.com/WCRP-CMIP/Variable-Registry/issues/21))
37 changes: 37 additions & 0 deletions scripts/21-fixes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
Fixes from #21
"""

from __future__ import annotations

import json
from pathlib import Path


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

for branded_variable in (
"uos_tavg-u-hxy-sea",
"vos_tavg-u-hxy-sea",
"dpco2_tavg-u-hxy-sea",
"spco2_tavg-u-hxy-sea",
):
with open(
REPO_ROOT / "src-data" / "variable" / f"{branded_variable}.json"
) as fh:
working = json.load(fh)

working["dimensions"].pop(working["dimensions"].index("depth0m"))

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


if __name__ == "__main__":
main()
3 changes: 1 addition & 2 deletions src-data/variable/dpco2_tavg-u-hxy-sea.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dimensions": [
"longitude",
"latitude",
"time",
"depth0m"
"time"
],
"horizontal-label": "hxy",
"model-realm": "ocnBgchem",
Expand Down
3 changes: 1 addition & 2 deletions src-data/variable/spco2_tavg-u-hxy-sea.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dimensions": [
"longitude",
"latitude",
"time",
"depth0m"
"time"
],
"horizontal-label": "hxy",
"model-realm": "ocnBgchem",
Expand Down
3 changes: 1 addition & 2 deletions src-data/variable/uos_tavg-u-hxy-sea.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dimensions": [
"longitude",
"latitude",
"time",
"depth0m"
"time"
],
"horizontal-label": "hxy",
"model-realm": "ocean",
Expand Down
3 changes: 1 addition & 2 deletions src-data/variable/vos_tavg-u-hxy-sea.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dimensions": [
"longitude",
"latitude",
"time",
"depth0m"
"time"
],
"horizontal-label": "hxy",
"model-realm": "ocean",
Expand Down
Loading