Repository navigation
Decouple geostatistics search neighborhoods and move Ellipsoid Pydantic schema to evo-objects - #416
Draft
amirabbas-jalali-bentley wants to merge 4 commits into
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #415 addressing post-merge review feedback and decoupling geostatistics search neighborhood models and
Ellipsoidwire schema handling into their owning packages/modules without task-specific blacklist validators.Changes
EllipsoidPydantic schema ownership inevo-objects:Ellipsoid.from_dict(),__get_pydantic_core_schema__(), and__get_pydantic_json_schema__()directly onevo.objects.typed.types.Ellipsoid(next toEllipsoid.to_dict()), usingfunctools.singledispatchand compact keyword unpacking (EllipsoidRanges(**raw)and_build_rotation(**raw)).EllipsoidsoEllipsoid.from_dict(ell.to_dict()) == ellholds even whenrotationis omitted.evo-objectsto0.7.1and requireevo-objects[utils,blockmodels]>=0.7.1inevo-compute.evo-compute:evo.compute.tasks.geostatistics.searchwith twoextra="forbid"tiers matching the compute task schemas:SimpleSearchNeighborhood(ellipsoid,max_samples,min_samples) forBreakTiesParameters,ConSimParameters,ConditionalTurningBandsParameters, andSimulationReportParameters(also coercing compatibleSearchNeighborhoodinstances that have no active sector/drillhole limits for backwards compatibility while rejecting active sector/drillhole limits viaextra="forbid").SearchNeighborhood(SimpleSearchNeighborhood)adding octant, quadrant, and drillhole controls (max_samples_per_drillhole,max_drillholes,min_drillholes,drillhole_limit_scope) forKrigingParameters,IDWParameters,KNNParameters, andDeclusteringParameters.evo.compute.tasks.common.search,evo.compute.tasks.common,evo.compute.tasks.geostatistics, andevo.compute.tasks._reject_sector_and_drillhole_limitsand_reject_kriging_only_drillhole_limitsblacklist helpers, and usematch self.drillhole_limit_scope:for sector quota calculation.@pytest.mark.parametrize):SearchNeighborhoodand geostatistics parameter serialization test suites fromunittest.TestCasesubTestloops 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