From 2d812966b6a35317f6848a96f50274e0fd6e6111 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Mon, 15 Jan 2024 16:45:46 -0500 Subject: [PATCH 1/2] Add missing potential types in yml schema --- xclim/core/indicator.py | 2 ++ xclim/data/schema.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xclim/core/indicator.py b/xclim/core/indicator.py index 6590ab9a4..985598058 100644 --- a/xclim/core/indicator.py +++ b/xclim/core/indicator.py @@ -78,6 +78,8 @@ units: # Only valid if "compute" points to a generic function default : description: + kind: # Override the parameter kind. + # This is mostly useful for transforming an optional variable into a required one by passing ``kind: 0``. ... ... # and so on. diff --git a/xclim/data/schema.yml b/xclim/data/schema.yml index 97aed6791..668a24fb7 100644 --- a/xclim/data/schema.yml +++ b/xclim/data/schema.yml @@ -10,7 +10,7 @@ variables: map(include('variable'), key=regex(r'^[\w]+$'), required=False) indicator: abstract: str(required=False) allowed_periods: list(enum('A', 'Q', 'M', 'W'), required=False) - src_freq: list(str(), required=False) + src_freq: any(str(), list(str()), required=False) base: str(required=False) compute: str(required=False) input: map(str(), key=str(), required=False) @@ -32,6 +32,7 @@ parameter: default: any(str(), num(), bool(), null(), include('indexer'), required=False) choices: list(str(), required=False) units: str(required=False) + kind: int(required=False) indexer: drop: bool(required=False) From b9ef66aa66156f49cdf1487e108e662ad4326e8d Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Mon, 15 Jan 2024 18:27:20 -0500 Subject: [PATCH 2/2] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 416ae2c8f..16a53a418 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,7 +14,7 @@ Announcements New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * Added uncertainty partitioning method `lafferty_sriver` from Lafferty and Sriver (2023), which can partition uncertainty related to the downscaling method. (:issue:`1497`, :pull:`1529`). -* Validate YAML indicators description before trying to build module. (:issue:`1523`, :pull:`1560`). +* Validate YAML indicators description before trying to build module. (:issue:`1523`, :issue:`1595`, :pull:`1560`, :pull:`1596`, :pull:`1600`). * Support ``indexer`` keyword in YAML indicator description. (:issue:`1522`, :pull:`1561`). * New ``xclim.core.calendar.stack_periods`` and ``unstack_periods`` for performing ``rolling(time=...).construct(..., stride=...)`` but with non-uniform temporal periods like years or months. They replace ``xclim.sdba.processing.construct_moving_yearly_window`` and ``unpack_moving_yearly_window`` which are deprecated and will be removed in a future release.