Skip to content

Add verif functionality to develop#1723

Open
rolfhm wants to merge 35 commits intoecmwf:developfrom
rolfhm:add-support-for-met-norway-verification-output-mergebranch
Open

Add verif functionality to develop#1723
rolfhm wants to merge 35 commits intoecmwf:developfrom
rolfhm:add-support-for-met-norway-verification-output-mergebranch

Conversation

@rolfhm
Copy link
Contributor

@rolfhm rolfhm commented Jan 27, 2026

Description

Adds routines to generate verif files for Met Norways verification program.

Issue Number

Closes #1800

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

@rolfhm rolfhm marked this pull request as draft January 27, 2026 15:46
rolfhm and others added 27 commits January 30, 2026 16:04
…nto add-support-for-met-norway-verification-output-mergebranch
Sorcha/dev/1880 REfactor of verifparser
@rolfhm rolfhm marked this pull request as ready for review March 13, 2026 14:10
@github-actions github-actions bot added the eval anything related to the model evaluation pipeline label Mar 13, 2026
@enssow enssow requested a review from iluise March 13, 2026 14:40
@clessig
Copy link
Collaborator

clessig commented Mar 14, 2026

@rolfhm : are you aware of this PR: #1908? Would this affect the work here?

@rolfhm
Copy link
Contributor Author

rolfhm commented Mar 16, 2026

@rolfhm : are you aware of this PR: #1908? Would this affect the work here?

I don't think so. At least there does not appear to be any conflicting code changes. Do you know anything about this @enssow?

@enssow enssow mentioned this pull request Mar 16, 2026
4 tasks
@enssow
Copy link
Contributor

enssow commented Mar 16, 2026

@rolfhm : are you aware of this PR: #1908? Would this affect the work here?

I don't think so. At least there does not appear to be any conflicting code changes. Do you know anything about this @enssow?

I don't believe it will affect the work as there are no changes to the zarrio_reader upon which export relies on. But this reminds me that it would be a good idea to add a unit test for export for the PR checks, to catch anything in the future, I'll open an issue for that.

Comment on lines +190 to +210
var_dict, pl = find_pl(data.channel.values)
data_vars = {}

for new_var, old_vars in var_dict.items():
if len(old_vars) > 1:
data_vars[new_var] = xr.DataArray(
data.sel(channel=old_vars).values,
dims=["ipoint", "pressure_level"],
)
else:
data_vars[new_var] = xr.DataArray(
data.sel(channel=old_vars[0]).values,
dims=["ipoint"],
)

reshaped_dataset = xr.Dataset(data_vars)
reshaped_dataset = reshaped_dataset.assign_coords(
ipoint=data.coords["ipoint"],
pressure_level=pl,
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI Rolf, fyi there are recent changes to the export package that will affect this PR. To ensure compatibility, these lines should be changed (I'm not sure if merging ecmwf/develop will do it automatically so leaving a comment here)

Suggested change
var_dict, pl = find_pl(data.channel.values)
data_vars = {}
for new_var, old_vars in var_dict.items():
if len(old_vars) > 1:
data_vars[new_var] = xr.DataArray(
data.sel(channel=old_vars).values,
dims=["ipoint", "pressure_level"],
)
else:
data_vars[new_var] = xr.DataArray(
data.sel(channel=old_vars[0]).values,
dims=["ipoint"],
)
reshaped_dataset = xr.Dataset(data_vars)
reshaped_dataset = reshaped_dataset.assign_coords(
ipoint=data.coords["ipoint"],
pressure_level=pl,
)
var_dict = find_pl(data.channel.values)
data_vars = {}
for new_var, pls in var_dict.items():
if pls[0] is not None:
old_vars = [f"{new_var}_{p}" for p in pls]
data_vars[new_var] = xr.DataArray(
data.sel(channel=old_vars).values,
dims=["ipoint", "pressure_level"],
coords={"pressure_level": pls},
)
else:
data_vars[new_var] = xr.DataArray(
data.sel(channel=new_var).values,
dims=["ipoint"],
)
reshaped_dataset = xr.Dataset(data_vars)
reshaped_dataset = reshaped_dataset.assign_coords(
ipoint=data.coords["ipoint"],
)
# order using pressure_level coord
if "pressure_level" in reshaped_dataset.coords:
reshaped_dataset = reshaped_dataset.sortby("pressure_level")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval anything related to the model evaluation pipeline

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

investigate adding verif parser to export

3 participants