The logic to manage indicators returning multiple outputs (such as rain_season), was changed a little and was completely broken anyway (oops). We now keep all variables produced and move from a DataArray (or a tuple of DataArray) to a Dataset much earlier, which makes everything else simpler to manage.
Does this PR introduce a breaking change?
I got rid of out_dict[key] = xr.merge(o for o in out if o.name in indicators) in compute_indicators, in favor of returning all variables. Previously, xs.compute_indicators(ds, indicators=[("rs", xclim.atmos.rain_season)]) would return an empty Dataset, because rs doesn't correspond to any of the outputs. Similarly, xs.compute_indicators(ds, indicators=[("rain_season_start", xclim.atmos.rain_season)]) would only return 1 out of 3 outputs produced by xclim. This is more a bugfix than a breaking change, but might still break some workflows.
Other information:
I did not add tests to aggregate.spatial_mean, since changes are coming soon to xESMF, including some bugfixes that will affect that function.
Pull Request Checklist:
number
) and pull request (:pull:number
) has been added.What kind of change does this PR introduce?
aggregate.py
andindicators.py
.PosixPath
to justPath
unstack_dates
where it failed for anything other than seasons.unstack_dates
related toxr.coding.times.contains_cftime_datetimes
in the newestxarray
: https://github.com/pydata/xarray/issues/7966rain_season
), was changed a little and was completely broken anyway (oops). We now keep all variables produced and move from aDataArray
(or a tuple ofDataArray
) to aDataset
much earlier, which makes everything else simpler to manage.Does this PR introduce a breaking change?
out_dict[key] = xr.merge(o for o in out if o.name in indicators)
incompute_indicators
, in favor of returning all variables. Previously,xs.compute_indicators(ds, indicators=[("rs", xclim.atmos.rain_season)])
would return an empty Dataset, becausers
doesn't correspond to any of the outputs. Similarly,xs.compute_indicators(ds, indicators=[("rain_season_start", xclim.atmos.rain_season)])
would only return 1 out of 3 outputs produced by xclim. This is more a bugfix than a breaking change, but might still break some workflows.Other information:
aggregate.spatial_mean
, since changes are coming soon to xESMF, including some bugfixes that will affect that function.