Skip to content

Add analyze_dataset orchestrator and recommended_next_steps (#30, #32)#40

Merged
rajeeja merged 2 commits into
mainfrom
rajeeja/issues-30-32-recommendations-analyze
May 9, 2026
Merged

Add analyze_dataset orchestrator and recommended_next_steps (#30, #32)#40
rajeeja merged 2 commits into
mainfrom
rajeeja/issues-30-32-recommendations-analyze

Conversation

@rajeeja
Copy link
Copy Markdown
Collaborator

@rajeeja rajeeja commented May 9, 2026

Summary

Closes #30 and #32. Two related improvements that turn the tool surface from a passive library wrapper into a chainable workflow:

  • Add one-shot analysis entry point: analyze(path) or analyze(session_id, dataset_handle) #32analyze_dataset: deterministic one-shot orchestrator that runs the full first-look pipeline (inspect_meshvalidate_datasetinspect_variablecalculate_areacalculate_zonal_meanplot_meshplot_variable) and returns a single structured result. Each stage runs defensively; a failure is recorded in warnings and the pipeline continues. Accepts direct paths or session_id + dataset_handle. Forwards use_remote / endpoint to every underlying stage.
  • Tool results should recommend next steps to guide agent chaining #30recommended_next_steps: result-bearing tools now suggest follow-up calls so an agent can chain a workflow without knowing the tool vocabulary up front. Coverage in this PR: calculate_zonal_mean, validate_dataset (branched on pass/fail), subset_bbox, subset_polygon, extract_cross_section. (inspect_mesh, inspect_variable, calculate_area already had this from earlier work.)

analyze_dataset is the deterministic counterpart to run_scientific_agent — same general shape, but no LLM reasoning, no branching heuristics, just a predictable chain.

Test plan

  • uv run pytest tests/ --ignore=tests/test_remote_agent.py247 passed
  • uv run pre-commit run --all-files → clean
  • New: tests/test_analyze_dataset.py (6 tests — healpix-only, with-data, plots-on, dataset_handle, single-stage failure recovery, recommended_next_steps presence)
  • New: tests/test_recommended_next_steps.py (6 tests — one per tool, plus the validate-fail branch)
  • Quick local sanity: analyze_dataset("healpix:2") returns mesh+area+plot, no warnings

Files changed

rajeeja added 2 commits May 9, 2026 15:19
#32: New analyze_dataset tool runs the full first-look pipeline
(inspect_mesh, validate_dataset, inspect_variable, calculate_area,
calculate_zonal_mean, plot_mesh, plot_variable) in one deterministic
call. Accepts direct paths or session_id+dataset_handle, forwards
use_remote/endpoint to every stage, and recovers per-stage failures
into a warnings list rather than aborting.

#30: Result-bearing tools now expose recommended_next_steps so an agent
can chain a workflow without already knowing the tool vocabulary.
Coverage: calculate_zonal_mean, validate_dataset (branched on
pass/fail), subset_bbox, subset_polygon, extract_cross_section.

Tests: 12 new tests in test_analyze_dataset.py and
test_recommended_next_steps.py; full suite at 247 passed.
@rajeeja rajeeja merged commit 601708f into main May 9, 2026
8 checks passed
@rajeeja rajeeja deleted the rajeeja/issues-30-32-recommendations-analyze branch May 9, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool results should recommend next steps to guide agent chaining

1 participant