Typing aliases (cmomy.resample.typing)

Typing aliases (cmomy.resample.typing)#

Classes:

Data:

SamplerType

Input type for sampler

class cmomy.resample.typing.FactoryIndexSamplerKwargs[source]#

Bases: TypedDict

Extra parameters to resample.factory_sampler()

Parameters:
  • indices (array of int) – Array of shape (nrep, size). If passed, create freq from indices.

  • freq (array-like, DataArray, or Dataset of int) – Array of shape (nrep, size) where nrep is the number of replicates and size = self.shape[axis]. freq is the weight that each sample contributes to a replicate. If freq is an xarray object, it should have dimensions rep_dim and dim.

  • ndat (int) – Size of data along resampled axis.

  • nrep (int) – Number of resample replicates.

  • nsamp (int) – Number of samples in a single resampled replicate. Defaults to size of data along sampled axis.

  • paired (bool) – If False and generating freq from nrep with data of type Dataset, Generate unique freq for each variable in data. If True, treat all variables in data as paired, and use same freq for each.

  • rng – Random number generator object. Defaults to output of default_rng(). If pass in a seed value, create a new Generator object with this seed

  • resample_replace (bool) – If True, do resampling with replacement.

  • shuffle (bool) – If True, shuffle indices created from freq for each row.

cmomy.resample.typing.SamplerType = 'int | NDArrayAny | xr.DataArray | xr.Dataset | IndexSampler[Any] | FactoryIndexSamplerKwargs'#

Input type for sampler