Repository navigation
Record what of UXarray we reach, and close three gaps - #192
Merged
Merged
Conversation
Replaying the notebooks in UXARRAY/uxarray-community through the server found capabilities a user reaches for that we could not run. Looking for the rest of them found twelve, and no record anywhere of which absences were decided and which were merely unnoticed. domain/uxarray_surface.py is that record. Every UXarray-specific method on UxDataArray, UxDataset and the subset accessor appears once, with either the operation that reaches it or the reason it is out of scope. The xarray-inherited surface is excluded: ~150 methods that are not UXarray's to change and would drown the signal. tests/test_uxarray_surface.py holds the list to the installed library. A new method upstream fails until someone writes a verdict; a renamed one fails the day the rename lands rather than the next time a user follows our advice into a method that is gone. It also checks that every route the inventory claims actually exists, because an inventory claiming a route that was never wired is worse than one with a visible gap. Deliberately not a count. "We expose N of M methods" goes red on every upstream release for reasons nobody can act on, and the repair is to edit the number -- which teaches people to stop reading the test. The weekly floor job spent six Mondays red for that reason. Three gaps closed, in two new tools rather than in run_analysis: - subset_advanced -- selection near a point, by radius (bounding_circle) or by neighbour count (nearest_neighbor). Four uses each in the notebooks. An empty selection is refused with the mesh extent, the same rule test_subset_coverage.py already enforces for bounding boxes; UXarray's own message says the circle was empty without saying where a circle would not be. - regrid_elements -- carries a field between nodes, edges and faces via the topological_* reductions. Three uses, all in the step that moves node-centred vorticity onto faces before anything else can touch it. They are separate tools, and deferred, because #89 measures run_analysis at 46 parameters over 25 operations and names that as the problem to fix. Adding a radius, a neighbour count, a centre and a destination element to it would have made the measured problem worse in order to fix a different one. Each new tool takes only what its own operation uses. Two honesty fixes fall out of the same work: - get_capabilities lists native UXarray calls, several of which the server cannot execute -- grid.get_ball_tree(), var.integrate(). All true, none runnable here, and nothing said so. A model reading that plans a call that does not exist. The result now carries uxarray_capabilities_are_advisory, naming mcp_server_tools as the executable surface. - The face-centred refusals were a dead end. "Variable 't_node' is not face-centered" is correct, and the standard repair is topological_mean("face"), which the server could not run, so the message offered nothing. It now names regrid_elements, and a test follows that advice to confirm it works rather than landing on a second error. EXPECTED_DEFERRED moves 33 -> 35. That counter guards the namespace plan against drift, which two new deferred tools genuinely changes. 1538 passed, 1 skipped, 44 deselected, 1 xfailed. Verified over stdio on the deferred-full profile: both tools run through call_deferred, and the empty-circle refusal carries the mesh extent.
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.
Replaying the notebooks in UXARRAY/uxarray-community
through the server found capabilities a user reaches for that we cannot run.
Looking for the rest found twelve, and no record anywhere of which absences
were decided and which were simply unnoticed.
The inventory
domain/uxarray_surface.pylists every UXarray-specific method onUxDataArray,UxDatasetand thesubsetaccessor, each with either theoperation that reaches it or the reason it is out of scope. The
xarray-inherited surface is excluded on purpose: ~150 methods that are not
UXarray's to change and would drown the signal.
tests/test_uxarray_surface.pyholds it to the installed library:time a user follows our advice into a method that is gone;
route that was never wired is worse than one with a visible gap.
Deliberately not a count. A test asserting "we expose N of M methods" goes
red on every upstream release for reasons nobody can act on, and the repair is
to edit the number — which teaches people to stop reading it. The weekly floor
job spent six Mondays red for exactly that reason.
Three gaps closed — as new tools, not in
run_analysissubset_advancedsubset.bounding_circle,subset.nearest_neighborregrid_elementstopological_meanand 6 siblingsregrid_elementsis the step that moves node-centred vorticity onto facesbefore anything else can touch it — the cyclone notebook opens with it.
An empty selection is refused with the mesh extent, the rule
test_subset_coverage.pyalready enforces for bounding boxes. UXarray's ownmessage says the circle was empty without saying where a circle would not be:
Why separate tools: #89 measures
run_analysisat 46 parameters over 25operations and names that as the problem. Adding a radius, a neighbour count, a
centre and a destination element to it would have made the measured problem
worse in order to fix a different one. Each new tool takes only what its own
operation uses, and both are deferred.
Two honesty fixes
get_capabilitiesadvertised things it cannot run. It lists native UXarraycalls —
grid.get_ball_tree(),var.integrate(),grid.subset.bounding_circle()— all valid UXarray, none executable here, and nothing said so. A model reading
that plans a call that does not exist; the same defect class as a wrong tool
annotation. The result now carries
uxarray_capabilities_are_advisory, namingmcp_server_toolsas the executable surface.The face-centred refusals were a dead end.
Variable 't_node' is not face-centeredis correct, and the standard repair istopological_mean("face")— which the server could not run, so the message had nothing to offer. It now
names
regrid_elements, and a test follows that advice to confirm it worksrather than landing on a second error.
Verification
1538 passed, 1 skipped, 44 deselected, 1 xfailedEXPECTED_DEFERRED33 → 35; that counter guards the namespace plan againstdrift, which two new deferred tools genuinely changes.
deferred-full: both tools run throughcall_deferred, thecircle and nearest selections return the expected face counts,
regrid_elementsmoves
['n_node'] -> ['n_face'], and the empty-circle refusal carries themesh extent.
Still open, now recorded rather than unnoticed
weighted_mean,neighborhood,to_raster, and the twoconstant_*_intervalselections are markedgapwith reasons.get_dual,scalardotgradient,topological_prodand the boolean reductions areout-of-scopewith reasons.