Refuse a subset that selected nothing - #122
Merged
Merged
Conversation
A bounding box at 160-170W / 70-80S applied to a mesh covering 0-40E / 0-40N returned outcome: complete, status: complete, no warning codes, a subset_grid of n_face: 0, a variable_summary of shape: [0], a persisted artifact and a next-steps list telling the caller to plot it. subset_polygon did the same with selected_face_count: 0. All three selection operations now report subset_coverage with n_face_source, n_face_retained and the source mesh extent, and refuse when nothing was kept. There is deliberately no partial code: keeping fewer faces is what a subset is for, and a code that fires on every successful call teaches callers to ignore it. The refusal names the argument the caller controls and quotes the longitude and latitude the mesh spans, because "nothing selected" does not say where to put the box and the -180..180 against 0..360 mix-up is the likeliest way to arrive here. cross_section was the one case UXarray already caught, raising "No intersections found at lat=...". That is not silent, but it says the line found nothing without saying where a line would find something, so it becomes the same refusal with the extent attached. Any other ValueError still propagates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An off-mesh bounding box returned
outcome: completewith asubset_gridofn_face: 0, avariable_summaryofshape: [0], a persisted artifact and a next-steps list telling the caller to plot it;subset_polygondid the same withselected_face_count: 0. All three selection operations now reportsubset_coverageand refuse when nothing was kept, with a repair that names the caller's own argument and quotes the longitude and latitude the mesh actually spans. There is no partial code on purpose, since keeping fewer faces is what a subset is for; 18 new tests, full suite 840 passed / 18 skipped, pre-commit green.