-
Notifications
You must be signed in to change notification settings - Fork 4
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 branch specific namelist settings #43
Conversation
This change allows for users to add branch specific namelist settings in the config file that get "patched" to the base namelist settings used for both branches. These additional settings are set by specifying the `patch` key in each realisation. Currently, this change supports the ability to add a `patch` to both realisations. Addresses issue #29
The user should not specify 'cable' in the top level of the branch patch dictionary. This is consistent with how science configurations are specified in site_configs.yaml. Add a full task setup test case that asserts the branch patch is written correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment but with impact on a few parts of the code and the tests.
benchcab/task.py
Outdated
# the user should not specify 'cable' in the top level of the patch dictionary | ||
self.patch_namelist_file({'cable': self.branch_patch}, root_dir=root_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to break if we change the namelist file to have more sections beyond cable
. Should we instead ask the input to be {'cable': {......}}
?
The current approach allows for an easier setup in the config file.
It is easy to modify the benchcab
code later on if we go that way but it also means we would introduce a breaking change and make previous config.yaml
files incompatible. Limiting reproducibility. And people would then have to learn the new format.
I think I would change now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think having to include {'cable': {......}}
in the patch is a good idea. Should we do the same for the science configurations for consistency? For example, in the site_configs.yaml
sci0: {
cable_user: {
GS_SWITCH: "medlyn",
FWSOIL_SWITCH: "Haverd2013"
}
}
would become
sci0: {
cable: {
cable_user: {
GS_SWITCH: "medlyn",
FWSOIL_SWITCH: "Haverd2013"
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we need the same in the science configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify `cable` in the top level of the patch dictionary. This prevents the code from breaking if we add more namelists beyond `cable` to the namelist file in the future. Addresses comment by @ccarouge #43 (comment)
This change allows for users to add branch specific namelist settings in the config file that get "patched" to the base namelist settings used for both branches. These additional settings are set by specifying an optional
patch
key in each realisation. Currently, this change supports the ability to add apatch
to both realisations.Addresses issue #29