Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new possiblities for providing paramters. #1756

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

pat-schmitt
Copy link
Member

This PR introduces two new ways to define and provide parameters for the model (in addition to the current default of using cfg.PARAMS):

  1. Minimal params.cfg File: You can now pass a minimal params.cfg file to cfg.initialize. If some parameters are missing in this file, the defaults from the main params.cfg (available here) will be used automatically.
  2. New run_settings.yml File, which could contain:
  • Almost all parameters from params.cfg
  • Values of observations used during calibration or initialization
  • If any parameter is not included in 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 existing mb_calib logic but supports calibration for only a single flowline. For now, I’ve kept mb_calib for backward compatibility and enforce a selection between the two possibilities to avoid potential confusions. However, we could consider removing mb_calib in the future.

  • When using run_settings.yml, all diagnostics are saved both to gdir.add_diagnostics and the run_settings.yml file. Maybe one or the other is enough?

  • Tests added/passed

  • Fully documented

  • Entry in whats-new.rst

@pep8speaks
Copy link

Hello @pat-schmitt! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1899:22: E241 multiple spaces after ','

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.

2 participants