Repository navigation
Align search neighborhood and kriging parameter names, add drillhole limit controls, and bump evo-compute to 0.1.1 - #415
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking the geostatistics parameter and schema updates.
No open issues 🎉
What changed in this PR
This PR aligns evo-compute search neighborhood and kriging parameters with the geostatistics task schemas, while preserving legacy constructor names and read-only compatibility properties.
Changes:
- Adds drillhole minimums, limit scopes, cross-field validation, and task-specific restrictions.
- Uses canonical kriging parameter names and defines the ellipsoid wire schema and parsing.
- Expands regression tests and updates examples and API documentation.
| File | Description |
|---|---|
packages/evo-compute/tests/test_tasks.py |
Tests drillhole controls, aliases, bounds, and schema round-trips. |
packages/evo-compute/tests/geostatistics/test_simulation_report_tasks.py |
Extends unsupported-limit rejection tests. |
packages/evo-compute/tests/geostatistics/test_kriging_tasks.py |
Tests canonical names, legacy aliases, and drillhole serialization. |
packages/evo-compute/tests/geostatistics/test_knn_tasks.py |
Tests supported limits and rejection of kriging-only controls. |
packages/evo-compute/tests/geostatistics/test_idw_tasks.py |
Tests drillhole aliases, serialization, and restrictions. |
packages/evo-compute/tests/geostatistics/test_declustering_tasks.py |
Tests supported limits and rejection of kriging-only controls. |
packages/evo-compute/tests/geostatistics/test_conditioned_simulator_tasks.py |
Extends unsupported-limit rejection tests. |
packages/evo-compute/tests/geostatistics/test_conditional_turning_bands_tasks.py |
Extends unsupported-limit rejection tests. |
packages/evo-compute/tests/geostatistics/test_break_ties_tasks.py |
Tests disabled defaults and rejection of active drillhole limits. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/kriging.py |
Introduces canonical fields with legacy input aliases and properties. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/knn.py |
Rejects kriging-only drillhole controls. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/idw.py |
Rejects kriging-only drillhole controls. |
packages/evo-compute/src/evo/compute/tasks/geostatistics/declustering.py |
Rejects kriging-only drillhole controls. |
packages/evo-compute/src/evo/compute/tasks/common/search.py |
Adds drillhole controls, validation, ellipsoid parsing, and wire schema. |
packages/evo-compute/src/evo/compute/tasks/__init__.py |
Updates the run docstring example to use neighborhood. |
packages/evo-compute/docs/examples/kriging.ipynb |
Updates constructor arguments and the default-method comment. |
packages/evo-compute/docs/examples/kriging_multiple.ipynb |
Updates batch examples and default-method comments. |
mkdocs/site/packages/evo-compute/typed-objects/search/SearchNeighborhood.html |
Updates rendered search API documentation. |
mkdocs/site/packages/evo-compute/typed-objects/kriging/KrigingParameters.html |
Documents canonical fields and compatibility properties. |
mkdocs/site/packages/evo-compute/index.html |
Updates rendered examples to use neighborhood. |
mkdocs/docs/packages/evo-compute/index.md |
Updates source documentation examples to use neighborhood. |
Review effort: Balanced
- Rename max_drillholes_per_estimate to max_drillholes while accepting max_drillholes_per_estimate via AliasChoices, rejecting conflicting alias values, and preserving a read-only .max_drillholes_per_estimate property. - Add min_drillholes (and min_drillholes_per_estimate alias, omitted when None or 0) and drillhole_limit_scope (omitted when None or 'global'). - Enforce cross-field validation on SearchNeighborhood for non-global drillhole_limit_scope, drillhole bounds, and sample/sector ceilings. - Annotate ellipsoid with PlainValidator, PlainSerializer, and WithJsonSchema and use a wrap model serializer so SearchNeighborhood.model_json_schema() describes the wire payload accurately.
- Reject min_drillholes (> 0) and non-global drillhole_limit_scope on IDWParameters, KNNParameters, and DeclusteringParameters with a clear error indicating those options are only supported by Kriging. - Add coverage for Kriging drillhole limits, IDW/KNN/Declustering rejection of Kriging-only drillhole options, and simulation/break-ties rejection of all sector and drillhole limits.
- Rename KrigingParameters.search and KrigingParameters.method to neighborhood and kriging_method, accepting both canonical and legacy names via AliasChoices, preserving read-only .search and .method properties, and always serializing 'neighborhood' and 'kriging_method'. - Update docstrings, MkDocs index examples, and Kriging example notebooks to use canonical parameter names.
Prepare evo-compute 0.1.1 release in pyproject.toml and uv.lock.
a6c68db to
5824002
Compare
PaulCaygill-Seequent
left a comment
There was a problem hiding this comment.
Given the context of this PR as you've said to me directly, I will give this an approval.
I'm relying on the other reviewers to have thoroughly checked the individual component changes make sense as I personally do not have time nor context to review this with more depth.
I've reviewed this with an eye toward code clarity and maintainability, but nothing more than that. You will see some review comments that are not blocking your merge, but I would like addressed at some stage to improve the overall code quality of these sections of code.
|
@PaulCaygill-Seequent Your suggestion was really good, I will address them all in separate PR |
Description
Align
SearchNeighborhoodandKrigingParametersinevo-computewith the geostatistics compute task schemas, addmin_drillholesanddrillhole_limit_scopesupport, makeSearchNeighborhood.model_json_schema()accurately describe its wire payload, and bumpevo-computefrom0.1.0to0.1.1for release.Changes
SearchNeighborhooddrillhole controls & aliases:max_drillholes_per_estimatetomax_drillholes(serializing as"max_drillholes"on the wire) while acceptingmax_drillholes_per_estimateviaAliasChoices, rejecting conflicting alias values in mappings, and keeping a read-only.max_drillholes_per_estimateproperty for backwards compatibility.min_drillholes(ge=0, withmin_drillholes_per_estimatevalidation alias), omitted from the wire payload whenNoneor0and serialized as"min_drillholes"when> 0.drillhole_limit_scope(Literal["global", "quadrant", "octant"] | None = None), omitted from the wire payload whenNoneor"global"and serialized when"quadrant"or"octant".drillhole_limit_scoperequiresmax_samples_per_drillhole;min_drillholes <= max_drillholes; andmin_samples,min_drillholes, and required occupied sectors (8 - max_empty_octants,4 - max_empty_quadrants) cannot exceed enabled sample ceilings (max_samples,8 * max_samples_per_octant,4 * max_samples_per_quadrant, andmax_drillholes * max_samples_per_drillhole * scope_sectors).SearchNeighborhoodwire schema:ellipsoidwithPlainValidator,PlainSerializer, andWithJsonSchema(acceptingEllipsoidinstances as well as wire-shaped{"ellipsoid_ranges": ..., "rotation": ...}mappings) and switch to a wrap serializer soSearchNeighborhood.model_json_schema()describes all wire properties directly.conditioned_simulator,conditional_turning_bands,simulation_report) andbreak_tiesrefusing all sector and drillhole limits.min_drillholes(> 0) and non-globaldrillhole_limit_scopeonIDWParameters,KNNParameters, andDeclusteringParameterswith a clearValueErrorindicating they are currently supported only by Kriging.KrigingParameterscanonical parameter names:searchandmethodtoneighborhoodandkriging_methodwithAliasChoices("neighborhood", "search")andAliasChoices("kriging_method", "method"), keeping.searchand.methodread-only properties for backwards compatibility and always serializing"neighborhood"and"kriging_method".evo-computeindex examples, and Kriging example notebooks to useneighborhood=....evo-computefrom0.1.0to0.1.1inpackages/evo-compute/pyproject.tomlanduv.lock.Validation
uv run --locked --package evo-compute pytest packages/evo-compute/tests -q— passed (535 passed, 232 subtests passed).uv run --directory code-samples --group test pytest tests/test_notebooks.py -k "TestNotebookValidation and geostatistics" -q— passed (8 passed).uv run --only-dev ruff check— passed.uv run --only-dev ruff format --check— passed..venv/bin/mypy packages/evo-compute/src/evo/compute/tasks/common/search.py— passed (0 issues).uv build --package evo-compute— passed (wheel and source distribution0.1.1).uv lock --check— passed.uv run --locked --no-sync pre-commit run --from-ref origin/main --to-ref HEAD— passed (Check uv.lock sourcespassed).git --no-pager diff --check origin/main...HEAD— passed.Checklist