Skip to content

Nan extrapolation config bug - #211

Merged
Josh Rackham (jrackham-mo) merged 1 commit into
MetOffice:environment-update-feature-branchfrom
arjclark:nan_extrapolation_config_bug
Oct 23, 2026
Merged

Josh Rackham (jrackham-mo) merged 1 commit into
MetOffice:environment-update-feature-branchfrom
arjclark:nan_extrapolation_config_bug

Conversation

@arjclark

Copy link
Copy Markdown
Collaborator

Closes #210

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

ANTS rose stem logs

nan_config_bug/run1


Testing

For core 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 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 ANTS cylc vip ./rose-stem -z group=all tests
  • This will this maintain results for 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 n1280e 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
Fixes an apparently long-standing bug that was preventing ability to use extrapolation_mode=nan in an app config for vertical and horizontal regridding.

Approvals for this change

  • I have approval from the 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
  • If adding new functionality please confirm that the new code compares across different standard decompositions.
  • 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

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 issue labels, milestones, etc. are correct
  • Links to all related issues have been provided in the pull request 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). Andrew Clark
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. Andrew Clark
Met Office Github Copilot Enterprise used to refine solution and add extra unittests.

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.

Thu 22 Oct 14:06:42 BST 2026 Git status: [ ] Commit: 0ac1494

Test Results - Summary

tasks total
failed 1
succeeded 67

Test Results - Detail

task status
install_cold succeeded
ancil_fill_n_merge_invert_mask_latitude_weighted_kdtree succeeded
ancil_general_regrid_with_time_constraint_kdtree_split2 succeeded
ancil_general_regrid_grid_to_n48_namelist_split0 succeeded
ancil_general_regrid_3d_to_3d_with_extrapolation_split1 succeeded
ancil_general_regrid_grid_to_grid_kdtree_split1 succeeded
ancil_general_regrid_grid_to_n48_namelist_split1 succeeded
ancil_general_regrid_invert_mask_spiral_split1 succeeded
ancil_general_regrid_invert_mask_spiral_split2 succeeded
ancil_general_regrid_grid_to_grid_latitude_weighted_kdtree_split2 succeeded
ancil_general_regrid_invert_mask_latitude_weighted_kdtree_split2 succeeded
ancil_general_regrid_with_time_constraint_spiral_split0 succeeded
ancil_2anc_split2 succeeded
unittests succeeded
ancil_general_regrid_3d_to_3d_split1 succeeded
ancil_vertical_regrid_ozone_zonal_mean succeeded
ancil_general_regrid_grid_to_grid_kdtree_split2 succeeded
ancil_general_regrid_invert_mask_kdtree_split0 succeeded
ancil_general_regrid_3d_to_3d_with_extrapolation_split2 succeeded
ancil_general_regrid_with_time_constraint_spiral_split2 succeeded
ancil_general_regrid_3d_to_3d_split2 succeeded
ancil_fill_n_merge_invert_mask_kdtree succeeded
ancil_general_regrid_grid_to_grid_latitude_weighted_kdtree_split0 succeeded
ancil_general_regrid_grid_to_grid_spiral_split2 succeeded
ancil_general_regrid_grid_to_n48_namelist_split2 succeeded
ancil_general_regrid_grid_to_grid_spiral_split0 succeeded
ancil_general_regrid_with_time_constraint_spiral_split1 succeeded
ancil_general_regrid_grid_to_n48e_namelist_split2 succeeded
ancil_general_regrid_with_time_constraint_kdtree_split1 succeeded
build_docs succeeded
ancil_general_regrid_invert_mask_spiral_split0 succeeded
ancil_general_regrid_grid_to_variable_resolution_grid_split2 succeeded
ancil_general_regrid_with_time_constraint_latitude_weighted_kdtree_split1 succeeded
ancil_general_regrid_grid_to_n48e_namelist_split0 succeeded
ancil_general_regrid_invert_mask_latitude_weighted_kdtree_split0 succeeded
ancil_general_regrid_with_time_constraint_latitude_weighted_kdtree_split0 succeeded
ancil_2anc_split0 succeeded
ancil_general_regrid_invert_mask_latitude_weighted_kdtree_split1 succeeded
ancil_create_ite_shapefile succeeded
ancil_general_regrid_grid_to_variable_resolution_grid_split1 succeeded
ancil_general_regrid_3d_to_3d_split0 succeeded
ancil_general_regrid_grid_to_grid_kdtree_split0 succeeded
ancil_general_regrid_grid_to_grid_spiral_split1 succeeded
ancil_general_regrid_grid_to_grid_latitude_weighted_kdtree_split1 succeeded
ancil_general_regrid_with_time_constraint_kdtree_split0 succeeded
ancil_general_regrid_with_time_constraint_latitude_weighted_kdtree_split2 succeeded
ancil_general_regrid_grid_to_n48e_namelist_split1 succeeded
ancil_fill_n_merge_invert_mask_spiral succeeded
ancil_general_regrid_3d_to_3d_with_extrapolation_split0 succeeded
ancil_general_regrid_grid_to_variable_resolution_grid_split0 succeeded
ancil_general_regrid_invert_mask_kdtree_split1 succeeded
ancil_2anc_split1 succeeded
flake8 succeeded
black succeeded
isort succeeded
ancil_vertical_regrid_aerosol_3d succeeded
ancil_general_regrid_invert_mask_kdtree_split2 succeeded
ancil_fill_n_merge_land_cover_spiral succeeded
ancil_fill_n_merge_land_cover_kdtree succeeded
ancil_fill_n_merge_land_cover_latitude_weighted_kdtree succeeded
rose_ana_fill_n_merge succeeded
rose_ana_2anc succeeded
rose_ana_general_regrid_latitude_weighted_kdtree succeeded
rose_ana_general_regrid_spiral succeeded
rose_ana_general_regrid succeeded
rose_ana_general_regrid_kdtree succeeded
rose_ana_vertical_regrid succeeded
linkcheck failed

Changes made with assistance of MetOffice github copilot.
@arjclark Andrew Clark (arjclark) added this to the 4.0 milestone Oct 22, 2026
@arjclark Andrew Clark (arjclark) added the 🐜 bug Bug report for something that isn't working label Oct 22, 2026
@arjclark
Andrew Clark (arjclark) changed the base branch from main to environment-update-feature-branch October 22, 2026 13:11

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Happy with this approach in the short term - longer term I'd like to overhaul the config parser to handle types properly (possibly via a schema).

A minor concern I have is that the _create_horizontal_regrid_scheme_instance() and _create_vertical_regrid_scheme_instance() functions now explicitly accept a float, but really the only float they take is nan. I wondered whether we should fail fast if any other float is provided (using math.isnan to verify), but I'm satisfied that the regridder constructor will fail with a useful error if an unexpected value is passed (e.g. 1.0)

@jrackham-mo
Josh Rackham (jrackham-mo) merged commit 797672d into MetOffice:environment-update-feature-branch Oct 23, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐜 bug Bug report for something that isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config item extrapolation_mode=nan breaks regridder

2 participants