Skip to content

Decouple geostatistics search neighborhoods and move Ellipsoid Pydantic schema to evo-objects - #416

Draft
amirabbas-jalali-bentley wants to merge 4 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:decouple-geostatistics-search-neighborhoods
Draft

amirabbas-jalali-bentley wants to merge 4 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:decouple-geostatistics-search-neighborhoods

Conversation

@amirabbas-jalali-bentley

Copy link
Copy Markdown
Contributor

Description

Follow-up to #415 addressing post-merge review feedback and decoupling geostatistics search neighborhood models and Ellipsoid wire schema handling into their owning packages/modules without task-specific blacklist validators.

Changes

  • Ellipsoid Pydantic schema ownership in evo-objects:
    • Implement Ellipsoid.from_dict(), __get_pydantic_core_schema__(), and __get_pydantic_json_schema__() directly on evo.objects.typed.types.Ellipsoid (next to Ellipsoid.to_dict()), using functools.singledispatch and compact keyword unpacking (EllipsoidRanges(**raw) and _build_rotation(**raw)).
    • Normalize default rotation on Ellipsoid so Ellipsoid.from_dict(ell.to_dict()) == ell holds even when rotation is omitted.
    • Bump evo-objects to 0.7.1 and require evo-objects[utils,blockmodels]>=0.7.1 in evo-compute.
  • Geostatistics search neighborhood hierarchy in evo-compute:
    • Move geostatistics search neighborhood models to evo.compute.tasks.geostatistics.search with two extra="forbid" tiers matching the compute task schemas:
      • SimpleSearchNeighborhood (ellipsoid, max_samples, min_samples) for BreakTiesParameters, ConSimParameters, ConditionalTurningBandsParameters, and SimulationReportParameters (also coercing compatible SearchNeighborhood instances that have no active sector/drillhole limits for backwards compatibility while rejecting active sector/drillhole limits via extra="forbid").
      • SearchNeighborhood(SimpleSearchNeighborhood) adding octant, quadrant, and drillhole controls (max_samples_per_drillhole, max_drillholes, min_drillholes, drillhole_limit_scope) for KrigingParameters, IDWParameters, KNNParameters, and DeclusteringParameters.
    • Keep backwards-compatible re-exports in evo.compute.tasks.common.search, evo.compute.tasks.common, evo.compute.tasks.geostatistics, and evo.compute.tasks.
    • Remove _reject_sector_and_drillhole_limits and _reject_kriging_only_drillhole_limits blacklist helpers, and use match self.drillhole_limit_scope: for sector quota calculation.
  • Test parametrization (@pytest.mark.parametrize):
    • Convert the SearchNeighborhood and geostatistics parameter serialization test suites from unittest.TestCase subTest loops to plain pytest test classes using @pytest.mark.parametrize.

Validation

  • uv run --locked --package evo-compute pytest packages/evo-compute/tests -q — passed (637 passed, 122 subtests passed).
  • uv run --locked --package evo-objects pytest packages/evo-objects/tests -q — passed (889 passed, 12 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.
  • MYPYPATH=packages/evo-compute/src:packages/evo-objects/src:packages/evo-sdk-common/src:packages/evo-blockmodels/src .venv/bin/mypy --namespace-packages --explicit-package-bases packages/evo-objects/src/evo/objects/typed/types.py packages/evo-compute/src/evo/compute/tasks/geostatistics/search.py packages/evo-compute/src/evo/compute/tasks/common/search.py — passed (0 issues).
  • uv lock --check — passed.
  • uv run --locked --no-sync pre-commit run --from-ref origin/main --to-ref HEAD — passed.
  • git --no-pager diff --check origin/main...HEAD — passed.

Checklist

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

- Implement Ellipsoid.from_dict(), __get_pydantic_core_schema__(), and __get_pydantic_json_schema__() on evo.objects.typed.types.Ellipsoid using singledispatch and compact keyword unpacking so Ellipsoid owns its wire serialization and schema directly.
- Bump evo-objects to 0.7.1 and require evo-objects>=0.7.1 in evo-compute.
- Move geostatistics search neighborhood models into evo.compute.tasks.geostatistics.search with SimpleSearchNeighborhood (ellipsoid, max_samples, min_samples) and SearchNeighborhood (octant, quadrant, and drillhole quotas), keeping backwards-compatible re-exports in evo.compute.tasks.common and evo.compute.tasks.
- Type simulation and break-ties task parameters with SimpleSearchNeighborhood (with extra='forbid') and estimation/declustering task parameters with SearchNeighborhood, removing task-specific _reject_* blacklist validators.
- Use match on drillhole_limit_scope for sector quota calculation and delegate Ellipsoid wire serialization and schema directly to evo-objects.
…lization tests

- Convert SearchNeighborhood and geostatistics task parameter serialization test suites from unittest.TestCase subTest loops to plain pytest classes using @pytest.mark.parametrize.
- Add coverage for SimpleSearchNeighborhood vs SearchNeighborhood schemas, canonical re-exports, and full drillhole limit support on IDW, KNN, and Declustering.
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