Issue #915: Produce BCVs#918
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
| merged_cubes = load_cubes_from_pp(all_input_data, load_constraints, run_bounds, ancil_variables) | ||
| else: | ||
| merged_cubes = load_cubes_from_nc(all_input_data, load_constraints, run_bounds) | ||
| merged_cubes = load_cubes_from_nc(all_input_data, load_constraints, effective_run_bounds) |
There was a problem hiding this comment.
I went with the name change from run_bounds to effective_run_boundsto prevent join(run_bounds) (Ln 211) throwing an error due to being used with the None which gets assigned on line 203. Hoping the rename isn't confusing.
| else: | ||
| cube = apply_time_constraint(merged_cube, time_constraint) | ||
| if cube is not None: | ||
| cubes.append(cube) |
There was a problem hiding this comment.
Setting time_constraint to None was necessary for the nemo ancil that lacked run bounds. However, passing None to setup_time_constraint lead to TypeError: 'NoneType' object is not subscriptable when iris evaluated it. The guard should now only be constructing the time constraint when run_bounds is not None, and appending the cube directly otherwise.
| "ancil_variables": [ | ||
| "u_coord_reference", | ||
| "v_coord_reference" | ||
| ], |
There was a problem hiding this comment.
Needed otherwise moo filter threw an error trying to extract these from MASS.
| var_names = [cube.coord(axis=axis).var_name | ||
| for cube in input_variables.values() | ||
| if not cube.var_name.endswith('_coord_reference')] | ||
| if not (cube.var_name and cube.var_name.endswith('_coord_reference'))] |
There was a problem hiding this comment.
Refinement to the guard added earlier as it caused an attribute error on .pp ancils due to them not having a "var_name" to check.
This allowed these variables to be produced:
land/mrsofc_ti-u-hxy-lnd@fx:fx
land/orog_ti-u-hxy-u@fx:fx
Should fulfil #915