Skip to content

Commit

Permalink
Options arg in read_config_user_file now optional (#709)
Browse files Browse the repository at this point in the history
* Remove utils section (#697)

Moved the last script from esmvalcore/utils to ESMValTool

* Fixed bug in time weights calculation (#695)

* Fixed calculation of time weights

* Fixed failing FLAKE8 test

* Added more test for time weighting and fixed cube dimensions in test

* Avoid pytest version that crashes (#707)

* Suggested Documentation changes (#690)

Update documentation on relative diagnostics paths and preprocessor order.

Co-authored-by: Bouwe Andela <[email protected]>

* Options arg in read_config_user_file now optional

* Fix codacy warning

Co-authored-by: Bouwe Andela <[email protected]>
Co-authored-by: Manuel Schlund <[email protected]>
Co-authored-by: Steve Smith <[email protected]>
Co-authored-by: Bouwe Andela <[email protected]>
  • Loading branch information
5 people committed Jul 16, 2020
1 parent aaadc73 commit 8cd2031
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion esmvalcore/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_diagnostics():
DIAGNOSTICS_PATH = find_diagnostics()


def read_config_user_file(config_file, folder_name, options):
def read_config_user_file(config_file, folder_name, options=None):
"""Read config user file and store settings in a dictionary."""
config_file = os.path.abspath(
os.path.expandvars(os.path.expanduser(config_file)))
Expand All @@ -42,6 +42,8 @@ def read_config_user_file(config_file, folder_name, options):
with open(config_file, 'r') as file:
cfg = yaml.safe_load(file)

if options is None:
options = dict()
for key, value in options.items():
cfg[key] = value

Expand Down

0 comments on commit 8cd2031

Please sign in to comment.