Skip to content

Commit

Permalink
better calendar options and doc
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Bourgault <[email protected]>
  • Loading branch information
coxipi and aulemahal authored Oct 17, 2024
1 parent f6ad3a6 commit d9f0065
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ New features and enhancements
* ``xclim.indices.run_length.runs_with_holes`` allows to input a condition that must be met for a run to start and a second condition that must be met for the run to stop. (:pull:`1778`).
* New generic compute function ``xclim.indices.generic.thresholded_events`` that finds events based on a threshold condition and returns basic stats for each. See also ``xclim.indices.run_length.find_events``. (:pull:`1778`).
* ``xclim.core.units.rate2amount`` and ``xclim.core.units.amount2rate`` can now also accept quantities (pint objects or strings), in which case the ``dim`` argument must be the ``time`` coordinate through which we can find the sampling rate. (:pull:`1778`).
* ``xclim.indices.stats.standardized_index`` now supports a weekly resampling frequency. Only "standard" calendar is supported for this mode. (:issue:`1892`, :pull:`1952`)
* ``xclim.indices.stats.standardized_index`` now supports a weekly resampling frequency. Only "standard" calendars using numpy's `datetime64` dtype are supported for this mode. (:issue:`1892`, :pull:`1952`)

Bug fixes
^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion tests/test_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def test_standardized_precipitation_index(
ds = ds.convert_calendar("366_day", missing=np.nan)
elif freq == "W":
# only standard calendar supported with freq="W"
ds = ds.convert_calendar("standard", missing=np.nan, align_on="year")
ds = ds.convert_calendar("standard", missing=np.nan, align_on="year", use_cftime=False)
pr = ds.pr.sel(time=slice("1998", "2000"))
pr_cal = ds.pr.sel(time=slice("1950", "1980"))
fitkwargs = {}
Expand Down
2 changes: 1 addition & 1 deletion xclim/indices/_agro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ def standardized_precipitation_index(
* Supported statistical distributions are: ["gamma", "fisk"], where "fisk" is scipy's implementation of
a log-logistic distribution
* Supported frequencies are daily ("D"), weekly ("W"), and monthly ("MS").
Weekly frequency will only work if the input array has a "standard" calendar.
Weekly frequency will only work if the input array has a "standard" (non-cftime) calendar.
* If `params` is given as input, it overrides the `cal_start`, `cal_end`, `freq` and `window`, `dist` and `method` options.
* "APP" method only supports two-parameter distributions. Parameter `loc` needs to be fixed to use method `APP`.
* The standardized index is bounded by ±8.21. 8.21 is the largest standardized index as constrained by the float64 precision in
Expand Down

0 comments on commit d9f0065

Please sign in to comment.