Cmomy

Latest version: v0.23.4

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

0.23.0

Changed

- Routines now accept `mom_axes` parameter. This allows for moment axes to be in
arbitrary location
- Routines now accept `mom_params` parameter. This object contains all the logic
for working with moment arrays. This Also simplifies calling routines from
other classes/routines.
- Update requirements, typing, and linting
- Routines now correctly respect the `order` parameter. Passing in `None` will
lead to arrays that are `c` ordered when "normalized" (i.e., which have `axis`
and `mom_axes` at the end), which is the default behavior of
`numb.guvectorize`. Passing order `c` will lead to outputs that are `c`
ordered regardless of `mom_axes` location.

- Negative axis/axes are now treated relative to the end of the array (just like
python lists and numpy ndarrays). To get the old behavior of counting relative
to the `mom_ndim`, pass in imaginary axis. For example, passing `axis=-1j`
with `mom_ndim=1` is equivalent to passing `axis=-2`.

- renamed parameter `move_axes_to_end` to `axes_to_end`. This will lead to axes
being in the form `(..., *mom_axes)` if `axes` are reduced or
`(..., *axes, *mom_axes)` if `axes` are kept.

- Applying routines to `dataset` objects now keeps correct order if
`axes_to_end` is `False`.

0.22.0

Changed

- For xarray (DataArray and Dataset) central moments data, routines will infer
`mom_ndim` from `mom_dims`. For example, can calling
`cmomy.reduce_data(data, mom_dims=("mom_0", "mom_1"), dim="a")` will infer
`mom_ndim=1`.

0.21.0

Removed

- `cmomy.randsamp_freq` has been replaced with `cmomy.factory_sampler`

Added

- `cmomy.factory_sampler` to create a sampler for resample routines.
- `cmomy.IndexSampler` to wrap resample "indices" and "freq" table.

Changed

- Added `IndexSampler` class to handle resampling. This wraps either resampling
`indices` or a "frequency" table `freq`, and can produce whichever is not
provided.
- replace `randsamp_freq` with `factory_sampler` which creates `IndexSampler`
from parameters or a mapping.
- Removed arguments `freq`, `nrep`, `rng`, `paired` from resampling routines
(`resample_data`, etc). This was replaced by an arguments `sampler` which can
be either an `IndexSampler` or a mapping which is passed to `factory_sampler`.
This means that to call the resampling routines, you'll have to pass a sampler
or a dict of parameters. While this is a little annoying, it greatly cleans up
a bunch of parameters that may not be used. For example, the call
`cmomy.resample_data(data, axis=0, nrep=10, rng=0)` is now
`cmomy.resampler_data(data, axis=0, sampler={"nrep": 10, "rng": 0})`. Plus,
you can now pass `indices` with
`cmomy.resample_data(data, axis=0, sampler={"indices": indices})`
- Removed parameter `on_missing_core_dim` from routines that call
`xarray.apply_ufunc` behind the scenese. You can still pass this parameter
using `apply_ufunc_kwargs`. For example,
`cmomy.reduce_data(data, axis=0, apply_ufunc_kwargs={"on_missing_core_dim": "drop"})`.

0.20.0

Fixed

- Made `cmomy.resample.freq_to_indices` and `cmomy.resample.indices_to_freq`
gufunc's. Much faster than old code (`freq_to_indices` was a bottleneck).

0.19.0

Added

- Added `cmomy.convert.comoments_to_moments` routine, which is the inverse of
`cmomy.convert.moments_to_comoments`.

0.18.0

Added

- `cmomy.assign_moment` and `cmomy.select_moment` now accept options `xmom_0`,
`xmom_1`, `ymom_0`, and `ymom_1`. These allow selecting/assigning to slices.
Useful when convertering values to central moments array.

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.