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 public Config.update_from_dirs() method #2538

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Oct 2, 2024

Description

While working on making ESMValTool with the new configuration (#2448) I noticed that we are missing a simple public function to update the configuration from one or more directories.

This PR adds that.

Related to #2371

Link to documentation: https://esmvaltool--2538.org.readthedocs.build/projects/ESMValCore/en/2538/api/esmvalcore.config.html#esmvalcore.config.Config.update_from_dirs


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added the config label Oct 2, 2024
@schlunma schlunma added this to the v2.12.0 milestone Oct 2, 2024
@schlunma schlunma self-assigned this Oct 2, 2024
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.91%. Comparing base (bc05a1c) to head (5cc9789).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2538      +/-   ##
==========================================
+ Coverage   94.90%   94.91%   +0.01%     
==========================================
  Files         251      251              
  Lines       14295    14301       +6     
==========================================
+ Hits        13566    13574       +8     
+ Misses        729      727       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noicee! Just one (possible offbeat) comment from me, can merge right after Manu bothers giving me an answer to that 🍺


"""
new_config_dict = self._get_config_dict_from_dirs(dirs)
merged_config_dict = dask.config.merge(self, new_config_dict)
Copy link
Contributor

@valeriupredoi valeriupredoi Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this throws a wobbly, do you want to catch and release that or filter it through our own custom exception? Just looked at both merge and update from Dask, and they're really basic, and do not account for any possible exception, so if there are exceptions, then those will be cryptic AF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants