Add new possiblities for providing paramters. #1756
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.
This PR introduces two new ways to define and provide parameters for the model (in addition to the current default of using
cfg.PARAMS
):params.cfg
File: You can now pass a minimalparams.cfg
file tocfg.initialize
. If some parameters are missing in this file, the defaults from the mainparams.cfg
(available here) will be used automatically.run_settings.yml
File, which could contain:params.cfg
run_settings.yml
, it falls back to the current defaults.These additions required significant changes in sensitive parts of the model, particularly for the second point. However, tests appear to be passing. I have also included some tests for
run_settings.yml
. Not every aspect is tested yet, as adding more tests would overly expand the test suite.Points for Discussion
Each function currently opens the
run_settings.yml
file independently, instead of opening it once at the start of a workflow and passing it around. While this approach may slightly reduce performance (dynamic runs are not effected by this), it maintains the flexibility needed for setting up custom workflows.The new
run_settings.yml
works similarly to the existingmb_calib
logic but supports calibration for only a single flowline. For now, I’ve keptmb_calib
for backward compatibility and enforce a selection between the two possibilities to avoid potential confusions. However, we could consider removingmb_calib
in the future.When using
run_settings.yml
, all diagnostics are saved both togdir.add_diagnostics
and therun_settings.yml
file. Maybe one or the other is enough?Tests added/passed
Fully documented
Entry in
whats-new.rst