Skip to content
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

Add missing types in yaml schema #1600

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions xclim/core/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
units: <param units> # Only valid if "compute" points to a generic function
default : <param default>
description: <param description>
kind: <param 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.

Expand Down
3 changes: 2 additions & 1 deletion xclim/data/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down