Skip to content

Fix land fraction ancil creation function#2389

Open
maxwhitemet wants to merge 9 commits into
metoppv:masterfrom
maxwhitemet:tidy_ancil_generation
Open

Fix land fraction ancil creation function#2389
maxwhitemet wants to merge 9 commits into
metoppv:masterfrom
maxwhitemet:tidy_ancil_generation

Conversation

@maxwhitemet

@maxwhitemet maxwhitemet commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Addresses https://github.com/metoppv/mo-blue-team/issues/1204

  1. Fixes a misreading/typo regarding the delineation between land and 'water bodies': 'water bodies' start at classification code 40, not 39. This is demonstrated in table 1, table 2 and table 3. I imagine this was caused by these tables being difficult to find, and so that manual counting was used from page 67 of the official manual.

  2. Fixes an accidental line break in a docstring and ensures the resulting cube has an appropriate name.

Testing:

  • Ran tests and they passed OK

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added a few small comments but overall happy with the changes.
The unit tests all ran as expected. However, the unit test should be updated to include the new variable added to the generate_roughness_length_at_sites function, checking that the pytest still runs as expected when ignore_grid_match = False and True.
Additionally, there probably should be an acceptance test that goes with these functions.

Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Outdated
Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py
Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Outdated

@maxwhitemet maxwhitemet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mo-jbeaver. I have addressed all feedback

Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Outdated
Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py
Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Outdated
Copilot AI review requested due to automatic review settings July 1, 2026 08:32
@maxwhitemet maxwhitemet force-pushed the tidy_ancil_generation branch from 08c5d46 to cf51b80 Compare July 1, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates miscellaneous ancillary-generation helpers to (a) support optionally bypassing strict grid-hash matching during spot extraction and (b) ensure the land area fraction output cube has a consistent, explicit name, alongside a small docstring formatting fix.

Changes:

  • Add an ignore_grid_match passthrough option to generate_roughness_length_at_sites, forwarding to SpotExtraction.
  • Fix a docstring line break and explicitly rename the concatenated land area fraction cube to "land_area_fraction".
  • Expand unit tests to cover roughness-length ancillary generation with ignore_grid_match both enabled and disabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Adds ignore_grid_match support for spot extraction and ensures land area fraction output cube is explicitly named; docstring formatting cleanup.
improver_tests/generate_ancillaries/test_miscellaneous_ancillaries.py Parametrizes roughness-length ancillary test to exercise ignore_grid_match True/False.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread improver/generate_ancillaries/generate_miscellaneous_ancillaries.py Outdated
@maxwhitemet maxwhitemet force-pushed the tidy_ancil_generation branch from bc7e24a to 2152abd Compare July 1, 2026 09:28
mo-jbeaver
mo-jbeaver previously approved these changes Jul 1, 2026

@mo-jbeaver mo-jbeaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Happy with all the changes made and the tests ran successfully.

@maxwhitemet maxwhitemet changed the title Fix function Fix land fraction ancil creation function Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants