Add kriging diagnostic outputs to the task SDK client - #348
amirabbas-jalali-bentley merged 3 commits into
Conversation
e56c503 to
65544d3
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Output collisions and cross-object attributes are not validated, and generated documentation links target missing pages.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds typed kriging diagnostic outputs to the compute SDK, including request serialization, result parsing, tests, and examples.
Changes:
- Adds diagnostic selectors, recommended names, and target serialization.
- Exposes returned diagnostic attributes through kriging results.
- Updates exports, tests, notebooks, generated documentation, and dependencies.
File summaries
| File | Description |
|---|---|
uv.lock |
Updates evo-blockmodels lock version. |
packages/evo-compute/tests/test_tasks.py |
Uses the specialized kriging target result. |
packages/evo-compute/tests/geostatistics/test_kriging_tasks.py |
Tests diagnostic inputs, serialization, and results. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/kriging.py |
Implements diagnostic request and result models. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/__init__.py |
Exports KrigingDiagnostics. |
packages/evo-compute/src/evo/compute/tasks/common/source_target.py |
Extracts typed attribute conversion. |
packages/evo-compute/src/evo/compute/tasks/common/__init__.py |
Exports attribute_spec. |
packages/evo-compute/src/evo/compute/tasks/__init__.py |
Adds the top-level diagnostics export. |
packages/evo-compute/docs/examples/kriging.ipynb |
Demonstrates requesting diagnostics. |
mkdocs/site/packages/evo-files/index.html |
Updates generated previous-page navigation. |
mkdocs/site/packages/evo-compute/typed-objects/source-target/UpdateAttribute.html |
Updates generated next-page navigation. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/SimpleKriging.html |
Updates generated navigation. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/OrdinaryKriging.html |
Updates generated navigation. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingRunner.html |
Updates generated navigation. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingResultModel.html |
Documents the specialized target result. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingResult.html |
Documents result diagnostics. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingParameters.html |
Documents diagnostic parameters. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingMethod.html |
Updates generated navigation. |
code-samples/geoscience-objects/running-kriging-compute/running-kriging-compute.ipynb |
Extends the walkthrough with diagnostics. |
code-samples/geoscience-objects/running-kriging-compute/README.md |
Lists diagnostics in the walkthrough scope. |
Review details
Suppressed comments (1)
mkdocs/site/packages/evo-compute/typed-objects/kriging/OrdinaryKriging.html:42
RECOMMENDED_DIAGNOSTIC_NAMES.htmlis absent from the checked-in kriging API directory, making this Next link a 404. Regenerate and commit the missing API page.
<a rel="next" href="RECOMMENDED_DIAGNOSTIC_NAMES.html" class="nav-link">
- Files reviewed: 19/20 changed files
- Comments generated: 8
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4e6f6b6 to
c33ef0c
Compare
aminabedi-bentley
left a comment
There was a problem hiding this comment.
LGTM; with some minor comments.
85e8562 to
77950e2
Compare
- Expose the `target.diagnostics` structure of the kriging task, so the 16 optional per-location diagnostics can be requested through the SDK. - `KrigingParameters.diagnostics` takes a `KrigingDiagnostics` and is folded into `target.diagnostics` on the wire, matching how the source and target filters are already handled. Each diagnostic accepts `True` for the recommended attribute name, a string for a custom name, a typed attribute to update an existing one, or an explicit create/update specification. - The result now parses `target.diagnostics`, so `KrigingResult.diagnostics` reports the definitive name and reference of every attribute that was written.
77950e2 to
031646f
Compare
GriffinBaxterSeequent
left a comment
There was a problem hiding this comment.
Happy with this from a evo-python-sdk-maintainers perspective, cheers!
PaulCaygill-Seequent
left a comment
There was a problem hiding this comment.
Small things, around the same area of code around Diagnostic validation, otherwise nothing jumping out as an issue
- Track attribute names and update references in two separate maps, so the rule reads directly: no two outputs may share an attribute name or an update reference. - Cover a typed attribute that a hand-written update reference also targets.
Description
Adds support for the kriging task's diagnostic outputs to the
evo-computeSDK client.The kriging task can write per-location diagnostics onto the target object alongside the estimate — kriging variance, slope of regression, sample counts, search distances, and so on. These live under
target.diagnosticsin the task schema, and were previously not reachable through the SDK.Parameters
KrigingParametersgains adiagnosticsfield taking aKrigingDiagnostics. It is folded intotarget.diagnosticsby the existing model serializer, the same waysource_filterandtarget_filterare already folded intosource.filter/target.filter— so callers keep passing a typed attribute (or aTarget) fortargetand do not have to hand-build the nested object.Every diagnostic accepts:
True— create an attribute using the recommended name (RECOMMENDED_DIAGNOSTIC_NAMES, e.g.KV,SoR,NS)CreateAttribute/UpdateAttributeThe recommended names match the conventions used elsewhere in the product so results are familiar once imported. They are the schema's suggested names rather than server-side defaults, so the SDK always sends an explicit attribute name.
Validation
Three mistakes are caught before the payload is built, so they surface as a
ValidationErroronKrigingParametersrather than a failed or partially applied job:target.attribute. A hand-writtenUpdateAttributeexpression carries no name, so it is only compared with other references.target.object— so an attribute taken from a different object would silently resolve to nothing, or to the wrong attribute. The originating object is remembered during validation and compared with the target, ignoring any?version=suffix. Attributes that carry no parent object cannot be checked and are left alone.valid, an integer one for thenum_*counts, and a floating-point one for the rest. A newly created attribute takes the diagnostic's type, so it is not checked.Results
The task returns every diagnostic key, with
nullfor the ones that were not requested. NewKrigingDiagnosticsResultandKrigingTargetResultmodels parse that, andKrigingResult.diagnosticsexposes only the diagnostics that were actually written, keyed by diagnostic name:They are also listed in the result summary. Because diagnostics are written onto the target object,
result.to_dataframe()returns them alongside the estimate.Other changes
attribute_spec()factored out of_validate_target_attributeintasks/common/source_target.pyand shared, so a diagnostic accepts the same typed attributes as a target does.KrigingDiagnosticsexported fromevo.compute.tasksandevo.compute.tasks.geostatistics.tests/test_tasks.pyfixtures build aKrigingTargetResultinstead of a bareTaskTarget, following the retypedKrigingResultModel.target.Backwards compatibility
No breaking change to the SDK's public surface —
diagnosticsis optional and defaults toNone, so existing kriging calls produce an identical payload.Testing
uv run --package evo-compute pytest packages/evo-compute/tests— 447 passed (34 new tests, plus 104 subtests, covering the accepted shorthands, the serialized payload, the parsed result, and the three validation rules).ruff checkandruff format --checkclean across the repository.jsonschema(Draft 2020-12) — no errors on either side.Documentation
packages/evo-compute/docs/examples/kriging.ipynb— new "Request Diagnostics" section.code-samples/geoscience-objects/running-kriging-compute/— the walkthrough now requests diagnostics, prints the attributes that were written, and includes them in the results DataFrame; the markdown documents the shorthands and lists all 16 diagnostics with their recommended names.The generated API reference under
mkdocs/is left to the documentation workflow.Checklist