-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore behavior of
JobCalculation.get_option
returning default val…
…ue (#2013) Recently, the various methods to get `options` from a `JobCalculation`, the historically called `get_*` methods, would return a default value if the value was not explicitly set as an attribute. These methods were recently replaced by the generic `get_option` method and the `JobCalculation.options` dictionary, however, by default the `get_option` would only return a value if explicitly set. One would have to set the argument `only_actually_set` to `False` to get the default value specified in `JobCalculation.options`, if it is defined and not `None`. The business logic however, was always calling `get_option` with default argument while expecting the default to be returned when not explicitly set. In addition, certain options whose get methods used to return a default no longer had a default defined, e.g. `append_text`. Here we properly define defaults for the options that always had one as defined by the old explicit get methods. In addition, the default for the `only_actually_set` for `get_option` is changed to `False`. The internal code in general always expects to get defaults even when not set. Note that this required the code for `get_builder_restart` to be adapted as that expects only those options to be set that were actually defined by the user when constructing the `JobCalculation`.
- Loading branch information
Showing
3 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters