-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into genericer-generic
- Loading branch information
Showing
10 changed files
with
50 additions
and
32 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
"""Climate indices computation package based on Xarray.""" | ||
from __future__ import annotations | ||
|
||
from importlib.resources import contents, path | ||
try: | ||
from importlib.resources import files as _files | ||
except ImportError: | ||
from importlib_resources import files as _files | ||
|
||
from xclim.core import units # noqa | ||
from xclim.core.indicator import build_indicator_module_from_yaml | ||
|
@@ -11,22 +14,18 @@ | |
|
||
__author__ = """Travis Logan""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.45.13-beta" | ||
__version__ = "0.45.14-beta" | ||
|
||
|
||
_module_data = _files("xclim.data") | ||
|
||
# Load official locales | ||
for filename in contents("xclim.data"): | ||
for filename in _module_data.glob("??.json"): | ||
# Only select <locale>.json and not <module>.<locale>.json | ||
if filename.endswith(".json") and filename.count(".") == 1: | ||
locale = filename.split(".")[0] | ||
with path("xclim.data", filename) as f: | ||
load_locale(f, locale) | ||
load_locale(filename, filename.stem) | ||
|
||
|
||
# Virtual modules creation: | ||
with path("xclim.data", "icclim.yml") as f: | ||
build_indicator_module_from_yaml(f.with_suffix(""), mode="raise") | ||
with path("xclim.data", "anuclim.yml") as f: | ||
build_indicator_module_from_yaml(f.with_suffix(""), mode="raise") | ||
with path("xclim.data", "cf.yml") as f: | ||
build_indicator_module_from_yaml(f.with_suffix(""), mode="raise") | ||
build_indicator_module_from_yaml(_module_data / "icclim", mode="raise") | ||
build_indicator_module_from_yaml(_module_data / "anuclim", mode="raise") | ||
build_indicator_module_from_yaml(_module_data / "cf", mode="raise") |
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
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