Skip to content

Add cross-validation task SDK client - #413

Open
amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:add-cross-validation-task
Open

amirabbas-jalali-bentley wants to merge 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:add-cross-validation-task

Conversation

@amirabbas-jalali-bentley

@amirabbas-jalali-bentley amirabbas-jalali-bentley commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a typed SDK client in evo-compute for the geostatistics/cross-validation compute task.

Note for reviewers: Most of the line count (~5,800 lines) is in the second commit from github-actions[bot], which contains generated mkdocs/ files for cross_validation plus a few older pages on main that the docs workflow previously skipped because untracked files were not staged. It is easiest to review just the first commit (9 files) or filter out mkdocs/.

Parameters

  • CrossValidationParameters models the task's two discriminated unions directly without flattening estimator-specific or strategy-specific fields:
    • validation (ValidationStrategy): LeaveOneSampleOut (type="sample") and LeaveOneDrillholeOut (type="drillhole").
    • estimator (CrossValidationEstimator): KrigingEstimator (type="kriging", with variogram, neighborhood, kriging_method, and optional KrigingDiagnostics), KNNEstimator (type="knn"), and IDWEstimator (type="idw", with positive power).
  • CrossValidationOutputs configures the per-sample estimate and optional signed error (estimate - true) attributes written back onto the source object, accepting attribute names, typed attributes, or explicit CreateAttribute / UpdateAttribute specs.
  • Validates output attribute compatibility and uniqueness across estimate, error, and kriging diagnostics before job submission, and serializes neighborhood drillhole limits to the OpenAPI property names.

Results & Examples

  • CrossValidationResultModel and CrossValidationResult expose the updated source metadata, written estimate / error / diagnostics attributes, 15-field CrossValidationStatistics (preserving None for undefined statistics and NaN in DataFrame exports for unestimated samples), and optional KrigingCrossValidationStatistics.
  • CrossValidationRunner registers geostatistics/cross-validation with TaskRegistry for single and batch execution via evo.compute.tasks.run, and CrossValidationResult is re-exported from evo.compute.tasks and evo.compute.tasks.geostatistics.
  • Adds packages/evo-compute/docs/examples/cross_validation.ipynb with sample (PointSet) and drillhole (DownholeIntervals) cross-validation workflows.
  • Adds git add --intent-to-add mkdocs to .github/workflows/mkdocs-build.yaml so newly generated MkDocs pages are included in the workflow commit.

Validation

  • uv run python scripts/run_package_tests.py — passed across all packages (evo-compute: 566 passed, 99% statement/branch coverage on cross_validation.py).
  • Validated generated request payloads for all six (validation × estimator) combinations and result payloads against the task JSON Schema (Draft 2020-12).
  • uv run --only-dev ruff check and uv run --only-dev ruff format --check — passed.
  • uv run --only-dev pre-commit run --files ... — passed.
  • uv run --group dev mkdocs build --config-file mkdocs/mkdocs.yml --site-dir site — passed.
  • uv build --package evo-compute and uv lock --check — passed.

Checklist

  • I have read the contributing guide and the code of conduct

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.

1 participant