diff --git a/CHANGES.rst b/CHANGES.rst index de9d0ba04..60b1a3bde 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -15,7 +15,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. diff --git a/xclim/core/indicator.py b/xclim/core/indicator.py index 1a8c26255..1bc57b63f 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)