coveralls: ## Pull Request Test Coverage Report for [Build 1851](https://coveralls.io/builds/30735548)

* **0** of **18**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
* **2** unchanged lines in **1** file lost coverage.
* Overall coverage decreased (**-0.3%**) to **75.732%**

---

|  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [xclim/sdba/adjustment.py](https://coveralls.io/builds/30735548/source?filename=xclim%2Fsdba%2Fadjustment.py#L12) | 0 | 18 | 0.0%
<!-- | **Total:** | **0** | **18** | **0.0%** | -->

|  Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [xclim/sdba/adjustment.py](https://coveralls.io/builds/30735548/source?filename=xclim%2Fsdba%2Fadjustment.py#L258) | 2 | 0% |
<!-- | **Total:** | **2** |  | -->

|  Totals | [![Coverage Status](https://coveralls.io/builds/30735548/badge)](https://coveralls.io/builds/30735548) |
| :-- | --: |
| Change from base [Build 1849](https://coveralls.io/builds/30734731): |  -0.3% |
| Covered Lines: | 2381 |
| Relevant Lines: | 3144 |

---
##### 💛  - [Coveralls](https://coveralls.io)

aulemahal: Merged fixes for QDM in this PR to save time. Dask-arrays needed a new version of `rank` so I replicated the xarray one but with an `apply_ufunc` that allows for dask parallelization. 
aulemahal: My bad, the fix to `xclim.sdba.utils.broadcast` did not fix  #449 for all cases, so I am reverting it for now.
Also, the new rank util partially fixes #448. However, it is not a great use as long as 449 is not fixed...
diff --git a/docs/sdba.rst b/docs/sdba.rst
index d25e699e..1ac5f555 100644
--- a/docs/sdba.rst
+++ b/docs/sdba.rst
@@ -2,18 +2,18 @@
 Bias adjustment and downscaling algorithms
 ==========================================
 
-`xarray` data structures allow for relatively straightforward implementations of simple bias-adjustment and downscaling algorithms documented in :ref:`bias-adjustment-algos`. Each algorithm is split into `train` and `adjust` components. The `train` function will compare two DataArrays `x` and `y`, and return a `Dataset` object storing the *transfer* information allowing to go from `x` to `y`. This dataset can then be used as an input to the `adjust` function to apply this information to `x`. `x` could be the same `DataArray` used for training, or another `DataArray` with similar characteristics.
+`xarray` data structures allow for relatively straightforward implementations of simple bias-adjustment and downscaling algorithms documented in :ref:`bias-adjustment-algos`. Each algorithm is split into `train` and `adjust` components. The `train` function will compare two DataArrays `x` and `y`, and create a dataset storing the *transfer* information allowing to go from `x` to `y`. This dataset, stored in the adjustment object, can then be used by the `adjust` method to apply this information to `x`. `x` could be the same `DataArray` used for training, or another `DataArray` with similar characteristics.
 
 For example, given a daily time series of observations `ref`, a model simulation over the observational period `hist` and a model simulation over a future period `sim`, we would apply a bias-adjustment method such as *detrended quantile mapping* (DQM) as::
 
   from xclim.sdba.adjustment import DetrendedQuantileMapping
   dqm = DetrendedQuantileMapping()
   dqm.train(ref, hist)
-  scen = dqm.predict(sim)
+  scen = dqm.adjust(sim)
 
 Most method can either be applied additively or multiplicatively. Also, most methods can be applied independently on different time groupings (monthly, seasonally) or according to the day of the year and a rolling window width.
 
-When transfer factors are applied in adjustment, they can be interpolated according to the time grouping. This helps avoid discontinuities in adjustment factors at the beginning of each season or month and is computationaly cheaper than computing adjustment factors for each day of the year.
+When transfer factors are applied in adjustment, they can be interpolated according to the time grouping. This helps avoid discontinuities in adjustment factors at the beginning of each season or month and is computationaly cheaper than computing adjustment factors for each day of the year. (Currently only implemented for monthly grouping)
 
 
 Application in multivariate settings
diff --git a/xclim/sdba/__init__.py b/xclim/sdba/__init__.py
index ac3a24d1..4c1d70d7 100644
--- a/xclim/sdba/__init__.py
+++ b/xclim/sdba/__init__.py
@@ -9,9 +9,9 @@ Adjustment algorithms all conform to the `train` - `adjust` scheme, formalized w
 Given a reference time series (ref), historical simulations (hist) and simulations to be adjusted (sim),
 any bias-adjustment method would be applied by first estimating the adjustment factors between the historical simulation and the observations series, and then applying these factors to `sim`, which could be a future simulation::
 
-  Adj = Adjustment(group="time.month", interp="linear")
+  Adj = Adjustment(group="time.month")
   Adj.train(ref, hist)
-  scen = Adj.adjust(sim)
+  scen = Adj.adjust(sim, interp="linear")
   Adj.ds.af  # adjustment factors.
 
 The `group` argument allows adjustment factors to be estimated independently for different periods: the full
@@ -37,13 +37,17 @@ A generic bias adjustment process is to layed out like:
 - preprocessing on `ref`, `hist` and `sim` (using methods in `xclim.sdba.processing` or `xclim.sdba.detrending`)
 - creating the adjustment object `Adj = Adjustment(**kwargs)` (from `xclim.sdba.adjustment`)
 - training `Adj.train(obs, sim)`
-- adjustment `scen = Adj.adjust(sim)`
+- adjustment with corresponding arguments `scen = Adj.adjust(sim, **kwargs)`
 - post-processing on `scen` (for example: re-trending)
 
-The train-adjust approach allows to inspect the trained adjustment object. The adjustment information is stored in
+The train-adjust approach allows to inspect the trained adjustment object. The trained information is stored in
 the underlying `Adj.ds` dataset and always has a `af` variable with the adjustment factors. Its layout and the
 other available variables vary between the different algorithm, refer to :ref:`bias-adjustment-algos`.
 
+Parameters needed by the training and the adjustment are saved to the `Adj.ds` dataset as a  `adj_params` attribute.
+Other parameters, those only needed by the adjustment are passed in the `adjust` call and written to the history attribute
+in the output scenario dataarray.
+
 Grouping
 ========
 
diff --git a/xclim/sdba/adjustment.py b/xclim/sdba/adjustment.py
index 60e96570..6aa1ccde 100644
--- a/xclim/sdba/adjustment.py
+++ b/xclim/sdba/adjustment.py
@@ -18,8 +18,10 @@ from .utils import equally_spaced_nodes
 from .utils import extrapolate_qm
 from .utils import get_correction
 from .utils import interp_on_quantiles
+from .utils import invert
 from .utils import map_cdf
 from .utils import MULTIPLICATIVE
+from .utils import rank
 from xclim.core.calendar import get_calendar
 from xclim.core.formatting import update_history
 
@@ -73,6 +75,8 @@ class BaseAdjustment(Parametrizable):
         ----------
         sim : DataArray
           Time series to be bias-adjusted, usually a model output.
+        kwargs :
+          Algorithm-specific keyword arguments, see class doc.
         """
         if not self.__trained:
             raise ValueError("train() must be called before adjusting.")
@@ -91,8 +95,9 @@ class BaseAdjustment(Parametrizable):
                 stacklevel=4,
             )
         scen = self._adjust(sim, **kwargs)
+        params = ", ".join([f"{k}={repr(v)}" for k, v in kwargs.items()])
         scen.attrs["history"] = update_history(
-            f"Bias-adjusted with method {str(self)}", sim
+            f"Bias-adjusted with {str(self)}.adjust(sim, {params})", sim
         )
         return scen
 
@@ -127,17 +132,22 @@ class EmpiricalQuantileMapping(BaseAdjustment):
 
     Parameters
     ----------
+    At init:
+
     nquantiles : int
       The number of quantiles to use. Two endpoints at 1e-6 and 1 - 1e-6 will be added.
     kind : {'+', '*'}
       The adjustment kind, either additive or multiplicative.
-    interp : {'nearest', 'linear', 'cubic'}
-      The interpolation method to use then interpolating the adjustment factors.
-    extrapolation : {'constant', 'nan'}
-      The type of extrapolation to use. See :py:func:`xclim.sdba.utils.extrapolate_qm` for details.
     group : Union[str, Grouper]
       The grouping information. See :py:class:`xclim.sdba.base.Grouper` for details.
 
+    In adjust:
+
+    interp : {'nearest', 'linear', 'cubic'}
+      The interpolation method to use when interpolating the adjustment factors. Defaults to "nearset".
+    extrapolation : {'constant', 'nan'}
+      The type of extrapolation to use. See :py:func:`xclim.sdba.utils.extrapolate_qm` for details. Defaults to "constant".
+
     References
     ----------
     Dequé, M. (2007). Frequency of precipitation and temperature extremes over France in an anthropogenic scenario: Model results and statistical correction according to observed values. Global and Planetary Change, 57(1–2), 16–26. https://doi.org/10.1016/j.gloplacha.2006.11.030
@@ -149,16 +159,10 @@ class EmpiricalQuantileMapping(BaseAdjustment):
         *,
         nquantiles: int = 20,
         kind: str = ADDITIVE,
-        interp: str = "nearest",
-        extrapolation: str = "constant",
         group: Union[str, Grouper] = "time",
     ):
         super().__init__(
-            nquantiles=nquantiles,
-            kind=kind,
-            interp=interp,
-            extrapolation=extrapolation,
-            group=group,
+            nquantiles=nquantiles, kind=kind, group=group,
         )
 
     def _train(self, ref, hist):
@@ -182,11 +186,9 @@ class EmpiricalQuantileMapping(BaseAdjustment):
         )
         self._make_dataset(af=af, hist_q=hist_q)
 
-    def _adjust(self, sim):
-        af, hist_q = extrapolate_qm(
-            self.ds.af, self.ds.hist_q, method=self.extrapolation
-        )
-        af = interp_on_quantiles(sim, hist_q, af, group=self.group, method=self.interp)
+    def _adjust(self, sim, interp="nearest", extrapolation="constant"):
+        af, hist_q = extrapolate_qm(self.ds.af, self.ds.hist_q, method=extrapolation)
+        af = interp_on_quantiles(sim, hist_q, af, group=self.group, method=interp)
 
         return apply_correction(sim, af, self.kind)
 
@@ -199,9 +201,12 @@ class DetrendedQuantileMapping(EmpiricalQuantileMapping):
     1. A scaling factor that would make the mean of `hist` match the mean of `ref` is computed.
     2. `ref` and `hist` are normalized by removing the group-wise mean.
     3. Adjustment factors are computed between the quantiles of the normalized `ref` and `hist`.
-    4. `sim` is corrected by the scaling factor then detrended using a linear fit.
+    4. `sim` is corrected by the scaling factor, normalized by the group-wise mean and then detrended using a linear fit.*
     5. Values of detrended `sim` are matched to the corresponding quantiles of normalized `hist` and corrected accordingly.
-    6. The trend is put back on the result.
+    6. The group-wise mean and trend are put back on the result.*
+
+    * Steps 4 and 6 include a group-wise normalization to overcome the fact that detrending is not made group-wise.
+    A future release of xclim will have grouped detrending and not require this extra step any more.
 
     .. math::
 
@@ -210,6 +215,26 @@ class DetrendedQuantileMapping(EmpiricalQuantileMapping):
     where :math:`F` is the cumulative distribution function (CDF) and :math:`\overline{xyz}` is the linear trend of the data.
     This equation is valid for multiplicative adjustment. Based on the DQM method of [Cannon2015]_.
 
+    Parameters
+    ----------
+    At init:
+
+    nquantiles : int
+      The number of quantiles to use. Two endpoints at 1e-6 and 1 - 1e-6 will be added.
+    kind : {'+', '*'}
+      The adjustment kind, either additive or multiplicative.
+    group : Union[str, Grouper]
+      The grouping information. See :py:class:`xclim.sdba.base.Grouper` for details.
+
+    In adjust:
+
+    interp : {'nearest', 'linear', 'cubic'}
+      The interpolation method to use when interpolating the adjustment factors. Defaults to "nearest".
+    detrend : int or BaseDetrend instance
+      The method to use when detrending. If an int is passed, it is understood as a PolyDetrend (polynomial detrending) degree. Defaults to 1 (linear detrending)
+    extrapolation : {'constant', 'nan'}
+      The type of extrapolation to use. See :py:func:`xclim.sdba.utils.extrapolate_qm` for details. Defaults to "constant".
+
     References
     ----------
     .. [Cannon2015] Cannon, A. J., Sobie, S. R., & Murdock, T. Q. (2015). Bias correction of GCM precipitation by quantile mapping: How well do methods preserve changes in quantiles and extremes? Journal of Climate, 28(17), 6938–6959. https://doi.org/10.1175/JCLI-D-14-00754.1
@@ -228,16 +253,46 @@ class DetrendedQuantileMapping(EmpiricalQuantileMapping):
             description="Scaling factor making the mean of hist match the one of hist.",
         )
 
-    def _adjust(self, sim, degree=0):
+    def _adjust(self, sim, interp="nearest", extrapolation="constant", detrend=1):
+        # Apply preliminary scaling from obs to hist
         sim = apply_correction(
             sim,
-            broadcast(self.ds.scaling, sim, group=self.group, interp=self.interp),
+            broadcast(self.ds.scaling, sim, group=self.group, interp=interp),
             self.kind,
         )
-        sim_fit = PolyDetrend(degree=degree, kind=self.kind).fit(sim)
-        sim_detrended = sim_fit.detrend(sim)
-        scen_detrended = super()._adjust(sim_detrended)
-        scen = sim_fit.retrend(scen_detrended)
+
+        # Normalize sim group-wise
+        # This group-wise pre normalization + reapplication further down
+        # is to circumvent #442 (detrending is not groupwise)
+        mu_sim = self.group.apply("mean", sim)
+        sim_norm = apply_correction(
+            sim,
+            broadcast(
+                invert(mu_sim, kind=self.kind), sim, group=self.group, interp=interp,
+            ),
+            kind=self.kind,
+        )
+
+        # Find trend on sim (for debugging purpose, the detrending is overridable)
+        if isinstance(detrend, int):
+            detrend = PolyDetrend(degree=detrend, kind=self.kind)
+
+        sim_fit = detrend.fit(sim_norm)
+        sim_detrended = sim_fit.detrend(sim_norm)
+
+        # Adjust using `EmpiricalQuantileMapping.adjust`
+        scen_detrended = super()._adjust(
+            sim_detrended, extrapolation=extrapolation, interp=interp
+        )
+        # Retrend
+        scen_norm = sim_fit.retrend(scen_detrended)
+
+        # # Reapply-mean
+        scen = apply_correction(
+            scen_norm,
+            broadcast(mu_sim, sim, group=self.group, interp=interp),
+            kind=self.kind,
+        )
         return scen
 
 
@@ -254,17 +309,35 @@ class QuantileDeltaMapping(EmpiricalQuantileMapping):
     where :math:`F` is the cumulative distribution function (CDF). This equation is valid for multiplicative adjustment.
     The algorithm is based on the "QDM" method of [Cannon2015]_.
 
+    Parameters
+    ----------
+    At init:
+
+    nquantiles : int
+      The number of quantiles to use. Two endpoints at 1e-6 and 1 - 1e-6 will be added.
+    kind : {'+', '*'}
+      The adjustment kind, either additive or multiplicative.
+    group : Union[str, Grouper]
+      The grouping information. See :py:class:`xclim.sdba.base.Grouper` for details.
+
+    In adjust:
+
+    interp : {'nearest', 'linear', 'cubic'}
+      The interpolation method to use when interpolating the adjustment factors. Defaults to "nearest".
+    extrapolation : {'constant', 'nan'}
+      The type of extrapolation to use. See :py:func:`xclim.sdba.utils.extrapolate_qm` for details. Defaults to "constant".
+
     References
     ----------
     .. [Cannon2015] Cannon, A. J., Sobie, S. R., & Murdock, T. Q. (2015). Bias correction of GCM precipitation by quantile mapping: How well do methods preserve changes in quantiles and extremes? Journal of Climate, 28(17), 6938–6959. https://doi.org/10.1175/JCLI-D-14-00754.1
     """
 
-    def _adjust(self, sim):
-        af, _ = extrapolate_qm(self.ds.af, self.ds.hist_q, method=self.extrapolation)
+    def _adjust(self, sim, interp="nearest", extrapolation="constant"):
+        af, _ = extrapolate_qm(self.ds.af, self.ds.hist_q, method=extrapolation)
 
-        sim_q = self.group.apply(xr.DataArray.rank, sim, main_only=True, pct=True)
+        sim_q = self.group.apply(rank, sim, main_only=True, pct=True)
         sel = {"quantiles": sim_q}
-        af = broadcast(af, sim, group=self.group, interp=self.interp, sel=sel)
+        af = broadcast(af, sim, group=self.group, interp=interp, sel=sel)
 
         return apply_correction(sim, af, self.kind)
 
@@ -295,12 +368,17 @@ class LOCI(BaseAdjustment):
 
     Parameters
     ----------
+    At init:
+
     group : Union[str, Grouper]
       The grouping information. See :py:class:`xclim.sdba.base.Grouper` for details.
     thresh : float
       The threshold in `ref` above which the values are scaled.
+
+    In adjust:
+
     interp : {'nearest', 'linear', 'cubic'}
-      The interpolation method to use then interpolating the adjustment factors.
+      The interpolation method to use then interpolating the adjustment factors. Defaults to "linear".
 
     References
     ----------
@@ -308,14 +386,8 @@ class LOCI(BaseAdjustment):
     """
 
     @parse_group
-    def __init__(
-        self,
-        *,
-        group: Union[str, Grouper] = "time",
-        thresh: float = None,
-        interp: str = "linear",
-    ):
-        super().__init__(group=group, thresh=thresh, interp=interp)
+    def __init__(self, *, group: Union[str, Grouper] = "time", thresh: float = None):
+        super().__init__(group=group, thresh=thresh)
 
     def _train(self, ref, hist):
         s_thresh = map_cdf(hist, ref, self.thresh, group=self.group).isel(
@@ -335,9 +407,9 @@ class LOCI(BaseAdjustment):
         s_thresh.attrs.update(long_name="Threshold over modeled data")
         self._make_dataset(hist_thresh=s_thresh, ref_thresh=self.thresh, af=af)
 
-    def _adjust(self, sim):
-        sth = broadcast(self.ds.hist_thresh, sim, group=self.group, interp=self.interp)
-        factor = broadcast(self.ds.af, sim, group=self.group, interp=self.interp)
+    def _adjust(self, sim, interp="linear"):
+        sth = broadcast(self.ds.hist_thresh, sim, group=self.group, interp=interp)
+        factor = broadcast(self.ds.af, sim, group=self.group, interp=interp)
         with xr.set_options(keep_attrs=True):
             scen = (factor * (sim - sth) + self.ds.ref_thresh).clip(min=0)
         return scen
@@ -351,17 +423,22 @@ class Scaling(BaseAdjustment):
 
     Parameters
     ----------
+    At init:
+
     group : Union[str, Grouper]
       The grouping information. See :py:class:`xclim.sdba.base.Grouper` for details.
     kind : {'+', '*'}
       The adjustment kind, either additive or multiplicative.
+
+    In adjust:
+
     interp : {'nearest', 'linear', 'cubic'}
-      The interpolation method to use then interpolating the adjustment factors.
+      The interpolation method to use then interpolating the adjustment factors. Defaults to "nearest".
     """
 
     @parse_group
-    def __init__(self, *, group="time", kind=ADDITIVE, interp="nearest"):
-        super().__init__(group=group, kind=kind, interp=interp)
+    def __init__(self, *, group="time", kind=ADDITIVE):
+        super().__init__(group=group, kind=kind)
 
     def _train(self, ref, hist):
         mean_hist = self.group.apply("mean", hist)
@@ -370,6 +447,6 @@ class Scaling(BaseAdjustment):
         af.attrs.update(long_name="Scaling adjustment factors")
         self._make_dataset(af=af)
 
-    def _adjust(self, sim):
-        factor = broadcast(self.ds.af, sim, group=self.group, interp=self.interp)
+    def _adjust(self, sim, interp="nearest"):
+        factor = broadcast(self.ds.af, sim, group=self.group, interp=interp)
         return apply_correction(sim, factor, self.kind)
diff --git a/xclim/sdba/utils.py b/xclim/sdba/utils.py
index ad7d05fd..5bdc3ab7 100644
--- a/xclim/sdba/utils.py
+++ b/xclim/sdba/utils.py
@@ -4,6 +4,7 @@ from typing import Sequence
 from typing import Union
 from warnings import warn
 
+import bottleneck as bn
 import numpy as np
 import xarray as xr
 from boltons.funcutils import wraps
@@ -211,6 +212,7 @@ def broadcast(
                 warn(
                     "Broadcasting operations in multiple dimensions can only be done with linear and nearest-neighbor interpolation, not cubic. Using linear."
                 )
+
             grouped = grouped.interp(sel, method=interp)
 
         for var in sel.keys():
@@ -462,3 +464,47 @@ def interp_on_quantiles(
         dask="parallelized",
         output_dtypes=[np.float],
     )
+
+
+def rank(da, dim="time", pct=False):
+    """Ranks data.
+
+    Replicates `xr.DataArray.rank` but with support for dask-stored data. Xarray's docstring is below:
+
+    Equal values are assigned a rank that is the average of the ranks that
+    would have been otherwise assigned to all of the values within that
+    set.  Ranks begin at 1, not 0. If pct, computes percentage ranks.
+
+    NaNs in the input array are returned as NaNs.
+
+    The `bottleneck` library is required.
+
+    Parameters
+    ----------
+    dim : hashable
+        Dimension over which to compute rank.
+    pct : bool, optional
+        If True, compute percentage ranks, otherwise compute integer ranks.
+
+    Returns
+    -------
+    ranked : DataArray
+        DataArray with the same coordinates and dtype 'float64'.
+    """
+
+    def _nanrank(data):
+        func = bn.nanrankdata if data.dtype.kind == "f" else bn.rankdata
+        ranked = func(data, axis=-1)
+        if pct:
+            count = np.sum(~np.isnan(data), axis=-1, keepdims=True)
+            ranked /= count
+        return ranked
+
+    return xr.apply_ufunc(
+        _nanrank,
+        da,
+        input_core_dims=[[dim]],
+        output_core_dims=[[dim]],
+        dask="parallelized",
+        output_dtypes=[da.dtype],
+    )

DetrendedQuantileMapping only applies the last correction factor
* xclim version: '0.16.1-beta' (master, as of 2020-05-08)
* Python version: 3.8.2
* Operating System: Linux

### Description
The figure below is the daily average : `plt.plot(data.groupby("time.dayofyear").mean("time").values)`. The black line is my OBS data, the blue line is my RAW data, the green line is the result of EmpiricalQQMapping and the orange line is the result of DetrendedQuantileMapping.

![image](https://user-images.githubusercontent.com/38501935/81433867-41b59400-9133-11ea-8adf-b3be4e38fa67.png)

These are the options I used to create the orange line:
```
group_month_nowindow = xclim.sdba.utils.Grouper('time.month')
QQ_m_nw_ni = xclim.sdba.adjustment.DetrendedQuantileMapping(nquantiles=50, kind='+', group=group_month_nowindow, extrapolation='constant')
QQ_m_nw_ni.train(obs, hist)
qq_m_nw_ni = QQ_m_nw_ni.adjust(hist, degree=3)
```

And this is `QQ_m_nw_ni.ds.af.plot.contourf()`
![image](https://user-images.githubusercontent.com/38501935/81434207-d3250600-9133-11ea-9934-0f0d2e31771a.png)

The huge jump in May leads me to believe that the correction factor associated to the last quantile is what is being applied for the whole distribution.

### Additional Information
In `xclim.sdba.adjustment` and `_adjust` (line 230), I added the line with `+269` (which is roughly the annual average) :

```
sim = apply_correction(sim,
            broadcast(self.ds.scaling, sim, group=self.group, interp=self.interp),
            self.kind,
        )
        sim_fit = PolyDetrend(degree=degree, kind=self.kind).fit(sim)
        sim_detrended = sim_fit.detrend(sim)
        sim_detrended.values = sim_detrended.values + 269
        scen_detrended = super()._adjust(sim_detrended)
        scen = sim_fit.retrend(scen_detrended)
        scen.values = scen.values - 269  # I need to remove that +269
```
With that additional line, I don't have the bug. This leads me to believe that this is a discrepancy between `sim`, which is centered around 269°K, and `sim_detrended`, which is normalized and centered around 0.



diff --git a/tests/test_sdba/test_adjustment.py b/tests/test_sdba/test_adjustment.py
index 2b802763..ac54ae4e 100644
--- a/tests/test_sdba/test_adjustment.py
+++ b/tests/test_sdba/test_adjustment.py
@@ -1,5 +1,6 @@
 import numpy as np
 import pytest
+import xarray as xr
 from scipy.stats import norm
 from scipy.stats import uniform
 
@@ -40,7 +41,7 @@ class TestLoci:
         np.testing.assert_array_almost_equal(p, ref, dec)
 
         assert "history" in p.attrs
-        assert "Bias-adjusted with method" in p.attrs["history"]
+        assert "Bias-adjusted with LOCI(" in p.attrs["history"]
 
 
 class TestScaling:
@@ -108,11 +109,9 @@ class TestDQM:
         hist = sim = series(x, name)
         ref = series(y, name)
 
-        DQM = DetrendedQuantileMapping(
-            kind=kind, group="time", nquantiles=50, interp="linear"
-        )
+        DQM = DetrendedQuantileMapping(kind=kind, group="time", nquantiles=50,)
         DQM.train(ref, hist)
-        p = DQM.adjust(sim)
+        p = DQM.adjust(sim, interp="linear")
 
         q = DQM.ds.quantiles
         ex = apply_correction(xd.ppf(q), invert(xd.mean(), kind), kind)
@@ -132,7 +131,7 @@ class TestDQM:
         sim2 = apply_correction(sim, ff, kind)
         ref2 = apply_correction(ref, ff, kind)
 
-        p2 = DQM.adjust(sim2)
+        p2 = DQM.adjust(sim2, interp="linear")
 
         np.testing.assert_array_almost_equal(p2[middle], ref2[middle], 1)
 
@@ -142,7 +141,7 @@ class TestDQM:
         )
         sim3 = apply_correction(sim, trend, kind)
         ref3 = apply_correction(ref, trend, kind)
-        p3 = DQM.adjust(sim3)
+        p3 = DQM.adjust(sim3, interp="linear")
         np.testing.assert_array_almost_equal(p3[middle], ref3[middle], 1)
 
     @pytest.mark.parametrize("kind,name", [(ADDITIVE, "tas"), (MULTIPLICATIVE, "pr")])
@@ -201,6 +200,17 @@ class TestDQM:
         np.testing.assert_almost_equal(p.mean(), 41.6, 0)
         np.testing.assert_almost_equal(p.std(), 15.0, 0)
 
+    def test_group_norm(self, tas_series):
+        x = np.arange(365)
+        ref = tas_series(273 - 10 * np.cos(2 * np.pi * x / 365), start="2001-01-01")
+        hist = sim = tas_series(
+            273 - 8 * np.cos(2 * np.pi * x / 365), start="2001-01-01"
+        )
+        DQM = DetrendedQuantileMapping(group="time.month")
+        DQM.train(ref, hist)
+        scen = DQM.adjust(sim, interp="linear")
+        xr.testing.assert_allclose(ref, scen, rtol=1.5e-4)
+
 
 class TestQDM:
     @pytest.mark.parametrize("kind,name", [(ADDITIVE, "tas"), (MULTIPLICATIVE, "pr")])
@@ -224,11 +234,9 @@ class TestQDM:
         hist = sim = series(x, name)
         ref = series(y, name)
 
-        QDM = QuantileDeltaMapping(
-            kind=kind, group="time", nquantiles=10, interp="linear"
-        )
+        QDM = QuantileDeltaMapping(kind=kind, group="time", nquantiles=10,)
         QDM.train(ref, hist)
-        p = QDM.adjust(sim)
+        p = QDM.adjust(sim, interp="linear")
 
         q = QDM.ds.coords["quantiles"]
         expected = get_correction(xd.ppf(q), yd.ppf(q), kind)
@@ -241,8 +249,12 @@ class TestQDM:
         middle = (u > 1e-2) * (u < 0.99)
         np.testing.assert_array_almost_equal(p[middle], ref[middle], 1)
 
+    @pytest.mark.parametrize("use_dask", [True, False])
     @pytest.mark.parametrize("kind,name", [(ADDITIVE, "tas"), (MULTIPLICATIVE, "pr")])
-    def test_mon_U(self, mon_series, series, mon_triangular, kind, name):
+    @pytest.mark.parametrize("add_dims", [True, False])
+    def test_mon_U(
+        self, mon_series, series, mon_triangular, add_dims, kind, name, use_dask
+    ):
         """
         Train on
         hist: U
@@ -263,6 +275,15 @@ class TestQDM:
 
         # Test train
         hist = sim = series(x, name)
+        if use_dask:
+            sim = sim.chunk({"time": -1})
+        if add_dims:
+            hist = hist.expand_dims(site=[0, 1, 2, 3, 4])
+            sim = sim.expand_dims(site=[0, 1, 2, 3, 4])
+            sel = {"site": 0}
+        else:
+            sel = {}
+
         ref = mon_series(y, name)
 
         QDM = QuantileDeltaMapping(kind=kind, group="time.month", nquantiles=40)
@@ -275,10 +296,12 @@ class TestQDM:
         expected = apply_correction(
             mon_triangular[:, np.newaxis], expected[np.newaxis, :], kind
         )
-        np.testing.assert_array_almost_equal(QDM.ds.af.sel(quantiles=q), expected, 1)
+        np.testing.assert_array_almost_equal(
+            QDM.ds.af.sel(quantiles=q, **sel), expected, 1
+        )
 
         # Test predict
-        np.testing.assert_array_almost_equal(p, ref, 1)
+        np.testing.assert_array_almost_equal(p.isel(**sel), ref, 1)
 
     def test_cannon(self, cannon_2015_dist, cannon_2015_rvs):
         ref, hist, sim = cannon_2015_rvs(15000, random=False)
@@ -326,11 +349,9 @@ class TestQM:
         # Test train
         hist = sim = series(x, name)
         ref = series(y, name)
-        QM = EmpiricalQuantileMapping(
-            kind=kind, group="time", nquantiles=50, interp="linear"
-        )
+        QM = EmpiricalQuantileMapping(kind=kind, group="time", nquantiles=50,)
         QM.train(ref, hist)
-        p = QM.adjust(sim)
+        p = QM.adjust(sim, interp="linear")
 
         q = QM.ds.coords["quantiles"]
         expected = get_correction(xd.ppf(q), yd.ppf(q), kind)
diff --git a/tests/test_sdba/test_utils.py b/tests/test_sdba/test_utils.py
index 6690fd02..db822a1e 100644
--- a/tests/test_sdba/test_utils.py
+++ b/tests/test_sdba/test_utils.py
@@ -109,3 +109,18 @@ def test_interp_on_quantiles(shape, group, method):
             fut_corr.values, obs.where(fut != 1000).values, rtol=2e-3
         )
         xr.testing.assert_equal(fut_corr.isnull(), fut == 1000)
+
+
+@pytest.mark.parametrize("use_dask", [True, False])
+def test_rank(use_dask):
+    arr = np.random.random_sample(size=(10, 10, 1000))
+    da = xr.DataArray(arr, dims=("x", "y", "time"))
+
+    if use_dask:
+        da = da.chunk({"x": 1})
+
+    ranks = u.rank(da, dim="time", pct=False)
+
+    exp = arr.argsort().argsort() + 1
+
+    np.testing.assert_array_equal(ranks.values, exp)

environment.yml
pip install -e .[dev]
parse_log_pytest
environment.yml
pytest pytest-cov flake8 tox coverage
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1722977137225/work
bleach==6.0.0
bokeh @ file:///home/conda/feedstock_root/build_artifacts/bokeh_1660586590972/work
boltons @ file:///home/conda/feedstock_root/build_artifacts/boltons_1711936407380/work
Bottleneck @ file:///home/conda/feedstock_root/build_artifacts/bottleneck_1649629660965/work
branca @ file:///home/conda/feedstock_root/build_artifacts/branca_1714071803448/work
Brotli @ file:///home/conda/feedstock_root/build_artifacts/brotli-split_1648883617327/work
bump2version==1.0.1
certifi @ file:///home/conda/feedstock_root/build_artifacts/certifi_1725278078093/work/certifi
cffi==1.15.1
cfgv==3.3.1
cftime @ file:///home/conda/feedstock_root/build_artifacts/cftime_1649636858592/work
charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1728479282467/work
click @ file:///home/conda/feedstock_root/build_artifacts/click_1651215140632/work
click-plugins==1.1.1
cligj @ file:///home/conda/feedstock_root/build_artifacts/cligj_1633637764473/work
cloudpickle @ file:///home/conda/feedstock_root/build_artifacts/cloudpickle_1674202310934/work
coverage==7.2.7
cryptography==44.0.2
cycler @ file:///home/conda/feedstock_root/build_artifacts/cycler_1635519461629/work
cytoolz==0.11.2
dask==2021.10.0
distlib==0.3.9
distributed @ file:///tmp/build/80754af9/distributed_1635968201545/work
docutils==0.20.1
exceptiongroup==1.2.2
filelock==3.12.2
Fiona==1.8.20
flake8==5.0.4
folium @ file:///home/conda/feedstock_root/build_artifacts/folium_1709209270269/work
fonttools @ file:///home/conda/feedstock_root/build_artifacts/fonttools_1651017735934/work
fsspec @ file:///home/conda/feedstock_root/build_artifacts/fsspec_1674184942191/work
GDAL==3.3.2
geojson @ file:///home/conda/feedstock_root/build_artifacts/geojson_1699269511365/work
geopandas @ file:///home/conda/feedstock_root/build_artifacts/geopandas_1638382567988/work
HeapDict @ file:///home/conda/feedstock_root/build_artifacts/heapdict_1722613793866/work
identify==2.5.24
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1726459485162/work
importlib-metadata==4.2.0
iniconfig==2.0.0
jaraco.classes==3.2.3
jeepney==0.9.0
Jinja2 @ file:///home/conda/feedstock_root/build_artifacts/jinja2_1715127149914/work
joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1691577114857/work
keyring==23.9.3
kiwisolver @ file:///home/conda/feedstock_root/build_artifacts/kiwisolver_1648854392523/work
llvmlite==0.38.0
locket @ file:///home/conda/feedstock_root/build_artifacts/locket_1650660393415/work
mapclassify @ file:///home/conda/feedstock_root/build_artifacts/mapclassify_1673861555770/work
markdown-it-py==2.2.0
MarkupSafe @ file:///home/conda/feedstock_root/build_artifacts/markupsafe_1648737551960/work
matplotlib @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-suite_1651609498426/work
mccabe==0.7.0
mdurl==0.1.2
more-itertools==9.1.0
msgpack @ file:///home/conda/feedstock_root/build_artifacts/msgpack-python_1648745991116/work
munch==2.5.0
munkres==1.1.4
netCDF4 @ file:///home/conda/feedstock_root/build_artifacts/netcdf4_1636302995763/work
networkx @ file:///home/conda/feedstock_root/build_artifacts/networkx_1646092782768/work
nodeenv==1.9.1
numba @ file:///home/conda/feedstock_root/build_artifacts/numba_1652226558760/work
numexpr @ file:///home/conda/feedstock_root/build_artifacts/numexpr_1649636747170/work
numpy @ file:///home/conda/feedstock_root/build_artifacts/numpy_1649806299270/work
olefile @ file:///home/conda/feedstock_root/build_artifacts/olefile_1701735466804/work
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1696202382185/work
pandas==1.3.5
partd @ file:///home/conda/feedstock_root/build_artifacts/partd_1695667515973/work
Pillow @ file:///home/conda/feedstock_root/build_artifacts/pillow_1630696604087/work
Pint @ file:///home/conda/feedstock_root/build_artifacts/pint_1635280347517/work
pkginfo==1.10.0
platformdirs==2.6.2
pluggy==1.2.0
pre-commit==2.21.0
psutil @ file:///home/conda/feedstock_root/build_artifacts/psutil_1653089169272/work
py==1.11.0
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
Pygments==2.17.2
pyparsing @ file:///home/conda/feedstock_root/build_artifacts/pyparsing_1724616129934/work
pyproj @ file:///home/conda/feedstock_root/build_artifacts/pyproj_1650061576675/work
PySocks @ file:///home/conda/feedstock_root/build_artifacts/pysocks_1648857264451/work
pytest==7.4.4
pytest-cov==4.1.0
pytest-runner==6.0.1
python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1709299778482/work
pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1726055524169/work
PyYAML @ file:///home/conda/feedstock_root/build_artifacts/pyyaml_1648757092905/work
readme-renderer==37.3
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1716354486713/work
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.8.1
Rtree @ file:///home/conda/feedstock_root/build_artifacts/rtree_1665582585745/work
scikit-learn @ file:///home/conda/feedstock_root/build_artifacts/scikit-learn_1640464152916/work
scipy @ file:///home/conda/feedstock_root/build_artifacts/scipy_1637806658031/work
SecretStorage==3.3.3
Shapely @ file:///home/conda/feedstock_root/build_artifacts/shapely_1635194349843/work
six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
sortedcontainers @ file:///home/conda/feedstock_root/build_artifacts/sortedcontainers_1621217038088/work
tblib @ file:///home/conda/feedstock_root/build_artifacts/tblib_1702066284995/work
threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1643647933166/work
tomli==2.0.1
toolz @ file:///home/conda/feedstock_root/build_artifacts/toolz_1706112571092/work
tornado @ file:///home/conda/feedstock_root/build_artifacts/tornado_1648827244717/work
tox==3.28.0
twine==4.0.2
typing_extensions @ file:///home/conda/feedstock_root/build_artifacts/typing_extensions_1688315532570/work
unicodedata2 @ file:///home/conda/feedstock_root/build_artifacts/unicodedata2_1649111917568/work
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1708239446578/work
virtualenv==20.16.2
watchdog==3.0.0
webencodings==0.5.1
xarray @ file:///home/conda/feedstock_root/build_artifacts/xarray_1639125986756/work
-e git+https://github.com/Ouranosinc/xclim.git@761b2c1433223adad92124565572fc0aca519f61#egg=xclim
xyzservices @ file:///home/conda/feedstock_root/build_artifacts/xyzservices_1684539629266/work
zict @ file:///home/conda/feedstock_root/build_artifacts/zict_1651156074437/work
zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1677313463193/work

name: xclim
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=24.2.0=pyh71513ae_0
  - bokeh=2.4.3=pyhd8ed1ab_3
  - boltons=24.0.0=pyhd8ed1ab_0
  - boost-cpp=1.74.0=h312852a_4
  - bottleneck=1.3.4=py37hda87dfa_1
  - branca=0.7.2=pyhd8ed1ab_0
  - brotli=1.0.9=h166bdaf_7
  - brotli-bin=1.0.9=h166bdaf_7
  - brotli-python=1.0.9=py37hd23a5d3_7
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.18.1=h7f98852_0
  - ca-certificates=2025.2.25=h06a4308_0
  - cairo=1.16.0=h6cf1ce9_1008
  - certifi=2024.8.30=pyhd8ed1ab_0
  - cfitsio=3.470=hb418390_7
  - cftime=1.6.0=py37hda87dfa_1
  - charset-normalizer=3.4.0=pyhd8ed1ab_0
  - click=8.1.3=py37h89c1867_0
  - click-plugins=1.1.1=py_0
  - cligj=0.7.2=pyhd8ed1ab_1
  - cloudpickle=2.2.1=pyhd8ed1ab_0
  - curl=7.79.1=h2574ce0_1
  - cycler=0.11.0=pyhd8ed1ab_0
  - cytoolz=0.11.2=py37h540881e_2
  - dask=2021.10.0=pyhd8ed1ab_0
  - dask-core=2021.10.0=pyhd3eb1b0_0
  - distributed=2021.10.0=py37h06a4308_0
  - expat=2.4.8=h27087fc_0
  - fiona=1.8.20=py37hb7e2723_2
  - folium=0.16.0=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=h77eed37_3
  - fontconfig=2.14.0=h8e229c2_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.33.3=py37h540881e_0
  - freetype=2.10.4=h0708190_1
  - freexl=1.0.6=h7f98852_0
  - fsspec=2023.1.0=pyhd8ed1ab_0
  - gdal=3.3.2=py37hd5a0ba4_2
  - geojson=3.1.0=pyhd8ed1ab_0
  - geopandas=0.10.2=pyhd8ed1ab_1
  - geopandas-base=0.10.2=pyha770c72_1
  - geos=3.9.1=h9c3ff4c_2
  - geotiff=1.7.0=h4f31c25_0
  - gettext=0.19.8.1=h73d1719_1008
  - giflib=5.2.1=h36c2ea0_2
  - hdf4=4.2.15=h10796ff_3
  - hdf5=1.12.1=nompi_h2750804_100
  - heapdict=1.0.1=pyhd8ed1ab_1
  - icu=68.2=h9c3ff4c_0
  - idna=3.10=pyhd8ed1ab_0
  - importlib_metadata=4.11.4=hd8ed1ab_0
  - jbig=2.1=h7f98852_2003
  - jinja2=3.1.4=pyhd8ed1ab_0
  - joblib=1.3.2=pyhd8ed1ab_0
  - jpeg=9e=h166bdaf_1
  - json-c=0.15=h98cffda_0
  - kealib=1.4.14=h87e4c3c_3
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.2=py37h7cecad7_1
  - krb5=1.19.3=h3790be6_0
  - lcms2=2.12=hddcbb42_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - lerc=2.2.1=h9c3ff4c_0
  - libblas=3.9.0=16_linux64_openblas
  - libbrotlicommon=1.0.9=h166bdaf_7
  - libbrotlidec=1.0.9=h166bdaf_7
  - libbrotlienc=1.0.9=h166bdaf_7
  - libcblas=3.9.0=16_linux64_openblas
  - libcurl=7.79.1=h2574ce0_1
  - libdap4=3.20.6=hd7c4107_2
  - libdeflate=1.7=h7f98852_5
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgdal=3.3.2=hd2dd7ad_2
  - libgfortran-ng=13.2.0=h69a702a_0
  - libgfortran5=13.2.0=ha4646dd_0
  - libglib=2.68.4=h174f98d_1
  - libgomp=11.2.0=h1234567_1
  - libiconv=1.17=h166bdaf_0
  - libkml=1.3.0=h238a007_1014
  - liblapack=3.9.0=16_linux64_openblas
  - libllvm11=11.1.0=hf817b99_2
  - libnetcdf=4.8.1=nompi_hb3fd0d9_101
  - libnghttp2=1.43.0=h812cca2_1
  - libnsl=2.0.0=h7f98852_0
  - libopenblas=0.3.21=h043d6bf_0
  - libpng=1.6.37=h21135ba_2
  - libpq=13.3=hd57d9b9_0
  - librttopo=1.1.0=h1185371_6
  - libspatialindex=1.9.3=h9c3ff4c_4
  - libspatialite=5.0.1=h8694cbe_6
  - libssh2=1.10.0=ha56f1ee_2
  - libstdcxx-ng=11.2.0=h1234567_1
  - libtiff=4.3.0=hf544144_1
  - libuuid=2.32.1=h7f98852_1000
  - libwebp-base=1.2.2=h7f98852_1
  - libxcb=1.13=h7f98852_1004
  - libxml2=2.9.12=h72842e0_0
  - libzip=1.8.0=h4de3113_1
  - llvmlite=0.38.0=py37h4ff587b_0
  - locket=1.0.0=pyhd8ed1ab_0
  - lz4-c=1.9.3=h9c3ff4c_1
  - mapclassify=2.5.0=pyhd8ed1ab_1
  - markupsafe=2.1.1=py37h540881e_1
  - matplotlib-base=3.5.2=py37hc347a89_0
  - msgpack-python=1.0.3=py37h7cecad7_1
  - munch=2.5.0=py_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - ncurses=6.4=h6a678d5_0
  - netcdf4=1.5.8=nompi_py37hf784469_101
  - networkx=2.7=pyhd8ed1ab_0
  - nomkl=1.0=h5ca1d4c_0
  - nspr=4.32=h9c3ff4c_1
  - nss=3.69=hb5efdd6_1
  - numba=0.55.1=py37h43839f2_1
  - numexpr=2.8.0=py37h85a3170_102
  - numpy=1.21.6=py37h976b520_0
  - olefile=0.47=pyhd8ed1ab_0
  - openjpeg=2.4.0=hb52868f_1
  - openssl=1.1.1w=h7f8727e_0
  - packaging=23.2=pyhd8ed1ab_0
  - pandas=1.3.5=py37h8c16a72_0
  - partd=1.4.1=pyhd8ed1ab_0
  - pcre=8.45=h9c3ff4c_0
  - pillow=8.3.2=py37h0f21c89_0
  - pint=0.18=pyhd8ed1ab_0
  - pip=22.3.1=py37h06a4308_0
  - pixman=0.40.0=h36c2ea0_0
  - poppler=21.09.0=ha39eefc_3
  - poppler-data=0.4.12=hd8ed1ab_0
  - postgresql=13.3=h2510834_0
  - proj=8.0.1=h277dcde_0
  - psutil=5.9.1=py37h540881e_0
  - pthread-stubs=0.4=h36c2ea0_1001
  - pyparsing=3.1.4=pyhd8ed1ab_0
  - pyproj=3.2.1=py37hcc46e62_6
  - pysocks=1.7.1=py37h89c1867_5
  - python=3.7.16=h7a1cb2a_0
  - python-dateutil=2.9.0=pyhd8ed1ab_0
  - python_abi=3.7=2_cp37m
  - pytz=2024.2=pyhd8ed1ab_0
  - pyyaml=6.0=py37h540881e_4
  - readline=8.2=h5eee18b_0
  - requests=2.32.2=pyhd8ed1ab_0
  - rtree=1.0.1=py37h0b55af0_0
  - scikit-learn=1.0.2=py37hf9e9bfc_0
  - scipy=1.7.3=py37hf2a6cf1_0
  - setuptools=65.6.3=py37h06a4308_0
  - shapely=1.8.0=py37h48c49eb_0
  - six=1.16.0=pyh6c4a22f_0
  - sortedcontainers=2.4.0=pyhd8ed1ab_0
  - sqlite=3.45.3=h5eee18b_0
  - tblib=3.0.0=pyhd8ed1ab_0
  - threadpoolctl=3.1.0=pyh8a188c0_0
  - tiledb=2.3.4=he87e0bf_0
  - tk=8.6.14=h39e8969_0
  - toolz=0.12.1=pyhd8ed1ab_0
  - tornado=6.1=py37h540881e_3
  - typing-extensions=4.7.1=hd8ed1ab_0
  - typing_extensions=4.7.1=pyha770c72_0
  - tzcode=2022a=h166bdaf_0
  - tzdata=2025b=h78e105d_0
  - unicodedata2=14.0.0=py37h540881e_1
  - urllib3=2.2.1=pyhd8ed1ab_0
  - wheel=0.38.4=py37h06a4308_0
  - xarray=0.20.2=pyhd8ed1ab_0
  - xerces-c=3.2.3=h9d8b166_3
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.0.10=h7f98852_0
  - xorg-libsm=1.2.3=hd9c2040_1000
  - xorg-libx11=1.7.2=h7f98852_0
  - xorg-libxau=1.0.9=h7f98852_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h7f98852_1
  - xorg-libxrender=0.9.10=h7f98852_1003
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h7f98852_1002
  - xorg-xproto=7.0.31=h7f98852_1007
  - xyzservices=2023.5.0=pyhd8ed1ab_0
  - xz=5.6.4=h5eee18b_1
  - yaml=0.2.5=h7f98852_2
  - zict=2.2.0=pyhd8ed1ab_0
  - zipp=3.15.0=pyhd8ed1ab_0
  - zlib=1.2.13=h5eee18b_1
  - zstd=1.5.0=ha95c52a_0
  - pip:
      - bleach==6.0.0
      - bump2version==1.0.1
      - cffi==1.15.1
      - cfgv==3.3.1
      - coverage==7.2.7
      - cryptography==44.0.2
      - distlib==0.3.9
      - docutils==0.20.1
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - flake8==5.0.4
      - identify==2.5.24
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - jaraco-classes==3.2.3
      - jeepney==0.9.0
      - keyring==23.9.3
      - markdown-it-py==2.2.0
      - mccabe==0.7.0
      - mdurl==0.1.2
      - more-itertools==9.1.0
      - nodeenv==1.9.1
      - pkginfo==1.10.0
      - platformdirs==2.6.2
      - pluggy==1.2.0
      - pre-commit==2.21.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pytest==7.4.4
      - pytest-cov==4.1.0
      - pytest-runner==6.0.1
      - readme-renderer==37.3
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==13.8.1
      - secretstorage==3.3.3
      - tomli==2.0.1
      - tox==3.28.0
      - twine==4.0.2
      - virtualenv==20.16.2
      - watchdog==3.0.0
      - webencodings==0.5.1
prefix: /opt/conda/envs/xclim

tests/test_sdba/test_adjustment.py::TestLoci::test_time[time-2] tests/test_sdba/test_adjustment.py::TestLoci::test_time[time.month-1] tests/test_sdba/test_adjustment.py::TestDQM::test_quantiles[+-tas] tests/test_sdba/test_adjustment.py::TestDQM::test_quantiles[*-pr] tests/test_sdba/test_adjustment.py::TestDQM::test_group_norm tests/test_sdba/test_adjustment.py::TestQDM::test_quantiles[+-tas] tests/test_sdba/test_adjustment.py::TestQDM::test_quantiles[*-pr] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[True-+-tas-True] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[True-*-pr-True] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[False-+-tas-True] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[False-*-pr-True] tests/test_sdba/test_adjustment.py::TestQM::test_quantiles[+-tas] tests/test_sdba/test_adjustment.py::TestQM::test_quantiles[*-pr] tests/test_sdba/test_utils.py::test_rank[True] tests/test_sdba/test_utils.py::test_rank[False]
tests/test_sdba/test_adjustment.py::TestScaling::test_time[+-tas] tests/test_sdba/test_adjustment.py::TestScaling::test_time[*-pr] tests/test_sdba/test_adjustment.py::TestScaling::test_mon_U[+-tas] tests/test_sdba/test_adjustment.py::TestScaling::test_mon_U[*-pr] tests/test_sdba/test_adjustment.py::TestDQM::test_mon_U[None-+-tas] tests/test_sdba/test_adjustment.py::TestDQM::test_mon_U[None-*-pr] tests/test_sdba/test_adjustment.py::TestDQM::test_mon_U[spatial_dims1-+-tas] tests/test_sdba/test_adjustment.py::TestDQM::test_mon_U[spatial_dims1-*-pr] tests/test_sdba/test_adjustment.py::TestDQM::test_cannon tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[True-+-tas-False] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[True-*-pr-False] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[False-+-tas-False] tests/test_sdba/test_adjustment.py::TestQDM::test_mon_U[False-*-pr-False] tests/test_sdba/test_adjustment.py::TestQDM::test_cannon tests/test_sdba/test_adjustment.py::TestQM::test_mon_U[+-tas] tests/test_sdba/test_adjustment.py::TestQM::test_mon_U[*-pr] tests/test_sdba/test_utils.py::test_ecdf tests/test_sdba/test_utils.py::test_map_cdf tests/test_sdba/test_utils.py::test_equally_spaced_nodes tests/test_sdba/test_utils.py::test_extrapolate_qm[nan-exp0] tests/test_sdba/test_utils.py::test_extrapolate_qm[constant-exp1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[nearest-time-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[nearest-time-shape1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[nearest-time.month-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[nearest-time.month-shape1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[linear-time-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[linear-time-shape1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[linear-time.month-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[linear-time.month-shape1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[cubic-time-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[cubic-time-shape1] tests/test_sdba/test_utils.py::test_interp_on_quantiles[cubic-time.month-shape0] tests/test_sdba/test_utils.py::test_interp_on_quantiles[cubic-time.month-shape1]
xclim/sdba/utils.py xclim/sdba/__init__.py docs/sdba.rst xclim/sdba/adjustment.py
xclim/sdba/utils.py xclim/sdba/__init__.py docs/sdba.rst xclim/sdba/adjustment.py