-
Notifications
You must be signed in to change notification settings - Fork 44
Add esmvalcore.config module
#1769
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ad1ad77
Move configuration code from experimental module to config module
bouweandela 3adbb2d
Make esmvalcore.config module public
bouweandela 0b15dc6
Improve test coverage
bouweandela 004a687
Restore esmvalcore._config module so `esmvaltool data` command keeps β¦
bouweandela 484a8d3
Undo backward-incompatible change, deprecate instead
bouweandela e5578b0
Support older Python versions
bouweandela 3866e11
Improve deprecation documentation
bouweandela e2e2470
Address review comments and ensure backwards compatibility with ESMVaβ¦
bouweandela fe10968
Remove wrong type hint to see if that fixes the tests
bouweandela 3eed805
Address further review comments
bouweandela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .. _api_config: | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| The :py:mod:`~esmvalcore.experimental.config` module has been moved to :py:mod:`esmvalcore.config`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| .. _experimental_api: | ||
|
|
||
| Experimental API | ||
| ================ | ||
|
|
||
| This page describes the new ESMValCore API. | ||
| The experimental API module is available in the submodule ``esmvalcore.experimental``. | ||
| The API is under development, so use at your own risk! | ||
|
|
||
| .. toctree:: | ||
schlunma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| :maxdepth: 1 | ||
|
|
||
| esmvalcore.experimental.config | ||
| esmvalcore.experimental.recipe | ||
| esmvalcore.experimental.recipe_output | ||
| esmvalcore.experimental.recipe_metadata | ||
| esmvalcore.experimental.utils | ||
File renamed without changes.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,27 @@ | ||
| """ESMValTool configuration.""" | ||
| from ._config import ( | ||
| get_activity, | ||
| get_institutes, | ||
| get_project_config, | ||
| get_extra_facets, | ||
| load_config_developer, | ||
| read_config_developer_file, | ||
| read_config_user_file, | ||
| ) | ||
| from ._diagnostics import DIAGNOSTICS, TAGS | ||
| from ._logging import configure_logging | ||
| import warnings | ||
|
|
||
| __all__ = ( | ||
| 'read_config_user_file', | ||
| 'read_config_developer_file', | ||
| 'load_config_developer', | ||
| 'get_extra_facets', | ||
| 'get_project_config', | ||
| 'get_institutes', | ||
| 'get_activity', | ||
| 'DIAGNOSTICS', | ||
| 'TAGS', | ||
| from ..config import CFG | ||
| from ..config._logging import configure_logging | ||
| from ..exceptions import ESMValCoreDeprecationWarning | ||
|
|
||
| __all__ = [ | ||
| 'CFG', | ||
| 'configure_logging', | ||
| 'read_config_user_file', | ||
| ] | ||
|
|
||
| warnings.warn( | ||
| "The private module `esmvalcore._config` has been deprecated in " | ||
| "ESMValCore version 2.8.0 and is scheduled for removal in version 2.9.0. " | ||
| "Please use the public module `esmvalcore.config` instead.", | ||
| ESMValCoreDeprecationWarning, | ||
| ) | ||
|
|
||
|
|
||
| def read_config_user_file(config_file, folder_name, options=None): | ||
| """Read config user file and store settings in a dictionary.""" | ||
| CFG.load_from_file(config_file) | ||
| session = CFG.start_session(folder_name) | ||
| session.update(options) | ||
| cfg = session.to_config_user() | ||
| return cfg |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.