Skip to content

Conversation

@HakonSohoel
Copy link
Contributor

@HakonSohoel HakonSohoel commented Apr 11, 2025

Issue
Resolves #9699

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • 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 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')

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 11, 2025

CodSpeed Performance Report

Merging #10610 will not alter performance

Comparing HakonSohoel:Add-documentation-for-forward_model_configuration-hook (d03c803) with main (3a0d7e6)

Summary

✅ 26 untouched benchmarks

@HakonSohoel HakonSohoel added the release-notes:documentation PR with only changes to documentation label Apr 15, 2025
@no_type_check
@hook_specification
def forward_model_configuration() -> PluginResponse[list[type[ForwardModelStepPlugin]]]:
def forward_model_configuration() -> PluginResponse[dict[str, dict[str, Any]]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this not caught by mypy?

Should it be in a separate commit with a separate message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created separate commit for this👌

},
}
``<config value>`` can be of any python type, but will be exported to env by calling ``str(<config value>)``.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also mention that config_key is case-insensitive (at least upper-cased, check tests)

Copy link
Contributor

Choose a reason for hiding this comment

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

Not really case-insensitive, but the environment variables are upper-case no matter what is put in the configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌

Forward model configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Forward model steps can be configured through the plugin system by using the ``forward_model_configuration`` hook:
Copy link
Contributor

Choose a reason for hiding this comment

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

This introduction should mention that the configuration is about specific environment variables that Ert will inject when starting the forward model.

@HakonSohoel HakonSohoel force-pushed the Add-documentation-for-forward_model_configuration-hook branch from 74cd050 to f9bd43e Compare May 7, 2025 11:59
}
* ``<config value>`` can be of any python type, but will be exported to env by calling ``str(<config value>)``.
* ``config_key`` will always exposed as upper case environment variables.
Copy link
Contributor

Choose a reason for hiding this comment

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

always be exposed

~~~~~~~~~~~~~~~~~~~~~~~~~~~

Forward model steps can be configured through the plugin system by using the ``forward_model_configuration`` hook.
For each forward model step name in the config dict, a set of configuration parameters spesific to that forward model can be spesified.
Copy link
Contributor

Choose a reason for hiding this comment

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

spesific -> specific
spesified -> specified

@HakonSohoel HakonSohoel force-pushed the Add-documentation-for-forward_model_configuration-hook branch from f9bd43e to d03c803 Compare May 7, 2025 12:04
Copy link
Contributor

@berland berland left a comment

Choose a reason for hiding this comment

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

yay!

@HakonSohoel HakonSohoel merged commit 55c4f3d into equinor:main May 7, 2025
27 checks passed
@HakonSohoel HakonSohoel deleted the Add-documentation-for-forward_model_configuration-hook branch May 7, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:documentation PR with only changes to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write documentation for forward model configuration

2 participants