Don't guess instantaneous time coordinate bounds#2111
Don't guess instantaneous time coordinate bounds#2111Scott Wales (ScottWales) wants to merge 7 commits into
Conversation
|
There are some failing tests with this change:
James Frost (@jfrost-mo), JorgeBornemann (@JorgeBornemann) any preferences on how these are resolved? |
Maybe duplicating the test? one that loads cubes that correctly have bounds in time and reads whatever times are required and another test that loads cubes that don't have bounds and reads times on the instant times?
I would prefer to update the test values, but we may need to retain the coverage of the initial test, looking into cubes that require bounds, so perhaps also duplicating the test? |
|
Thanks JorgeBornemann (@JorgeBornemann). I have fixed up the first set by correcting the times in the test and adding a new test in test_reads that makes sure fields are loaded when the time constraint is inside the time bounds. For the plotting tests there's adjacent tests for fields with and without bounds, so I've moved things around so that each of these is getting the correct cubes. |
JorgeBornemann (JorgeBornemann)
left a comment
There was a problem hiding this comment.
The changes are sound. For me they are good to implement but, as they touch a very generic operator I leave the approval to James Frost (@jfrost-mo) who is more familiar whit it.
James Frost (jfrost-mo)
left a comment
There was a problem hiding this comment.
Minor change requested for how we extract out the list of cube names. I'm uncertain why this isn't causing test failures however.
| for dim_coord in cube.coords(dim_coords=True): | ||
| if (dim_coord.standard_name == "time") and ( | ||
| dim_coord.name() | ||
| not in itertools.chain([m.coord_names for m in cube.cell_methods]) |
There was a problem hiding this comment.
| not in itertools.chain([m.coord_names for m in cube.cell_methods]) | |
| not in itertools.chain.from_iterable(m.coord_names for m in cube.cell_methods) |
If we want to make a flat list of the coord names we need to chain from iterable, as otherwise we will just get a an iterable of lists.
There was a problem hiding this comment.
Possibly the tests weren't exercising cubes with multiple cell methods, will add as a test
Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Guessing time bounds for instantaneous fields causes problems for METplus and Verpy when working with CSET-processed files.
Fixes #2101
Contribution checklist
Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.
rose-suite.conf.examplehas been updated if new diagnostic added.