Skip to content

Align search neighborhood and kriging parameter names, add drillhole limit controls, and bump evo-compute to 0.1.1 - #415

Merged
amirabbas-jalali-bentley merged 5 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:align-search-neighborhood-and-drillhole-limits
Nov 18, 2026
Merged

amirabbas-jalali-bentley merged 5 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:align-search-neighborhood-and-drillhole-limits

Conversation

@amirabbas-jalali-bentley

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

Copy link
Copy Markdown
Contributor

Description

Align SearchNeighborhood and KrigingParameters in evo-compute with the geostatistics compute task schemas, add min_drillholes and drillhole_limit_scope support, make SearchNeighborhood.model_json_schema() accurately describe its wire payload, and bump evo-compute from 0.1.0 to 0.1.1 for release.

Changes

  • SearchNeighborhood drillhole controls & aliases:
    • Rename max_drillholes_per_estimate to max_drillholes (serializing as "max_drillholes" on the wire) while accepting max_drillholes_per_estimate via AliasChoices, rejecting conflicting alias values in mappings, and keeping a read-only .max_drillholes_per_estimate property for backwards compatibility.
    • Add min_drillholes (ge=0, with min_drillholes_per_estimate validation alias), omitted from the wire payload when None or 0 and serialized as "min_drillholes" when > 0.
    • Add drillhole_limit_scope (Literal["global", "quadrant", "octant"] | None = None), omitted from the wire payload when None or "global" and serialized when "quadrant" or "octant".
    • Enforce client-side cross-field validation: non-global drillhole_limit_scope requires max_samples_per_drillhole; min_drillholes <= max_drillholes; and min_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, and max_drillholes * max_samples_per_drillhole * scope_sectors).
  • SearchNeighborhood wire schema:
    • Annotate ellipsoid with PlainValidator, PlainSerializer, and WithJsonSchema (accepting Ellipsoid instances as well as wire-shaped {"ellipsoid_ranges": ..., "rotation": ...} mappings) and switch to a wrap serializer so SearchNeighborhood.model_json_schema() describes all wire properties directly.
  • Per-task neighborhood validation:
    • Keep simulation tasks (conditioned_simulator, conditional_turning_bands, simulation_report) and break_ties refusing all sector and drillhole limits.
    • Reject min_drillholes (> 0) and non-global drillhole_limit_scope on IDWParameters, KNNParameters, and DeclusteringParameters with a clear ValueError indicating they are currently supported only by Kriging.
  • KrigingParameters canonical parameter names:
    • Rename search and method to neighborhood and kriging_method with AliasChoices("neighborhood", "search") and AliasChoices("kriging_method", "method"), keeping .search and .method read-only properties for backwards compatibility and always serializing "neighborhood" and "kriging_method".
    • Update docstrings, MkDocs evo-compute index examples, and Kriging example notebooks to use neighborhood=....
  • Release bump:
    • Bump evo-compute from 0.1.0 to 0.1.1 in packages/evo-compute/pyproject.toml and uv.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 distribution 0.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 sources passed).
  • git --no-pager diff --check origin/main...HEAD — passed.

Checklist

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@amirabbas-jalali-bentley
amirabbas-jalali-bentley marked this pull request as ready for review November 17, 2026 21:41
@amirabbas-jalali-bentley
amirabbas-jalali-bentley requested a review from a team as a code owner November 17, 2026 21:47
@amirabbas-jalali-bentley amirabbas-jalali-bentley changed the title Align search neighborhood and kriging parameter names and add drillhole limit controls Align search neighborhood and kriging parameter names, add drillhole limit controls, and bump evo-compute to 0.0.8 Nov 17, 2026
- 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.
@amirabbas-jalali-bentley
amirabbas-jalali-bentley force-pushed the align-search-neighborhood-and-drillhole-limits branch from a6c68db to 5824002 Compare November 17, 2026 23:08
@amirabbas-jalali-bentley amirabbas-jalali-bentley changed the title Align search neighborhood and kriging parameter names, add drillhole limit controls, and bump evo-compute to 0.0.8 Align search neighborhood and kriging parameter names, add drillhole limit controls, and bump evo-compute to 0.1.1 Nov 17, 2026

@PaulCaygill-Seequent PaulCaygill-Seequent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@amirabbas-jalali-bentley

Copy link
Copy Markdown
Contributor Author

@PaulCaygill-Seequent Your suggestion was really good, I will address them all in separate PR
Thanks!

@amirabbas-jalali-bentley
amirabbas-jalali-bentley merged commit 64eb0cc into SeequentEvo:main Nov 18, 2026
16 checks passed
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.

5 participants