Skip to content

Commit

Permalink
Merge branch 'main' into propmeas-combo
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal committed Oct 18, 2022
2 parents 710a4f0 + 5730955 commit b091f30
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"project_slug": "xscen",
"project_short_description": "A climate change scenario-building analysis framework, built with xclim/xarray.",
"pypi_username": "RondeauG",
"version": "0.4.1-beta",
"version": "0.4.2-beta",
"use_pytest": "y",
"use_black": "y",
"use_pypi_deployment_with_travis": "n",
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Juliet

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Possibility of excluding variables read from file from the catalog produced by ``parse_directory``. (:pull:`107`).
* New "timeout_cleanup" option for ``save_to_zarr``, which removes variables that were in the process of being written when receiving a ``TimeoutException``. (:pull:`106`).
* New ``scripting.skippable`` context, allowing the use of CTRL-C to skip code sections. (:pull:`106`)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.1-beta
current_version = 0.4.2-beta
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+).(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
test_suite="tests",
tests_require=["pytest", "pytest-cov"],
url="https://github.com/Ouranosinc/xscen",
version="0.4.1-beta",
version="0.4.2-beta",
zip_safe=False,
)
2 changes: 1 addition & 1 deletion xscen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

__author__ = """Gabriel Rondeau-Genesse"""
__email__ = "rondeau-genesse.gabriel@ouranos.ca"
__version__ = "0.4.1-beta"
__version__ = "0.4.2-beta"


# monkeypatch so that warnings.warn() doesn't mention itself
Expand Down
9 changes: 7 additions & 2 deletions xscen/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ def parse_directory(
Dictionary with mapping from parsed name to controlled names for each column.
May have an additionnal "attributes" entry which maps from attribute names in the files to
official column names. The attribute translation is done before the rest.
In the "variable" entry, if a name is mapped to None (null), that variable will not be listed in the catalog.
xr_open_kwargs: dict
If needed, arguments to send xr.open_dataset() when opening the file to read the attributes.
parallel_depth: int
Expand Down Expand Up @@ -1014,8 +1015,12 @@ def read_first_file(grp, cols):
# Variable can be a tuple, we still want to replace individual names through the cvs
df["variable"] = df.variable.apply(
lambda vs: vs
if isinstance(vs, str)
else tuple(cvs["variable"].get(v, v) for v in vs)
if isinstance(vs, str) or pd.isnull(vs)
else tuple(
cvs["variable"].get(v, v)
for v in vs
if cvs["variable"].get(v, v) is not None
)
)

# translate xrfreq into frequencies and vice-versa
Expand Down

0 comments on commit b091f30

Please sign in to comment.