Skip to content

Pyvista mesh generator - #96

Open
Josh Rackham (jrackham-mo) wants to merge 31 commits into
MetOffice:mainfrom
jrackham-mo:pyvista-mesh-generator
Open

Pyvista mesh generator#96
Josh Rackham (jrackham-mo) wants to merge 31 commits into
MetOffice:mainfrom
jrackham-mo:pyvista-mesh-generator

Conversation

@jrackham-mo

@jrackham-mo Josh Rackham (jrackham-mo) commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #92 . Closes #59

To be completed prior to review request and updated as required during the review process.

If the answer to an item on the list is not applicable, feel free to replace the checkbox with 'N/A' to give extra clarity.

All developers are reminded to follow the ancil working practices


Branch

Related branches (e.g. ug-ancillary-file-science):
N/A

UG-ANTS rose stem logs
UG-ANTS/run2

ug-ancillary-file-science rose stem logs
ug-ancillary-file-science/run4


Testing

For core UG-ANTS only tests, the bare minimum that will be accepted is the group=unittests but many, if not most, changes will need to test other groups to ensure they meet reviewer expectations. In general, it should be possible and is advised to run the group=all group prior to review submission as this will catch any consequential issues. Additionally you must run the ug-ancillary-file-science tests, pointing at your branch, with group=all to capture any behaviour changes affecting Science codes.

If your change will alter existing science results, you will need to seek appropriate Scientific validation and confirm that the model has been initialised with your new development. Inspecting a change in xconv/pyplot/visualiser of choice is not sufficient to demonstrate the model can be initialised from your file.


Impact of change

  • This will maintain results for UG-ANTS cylc vip ./rose-stem -z group=all tests
  • This will this maintain results for ug-ancillary-file-science cylc vip ./rose-stem -z group=all tests
  • If this change adds a new capability, evidence has been supplied to show testing of ancillary generation across different resolutions e.g. For global ancillary generation capabilities for use in NWP C896 is expected to have been tested
  • This change has significantly impacted required resources (runtime and memory) in existing ancillary generation (if yes, give details)
  • This change alters existing ancils
Add further comments/details for your reviewers here on the impacts of the change......

Approvals for this change

  • I have approval from the UG-ANTS core development team for these changes

New functionality further testing

  • If adding new functionality to existing codes, I confirm that the new code doesn't change results when it is switched off and ''works'' when switched on
  • Unittests have been added
  • Rose stem tests have been added for any new functionality
  • I have not encountered any failures in my rose-stem output(s)
    These tasks must succeed for your ticket to pass review.
  • I have remembered to run the code style check tasks/tools
Add details of any further testing here.

Other

  • I have read the Contributor Licence Agreement
  • I have added my name and affiliation to the Contributors list if I am not already on there in this PR.
  • The ticket labels, milestones, etc. are correct
  • Links to all related tickets have been provided in the ticket description
  • I have requested a code reviewer
  • Source data has been added or changed - please include a link to the license
I confirm that all code is my own and that my contributions are not subject to copyright or license restrictions (see Contributor Licence Agreement). Josh Rackham
I confirm I have not knowingly violated intellectual property rights (IPR) and have taken sensible measures to prevent doing so, including appropriate attribution for usage of Generative AI. I confirm that this work is my own, and I understand that it is my responsibility to ensure I am not violating others’ IPR. This includes taking reasonable steps to ensure that all tools used while creating this contribution did not infringe IPR. Josh Rackham

Please add any further notes here. If Generative AI tools have been used, a brief summary should be provided.
GitHub copilot used to add unit tests for the new stock mesh/cube generators


Rose stem logs

Please copy in the contents of your trac_status.log file(s) below (found in the cylc-run directory for your rose stem run) to your rose-stem testing here. Note: if your changes lead to a change in answers, you must run cylc vip ./rose-stem -z group=all to help ensure all affected configurations has been flagged up.

Add workflow_status.log contents for UG-ANTS rose-stem here. Mon 17 Aug 13:38:20 BST 2026 Git status: [ "" ] Commit: 302a055

Test Results - Summary

tasks total
succeeded 65

Test Results - Detail

task status
install_cold succeeded
ruff succeeded
ancil_regrid_mesh_to_mesh_bilinear succeeded
ancil_regrid_grid_to_mesh_use_input_weights_nearest succeeded
ancil_regrid_mesh_to_mesh_conservative succeeded
ancil_regrid_mesh_to_mesh_nearest succeeded
ancil_regrid_grid_to_mesh_output_weights_nearest succeeded
ancil_regrid_grid_to_mesh_output_weights_conservative succeeded
ancil_regrid_mesh_to_grid_nearest succeeded
ancil_regrid_mesh_to_mesh_conservative_tolerance succeeded
ancil_split_by_latitude_grid_to_mesh succeeded
ancil_fill_missing_points_with_target_mask succeeded
ancil_regrid_mesh_to_grid_output_weights_conservative succeeded
ancil_regrid_grid_to_mesh_conservative succeeded
build_docs succeeded
black succeeded
ancil_generate_mask_sea succeeded
ancil_regrid_mesh_to_grid_use_input_weights_conservative succeeded
ancil_regrid_mesh_to_grid_bilinear succeeded
ancil_ugrid_to_XIOS succeeded
ancil_fill_missing_points_no_target_mask succeeded
ancil_regrid_grid_to_mesh_conservative_tolerance succeeded
ancil_regrid_mesh_to_grid_conservative succeeded
ancil_regrid_mesh_to_grid_output_weights_bilinear succeeded
ancil_generate_mask_land succeeded
ancil_regrid_grid_to_mesh_bilinear_tolerance succeeded
ancil_ugrid_to_XIOS_single succeeded
ancil_regrid_grid_to_mesh_use_input_weights_conservative succeeded
ancil_regrid_grid_to_mesh_output_weights_bilinear succeeded
ancil_split_by_latitude_mesh_to_grid succeeded
unittests succeeded
ancil_regrid_mesh_to_grid_output_weights_nearest succeeded
ancil_regrid_mesh_to_grid_use_input_weights_bilinear succeeded
ancil_regrid_mesh_to_mesh_bilinear_tolerance succeeded
ancil_regrid_grid_to_mesh_use_input_weights_bilinear succeeded
ancil_regrid_mesh_to_grid_use_input_weights_nearest succeeded
ancil_regrid_grid_to_mesh_nearest succeeded
ancil_extract_mesh succeeded
ancil_regrid_grid_to_mesh_bilinear succeeded
rose_ana_extract_mesh succeeded
rose_ana_generate_mask succeeded
rose_ana_fill_missing_points succeeded
rose_ana_regrid_grid_to_mesh succeeded
rose_ana_regrid_mesh_to_grid succeeded
rose_ana_ugrid_to_XIOS succeeded
rose_ana_regrid_mesh_to_mesh succeeded
ancil_band_regrid_grid_to_mesh_conservative_tolerance succeeded
ancil_band_regrid_grid_to_mesh_nearest succeeded
ancil_band_regrid_grid_to_mesh_bilinear_tolerance succeeded
ancil_band_regrid_grid_to_mesh_bilinear succeeded
ancil_band_regrid_grid_to_mesh_conservative succeeded
ancil_band_regrid_mesh_to_grid_conservative succeeded
ancil_band_regrid_mesh_to_grid_nearest succeeded
ancil_band_regrid_mesh_to_grid_bilinear succeeded
linkcheck succeeded
ancil_recombine_mesh_bands_bilinear_tolerance succeeded
ancil_recombine_mesh_bands_nearest succeeded
ancil_recombine_grid_bands_bilinear succeeded
ancil_recombine_mesh_bands_bilinear succeeded
ancil_recombine_mesh_bands_conservative succeeded
ancil_recombine_grid_bands_nearest succeeded
ancil_recombine_mesh_bands_conservative_tolerance succeeded
ancil_recombine_grid_bands_conservative succeeded
rose_ana_band_regrid_grid_to_mesh succeeded
rose_ana_band_regrid_mesh_to_grid succeeded

Mon 17 Aug 11:45:43 BST 2026 Git status: [ " M app/install_cold/rose-app.conf" ] Commit: f59312e886fb320c5dfb12228a1438e2e5627777

Test Results - Summary

tasks total
succeeded 46

Test Results - Detail

task status
install_cold succeeded
subgrid_orography_unittests succeeded
ancil_apply_mask_invert succeeded
apply_mask_unittests succeeded
ancil_regrid_zonal_mean succeeded
ancil_apply_mask_replacezero succeeded
ancil_soils_hydrology_dominant_parameters succeeded
regrid_zonal_mean_unittests succeeded
add_zeroth_level_unittests succeeded
ancil_soil_dust succeeded
soil_params_unittests succeeded
ancil_lai succeeded
add_lakes_unittests succeeded
canopy_heights_unittests succeeded
soil_roughness_unittests succeeded
black succeeded
ostia2nwp_unittests succeeded
ancil_apply_mask_default succeeded
ruff succeeded
ancil_soil_roughness_postproc succeeded
ancil_lct succeeded
example_unittests succeeded
ancil_example succeeded
ancil_lct_unittests succeeded
ancil_soil_roughness_postproc_land succeeded
ancil_subgrid_orography succeeded
ancil_canopy_heights succeeded
ancil_add_zeroth_level succeeded
soil_dust_unittests succeeded
build_docs succeeded
lai_unittests succeeded
rose_ana_apply_mask succeeded
rose_ana_add_zeroth_level succeeded
rose_ana_example succeeded
rose_ana_canopy_heights succeeded
rose_ana_subgrid_orography succeeded
rose_ana_soil_roughness_postproc_land succeeded
rose_ana_soil_roughness_postproc succeeded
rose_ana_regrid_zonal_mean succeeded
rose_ana_ancil_lct succeeded
rose_ana_lai succeeded
rose_ana_soil_dust succeeded
ancil_soils_hydrology_average_parameters succeeded
linkcheck succeeded
ancil_soils_hydrology_make_consistent succeeded
rose_ana_soil_params succeeded

This also revealed a bug in the splitting, where the start index
was not accounted for properly.
Some of the content of this commit has been produced with the assistance of Met Office GitHub Copilot Enterprise
Some of the content of this commit has been produced with the assistance of Met Office GitHub Copilot Enterprise
Some of the content of this commit has been produced with the assistance of Met Office GitHub Copilot Enterprise
@jrackham-mo Josh Rackham (jrackham-mo) added the ✨ enhancement Feature request for new capability label Aug 17, 2026
@jrackham-mo

Josh Rackham (jrackham-mo) commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

Noting that there was a failing unit test in the split mesh-to-grid regrid (lib/ugants/tests/regrid/applications/test_integration.py::TestConsistentResults::test_no_tolerance[bilinear-4]). Difference plot attached (expected - actual):

diffplot

Expected: global-to-global mesh-to-grid regrid.
Actual: split-regrid-recombine mesh-to-grid regrid, with 4 bands.
Both using bilinear method.

There are a bunch of masked points (the white points in the plot), which appear masked in both the expected and actual (due to SciTools/iris-esmf-regrid#391, now fixed in later versions of iris-esmf-regrid). There are also a few points where there are actual differences.

As a result I have decided to increase the source data resolution for this test from C4 to C12 (splitting a C4 into 4 bands is a fairly unrealistic test of our banded regrid): 302a055

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

Labels

✨ enhancement Feature request for new capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a stock panel mesh generator Add a stock cubed sphere mesh generator for unit testing

1 participant