Fix land fraction ancil creation function#2389
Conversation
mo-jbeaver
left a comment
There was a problem hiding this comment.
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.
maxwhitemet
left a comment
There was a problem hiding this comment.
Thanks @mo-jbeaver. I have addressed all feedback
08c5d46 to
cf51b80
Compare
There was a problem hiding this comment.
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_matchpassthrough option togenerate_roughness_length_at_sites, forwarding toSpotExtraction. - 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_matchboth 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.
bc7e24a to
2152abd
Compare
mo-jbeaver
left a comment
There was a problem hiding this comment.
Happy with all the changes made and the tests ran successfully.
Addresses https://github.com/metoppv/mo-blue-team/issues/1204
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.
Fixes an accidental line break in a docstring and ensures the resulting cube has an appropriate name.
Testing: