Post-toolregistry follow-ups: uxarray 2026.6.0, new ops, science workflows#65
Conversation
|
HPC end-to-end tested on the Improv endpoint ( Noted that the two new operations ( |
|
The HPC option is only possible if the user has an account on that HPC system, right? |
|
Ran a full old+new function matrix on the Improv endpoint - 9/9 checks pass: Old functions (remote, New features: The run surfaced a real bug: the remote gradient/curl path was dropping Timing: warm round-trips ~1–7s; cold worker re-spin ~3–4 min (PBS provisioning). |
|
@rljacob requesting your review when you have a moment. Quick orientation: What this does (post-#63 follow-ups):
Verification: 323 tests pass, CI green, and validated end-to-end on the Improv endpoint (real MPAS data; the HPC run caught and fixed a Two judgment calls worth your eye:
|
Right; the HPC option only kicks in once you've set up a Globus Compute endpoint on that system, which requires an account/allocation there to run it. Without a configured endpoint, everything just runs locally with the same tools. |
…flows Dependencies - Bump uxarray floor to >=2026.6.0; regenerate uv.lock (drops fastmcp, pulls toolregistry). New UXarray-backed operations (run_analysis) - zonal_anomaly: per-face deviation from each latitude band's zonal mean. - remap_to_rectilinear: remap an unstructured variable onto a regular lon/lat grid. - gradient/curl gain a scale_by_radius flag (default False preserves the unit-sphere result; True divides by uxgrid.sphere_radius). Guided science workflows (prompt/ tools) - cyclone_structure, eddy_activity, model_evaluation, climatology_anomaly, joining the existing vorticity_analysis workflow. Each composes existing operations around a scientific question and returns an interpretation plan. Docs - Fix stale architecture.html labels (toolregistry, Python 3.12). - CHANGELOG 0.2.0 + 0.1.1 backfill + Unreleased entries. - New docs/serving.md (profiles, transports, OpenAPI/REST, discovery). - tools.md operations table, science-workflow prompts, AGENTS.md counts. Policy tags - Add FILE_SYSTEM to session tools and FILE_SYSTEM+NETWORK to get_execution_mode; fix a stale FastMCP RuntimeError message. Tests - New test_new_uxarray_features.py; workflow-prompt and policy-tag tests; update deferred/prompt counts. Full suite passes (322).
These two operations have no remote (Globus Compute) execution path yet, so they cannot run on HPC-resident files. Note the limitation in the tools reference; uniform HPC routing is tracked as a design item.
The local gradient/curl path passed scale_by_radius through, but the remote dispatch dropped it, so use_remote=True silently ran on the unit sphere while provenance could imply otherwise. Thread scale_by_radius through the agent methods and remote compute functions, applied capability-safely (the worker may run an older UXarray): the result now reports the scale_by_radius actually applied. Add a test that locks in the remote threading. Verified on the Improv endpoint: with an older worker UXarray the remote result correctly reports scale_by_radius=False (fallback), and the full old+new operation matrix passes (9/9).
Make explicit that everything runs locally by default and the remote option only becomes available once a Globus Compute endpoint is configured; running one needs an HPC account/allocation, while a shared/service-account endpoint can accept authorized submitters without their own login. Addresses a reviewer question.
30fe0eb to
f28bb54
Compare
Redistribute the catch-all test module into the feature-area suites (vector calculus, zonal, advanced) and share the HEALPix and structured mesh fixtures from conftest. Update the docs surface for the App/OpenAPI serving model, correct the tool counts, document the new analysis operations and prompts, and split the table of contents into a local getting-started track and an optional HPC track.
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up to the toolregistry-server port, updating the UXarray dependency to >=2026.6.0, exposing new run_analysis operations (zonal_anomaly, remap_to_rectilinear), adding scale_by_radius support for gradient/curl, and expanding the guided science workflow surface via additional prompt/ tools.
Changes:
- Bump dependencies (notably
uxarray>=2026.6.0andtoolregistry-server>=0.4.0) and update lockfile. - Add new analysis operations (
zonal_anomaly,remap_to_rectilinear) plusscale_by_radiusthreading through local + HPC code paths for gradient/curl. - Add four new guided science-workflow prompt tools and update docs/tests to reflect the expanded core/deferred surfaces.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Updates resolved dependency versions for UXarray and toolregistry-server stack. |
pyproject.toml |
Raises dependency floors (uxarray>=2026.6.0, toolregistry-server>=0.4.0). |
src/uxarray_mcp/tools/frontdoor.py |
Extends run_analysis dispatcher with new operations and new parameters (incl. scale_by_radius, lat_spec, rectilinear targets). |
src/uxarray_mcp/tools/vector_calc.py |
Threads scale_by_radius through gradient/curl tool calls (local + remote dispatch). |
src/uxarray_mcp/domain/vector_calc.py |
Implements local gradient/curl computation using UXarray’s scale_by_radius. |
src/uxarray_mcp/remote/compute_functions.py |
Adds remote implementations that conditionally apply scale_by_radius based on worker UXarray support. |
src/uxarray_mcp/remote/agent.py |
Extends agent RPC surface to pass scale_by_radius through to remote compute functions. |
src/uxarray_mcp/domain/zonal.py |
Adds compute_zonal_anomaly_stats domain helper. |
src/uxarray_mcp/domain/__init__.py |
Exports compute_zonal_anomaly_stats. |
src/uxarray_mcp/tools/inspection.py |
Adds calculate_zonal_anomaly tool (local). |
src/uxarray_mcp/tools/advanced.py |
Adds remap_to_rectilinear tool (persisted rectilinear dataset result + stats). |
src/uxarray_mcp/tools/__init__.py |
Exposes new tools (calculate_zonal_anomaly, remap_to_rectilinear) in the public surface. |
src/uxarray_mcp/tools/capabilities.py |
Adds capability-gated advertisement of zonal_anomaly and remap.to_rectilinear. |
src/uxarray_mcp/registry.py |
Registers new deferred tools, adds new prompt/ guided workflows, updates tags/search hints. |
tests/test_vector_calc.py |
Adds tests for scale_by_radius defaults and remote forwarding. |
tests/test_calculate_zonal_mean.py |
Adds unit/integration coverage for zonal anomaly (domain + run_analysis dispatch + negative capability test). |
tests/test_advanced_tools.py |
Adds run_analysis dispatch tests for rectilinear remap (including missing target coords error). |
tests/conftest.py |
Adds fixtures for HEALPix datasets and a structured mesh NetCDF round-trip grid/data pair. |
tests/test_server.py |
Updates expected tool counts and adds prompt validation for referencing real operations. |
docs/tools.md |
Documents new operations, parameters, and new science-workflow prompts. |
docs/serving.md |
New documentation page for profiles/transports/OpenAPI and tool discovery. |
docs/index.rst |
Reorganizes toctrees to include tools/serving and clarify MCP vs REST surfaces. |
docs/conf.py |
Updates Sphinx exclude patterns. |
docs/api.rst |
Expands API docs coverage for domain/tools modules introduced/expanded here. |
docs/architecture.html |
Updates labels to reflect toolregistry-server and Python 3.12. |
README.md |
Clarifies local-by-default behavior and HPC opt-in messaging. |
CHANGELOG.md |
Adds Unreleased entries for new operations/prompts and backfills 0.1.1 notes. |
AGENTS.md |
Updates counts and prompt helper list to match the expanded core profile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| scale_by_radius: bool = False, | ||
| lat_spec: Any = None, | ||
| conservative: bool = False, | ||
| target_lon: list[float] | None = None, |
| scale_by_radius : bool | ||
| If True, divide unit-sphere derivatives by ``uxgrid.sphere_radius`` for | ||
| physical units (requires a UXarray release that supports it and a grid | ||
| with ``sphere_radius``). Default False preserves the unit-sphere result. | ||
| Honored on both local and remote execution when the active UXarray | ||
| supports it; otherwise the result stays on the unit sphere. |
| scale_by_radius : bool | ||
| If True, divide the unit-sphere result by ``uxgrid.sphere_radius`` for | ||
| physical units (requires a UXarray release that supports it and a grid | ||
| with ``sphere_radius``). Default False preserves the unit-sphere result. | ||
| Honored on both local and remote execution when the active UXarray | ||
| supports it; otherwise the result stays on the unit sphere. |
Annotate run_analysis lat_spec as tuple/float/list/None so the generated MCP/OpenAPI schema keeps useful type information, matching the zonal-mean helpers. Correct the gradient/curl docstrings: the capability-safe unit-sphere fallback lives on the remote worker path; local execution relies on the pinned UXarray.
Summary
Follow-up work after the toolregistry-server port (#63). Three themes: refresh
the UXarray dependency to the latest release, expose new UXarray operations, and
grow the guided science-workflow surface beyond the single
vorticity_analysishelper.
No breaking changes to existing tool behavior. The full suite passes (322
tests); pre-commit (ruff + mypy) is clean;
uv lock --checkis consistent.Dependencies
uxarrayfloor to>=2026.6.0(released 2026-06-18) and regenerateuv.lock. The lock now reflects the toolregistry stack (fastmcp fully gone).New
run_analysisoperationszonal_anomaly— per-face deviation from the zonal mean of each latitudeband (
UxDataArray.zonal_anomaly). Natural sibling tocalculate_zonal_mean.remap_to_rectilinear— remap an unstructured variable onto a regularlon/lat grid (
UxDataArray.remap.to_rectilinear).gradient/curlgainscale_by_radius— defaults toFalsetopreserve the historical unit-sphere result; set
Trueto divide byuxgrid.sphere_radiusfor physical units. (UXarray 2026.6.0 changed its owndefault to
True; keepingFalsehere avoids a silent change to existingresults.)
Guided science workflows (
prompt/tools)Previously
vorticity_analysiswas the only domain-science guided workflow.Added four more, each composing existing operations around a scientific question
and returning an interpretation plan (instruction text, no new computation):
cyclone_structure— storm/vortex radial structure (azimuthal_mean+subset_bbox, optionallycurl).eddy_activity— departures from the zonal mean (calculate_zonal_mean+zonal_anomaly+gradient).model_evaluation— verification vs a reference (bias+rmse+pattern_correlation).climatology_anomaly— time-mean state and anomalies (temporal_mean+anomaly, optionallycalculate_zonal_mean).Profiles:
core27 → 31,deferred-full58 → 64.Policy tags
FILE_SYSTEMto the session tools (they persist/read JSON records) andFILE_SYSTEM+NETWORKtoget_execution_mode(reads config; queries theendpoint when configured).
RuntimeErrormessage that referenced the removed FastMCPmcp.tool()registration.Docs
docs/architecture.htmllabels (toolregistry, Python 3.12).CHANGELOG.md:0.2.0section, backfill0.1.1, newUnreleasedentries.docs/serving.md(profiles, transports, OpenAPI/REST, tool discovery,no-AI-client usage).
docs/tools.mdoperations table + science-workflow prompts;AGENTS.mdcounts.Tests
tests/test_new_uxarray_features.pycoveringscale_by_radius,zonal_anomaly, andremap_to_rectilinear(incl. a capability-guard negativetest).
counts.
The 8 warnings are a benign
scale_by_radiusUserWarning from UXarray'sdivergence(which callsgradientinternally) on test grids without asphere_radius; results correctly stay on the unit sphere.Notes
(
>=2026.6.0); defensive capability guards remain so a clear error is raisedif a method is ever absent.
not touch the conda recipe.