Skip to content

Fix tail extrapolation payloads for conditioned simulation and simulation report - #354

Merged
amirabbas-jalali-bentley merged 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:fix-tail-extrapolation-payloads
Sep 24, 2026
Merged

amirabbas-jalali-bentley merged 2 commits into
SeequentEvo:mainfrom
amirabbas-jalali-bentley:fix-tail-extrapolation-payloads

Conversation

@amirabbas-jalali-bentley

Copy link
Copy Markdown
Contributor

Description

The conditioned-simulator and simulation-report tasks declare two fields in their distribution parameter as required but nullable, with no default:

  • distribution.tail_extrapolation
  • distribution.tail_extrapolation.lower

So the key has to be present, but null is a valid value for it. TaskRunner serialises parameters with exclude_none=True, so whenever either field was left unset the key was dropped and the task rejected the job:

  • a distribution with weights but no tail extrapolation failed with 'tail_extrapolation' is a required property
  • a tail extrapolation with only an upper tail failed with 'lower' is a required property

There was no way around it from the calling side, since passing None explicitly makes no difference to exclude_none.

Changes

  • DistributionParams, SimulationReportDistribution and TailExtrapolationParams now always emit these keys, as null when unset. This is the same @model_serializer(mode="wrap") approach DeclusteringParameters already uses to keep power: null. Every other field is still omitted when it's None, and no other task is affected.
  • SimulationReportDistribution.tail_extrapolation was annotated as None, so a real tail extrapolation couldn't be passed to the simulation report at all. It now takes the same TailExtrapolationParams as the conditioned simulator, since both tasks accept the same shape.

I considered switching TaskRunner to exclude_unset=True instead, but it doesn't help on its own (a field the caller never set is still dropped), and it would stop sending the client-side defaults several tasks rely on, such as the kriging method and the conditioned simulator's defaults.

No breaking changes. Payloads that were already accepted are unchanged; only the ones that used to be rejected now carry the extra null keys. lower stays optional.

Testing

  • New tests pin the explicit nulls on the wire for both tasks, check that a real lower isn't overwritten, and check that the simulation report takes a real tail extrapolation. Four of the five fail without the fix.
  • Validated the resulting payloads against both tasks' JSON schemas: no distribution, a distribution without tail extrapolation, an upper tail only, and both tails are all accepted.
  • evo-compute tests: 418 passed. ruff check and ruff format --check are clean.

Checklist

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

…tion report

The conditioned-simulator and simulation-report tasks require the
distribution's tail_extrapolation key, and tail_extrapolation's lower key,
even though both accept null. TaskRunner serialises parameters with
exclude_none=True, so leaving either unset dropped the key and the task
rejected the job.

DistributionParams, SimulationReportDistribution and
TailExtrapolationParams now always emit those keys, as null when unset.

SimulationReportDistribution.tail_extrapolation was typed as None, so a
real tail extrapolation could not be supplied at all. It now takes the
same TailExtrapolationParams as the conditioned simulator.

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.

Copilot review overview

🟢 Approval recommended

The reviewed changes have regression coverage and no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes serialization of required nullable tail-extrapolation fields for conditioned simulation and simulation-report payloads.

Changes:

  • Preserves required null keys during serialization.
  • Enables tail-extrapolation parameters in simulation reports.
  • Adds regression tests and updates generated artifacts.
File Description
uv.lock Synchronizes the evo-objects workspace version.
packages/​evo-compute/​tests/​geostatistics/​test_simulation_report_tasks.py Tests simulation-report tail serialization.
packages/​evo-compute/​tests/​geostatistics/​test_conditioned_simulator_tasks.py Tests nullable and populated tail payloads.
packages/​evo-compute/​src/​evo/​compute/​tasks/​geostatistics/​simulation_report.py Adds tail-extrapolation support and null-preserving serialization.
packages/​evo-compute/​src/​evo/​compute/​tasks/​geostatistics/​conditioned_simulator.py Preserves required nullable distribution fields.
mkdocs/​site/​packages/​evo-compute/​typed-objects/​simulation-report/​SimulationReportDistribution.html Updates generated API documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions
github-actions Bot requested a review from a team as a code owner September 23, 2026 22:09

@GriffinBaxterSeequent GriffinBaxterSeequent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All good from a evo-python-sdk-maintainers perspective!

@amirabbas-jalali-bentley
amirabbas-jalali-bentley merged commit b541bd2 into SeequentEvo:main Sep 24, 2026
88 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.

4 participants