Skip to content

Add allowed_keyword arguments to fm_steps - #14104

Open
larsevj wants to merge 1 commit into
equinor:mainfrom
larsevj:add_allowed_keywords_fm_steps
Open

Add allowed_keyword arguments to fm_steps#14104
larsevj wants to merge 1 commit into
equinor:mainfrom
larsevj:add_allowed_keywords_fm_steps

Conversation

@larsevj

@larsevj larsevj commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Issue
Resolves #12281

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'just rapid-tests')

When applicable

  • When screenshots are changed: Review screenshot-PR in ert-testdata,
    merge screenshot-PR in ert-testdata before merging this PR.
  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Add backport label to latest release (format: 'backport release-branch-name')

@codecov-commenter

codecov-commenter commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.93%. Comparing base (40ae884) to head (d683bb7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14104      +/-   ##
==========================================
- Coverage   91.94%   91.93%   -0.02%     
==========================================
  Files         482      482              
  Lines       33493    33507      +14     
==========================================
+ Hits        30794    30803       +9     
- Misses       2699     2704       +5     
Flag Coverage Δ
cli-tests 36.25% <66.66%> (+0.02%) ⬆️
fuzz 44.24% <52.38%> (+<0.01%) ⬆️
gui-tests 58.61% <52.38%> (-0.01%) ⬇️
performance-and-unit-tests 80.80% <100.00%> (-0.01%) ⬇️
test 46.05% <19.04%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/ert/config/ert_config.py 95.89% <100.00%> (-0.12%) ⬇️
src/ert/config/forward_model_step.py 98.77% <100.00%> (+0.10%) ⬆️
...lugins/hook_implementations/forward_model_steps.py 94.66% <ø> (-0.11%) ⬇️

... and 1 file with indirect coverage changes

Comment thread src/ert/config/forward_model_step.py Outdated
arglist: The arglist with which the executable is invoked
required_keywords: Keywords that are required to be supplied by the user
allowed_keywords: Keywords that may be supplied by the user. If unset,
any keyword is allowed.

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.

Unset means None. Better to be precise about that, and maybe explicitly state that an empty list is not the same as "unset".

@larsevj
larsevj force-pushed the add_allowed_keywords_fm_steps branch from e1a2d23 to d683bb7 Compare August 7, 2026 13:27
@larsevj
larsevj marked this pull request as ready for review August 7, 2026 13:27
@larsevj
larsevj requested a balanced review from Copilot August 7, 2026 13:28

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.

Pull request overview

Adds opt-in validation for plugin forward-model keyword arguments.

Changes:

  • Introduces allowed_keywords and aggregated keyword validation.
  • Applies strict validation to reservoir simulator steps.
  • Adds tests, documentation, and updated serialization snapshots.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ert/config/forward_model_step.py Defines and validates allowed keywords.
src/ert/config/ert_config.py Runs allowed and required keyword checks.
src/ert/plugins/hook_implementations/forward_model_steps.py Restricts reservoir simulator keywords.
tests/ert/unit_tests/config/test_forward_model.py Tests keyword contracts and simulator validation.
docs/ert/getting_started/howto/plugin_system.rst Documents the plugin API.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_single_test_run_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_manual_update_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_manual_update_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_manual_update_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_evaluate_ensemble_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_evaluate_ensemble_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_evaluate_ensemble_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_esmda_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_smoother_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_ensemble_experiment_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/snake_oilsnake_oil.ert/snake_oil.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/poly_examplepoly.ert/poly.json Updates serialized schema snapshot.
tests/ert/unit_tests/run_models/snapshots/test_experiment_serialization/test_that_dumped_enif_matches_snapshot/heat_equationconfig.ert/config.json Updates serialized schema snapshot.

@larsevj larsevj changed the title Add initial try on allowed keywords Add allowed_keyword arguments to fm_steps Aug 7, 2026
@larsevj

larsevj commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

For flow and eclipse this would change a warning to a ConfigValidationError now.

@codspeed-hq

codspeed-hq Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing larsevj:add_allowed_keywords_fm_steps (d683bb7) with main (40ae884)

Open in CodSpeed

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.

Improve validation of forward_model_step arguments

4 participants