cmomy


Namecmomy JSON
Version 0.15.0 PyPI version JSON
download
home_pageNone
SummaryCentral (co)moment calculation/manipulation
upload_time2024-06-21 20:06:59
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.8
licenseNIST-PD
keywords cmomy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD041 -->

[![Repo][repo-badge]][repo-link] [![Docs][docs-badge]][docs-link]
[![PyPI license][license-badge]][license-link]
[![PyPI version][pypi-badge]][pypi-link]
[![Conda (channel only)][conda-badge]][conda-link]
[![Code style: black][black-badge]][black-link]

<!--
  For more badges, see
  https://shields.io/category/other
  https://naereen.github.io/badges/
  [pypi-badge]: https://badge.fury.io/py/cmomy
-->

[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-link]: https://github.com/psf/black
[pypi-badge]: https://img.shields.io/pypi/v/cmomy
[pypi-link]: https://pypi.org/project/cmomy
[docs-badge]: https://img.shields.io/badge/docs-sphinx-informational
[docs-link]: https://pages.nist.gov/cmomy/
[repo-badge]: https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff
[repo-link]: https://github.com/usnistgov/cmomy
[conda-badge]: https://img.shields.io/conda/v/conda-forge/cmomy.svg
[conda-link]: https://anaconda.org/conda-forge/cmomy
[license-badge]: https://img.shields.io/pypi/l/cmomy?color=informational
[license-link]: https://github.com/usnistgov/cmomy/blob/main/LICENSE

<!-- other links -->

[numpy]: https://numpy.org
[Numba]: https://numba.pydata.org/
[xarray]: https://docs.xarray.dev/en/stable/

# cmomy

A Python package to calculate and manipulate Central (co)moments. The main
features of `cmomy` are as follows:

- [Numba][Numba] accelerated computation of central moments and co-moments
- Routines to combine, and resample central moments.
- Both [numpy][numpy] array-like and [xarray][xarray] DataArray interfaces to
  Data.
- Routines to convert between central and raw moments.

## Overview

`cmomy` is an open source package to calculate central moments and co-moments in
a numerical stable and direct way. Behind the scenes, `cmomy` makes use of
[Numba][Numba] to rapidly calculate moments. A good introduction to the type of
formulas used can be found
[here](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance).

## Features

- Fast calculation of central moments and central co-moments with weights
- Support for scalar or vector inputs
- numpy and xarray api's
- bootstrap resampling

## Status

This package is actively used by the author. Please feel free to create a pull
request for wanted features and suggestions!

## Quick start

Use one of the following

```bash
pip install cmomy
```

or

```bash
conda install -c conda-forge cmomy
```

## Example usage

```pycon
>>> import numpy as np
>>> import cmomy
>>> rng = cmomy.random.default_rng(seed=0)
>>> x = rng.random(100)
>>> m = x.mean()
>>> mom = np.array([((x - m) ** i).mean() for i in range(4)])
>>> c = cmomy.CentralMoments.from_vals(x, mom=3, axis=0)

>>> np.testing.assert_allclose(c.cmom(), mom, atol=1e-8)
>>> c.cmom()
array([ 1.    ,  0.    ,  0.0919, -0.0061])

# break up into chunks
>>> c = cmomy.CentralMoments.from_vals(x.reshape(-1, 2), mom=3, axis=0)

>>> c
<CentralMoments(val_shape=(2,), mom=(3,))>
array([[ 5.0000e+01,  5.3019e-01,  8.0115e-02, -4.3748e-03],
       [ 5.0000e+01,  5.6639e-01,  1.0297e-01, -8.9911e-03]])

# Reduce along an axis
>>> c.reduce(axis=0).cmom()
array([ 1.    ,  0.    ,  0.0919, -0.0061])

# unequal chunks
>>> x0, x1, x2 = x[:20], x[20:60], x[60:]

>>> cs = [cmomy.CentralMoments.from_vals(_, mom=3, axis=0) for _ in (x0, x1, x2)]

>>> c = cs[0] + cs[1] + cs[2]

>>> np.testing.assert_allclose(c.cmom(), mom, atol=1e-8)
>>> c.cmom()
array([ 1.    ,  0.    ,  0.0919, -0.0061])

```

## Note on caching

This code makes extensive use of the numba python package. This uses a jit
compiler to speed up vital code sections. This means that the first time a
function called, it has to compile the underlying code. However, caching has
been implemented. Therefore, the very first time you run a function, it may be
slow. But all subsequent uses (including other sessions) will be already
compiled.

<!-- end-docs -->

## Documentation

See the [documentation][docs-link] for a look at `cmomy` in action.

## License

This is free software. See [LICENSE][license-link].

## Related work

This package is used extensively in the newest version of `thermoextrap`. See
[here](https://github.com/usnistgov/thermo-extrap).

## Contact

The author can be reached at <wpk@nist.gov>.

## Credits

This package was created using
[Cookiecutter](https://github.com/audreyr/cookiecutter) with the
[usnistgov/cookiecutter-nist-python](https://github.com/usnistgov/cookiecutter-nist-python)
template.
<!-- markdownlint-disable MD024 -->
<!-- markdownlint-disable MD013 -->
<!-- prettier-ignore-start -->

# Changelog

Changelog for `cmomy`

## Unreleased

[changelog.d]: https://github.com/usnistgov/cmomy/tree/main/changelog.d

See the fragment files in [changelog.d]

<!-- prettier-ignore-end -->

<!-- markdownlint-enable MD013 -->

<!-- scriv-insert-here -->

## v0.15.0 — 2024-06-21

### Added

- Added `cmomy.concat` method to concatenate moments objects.

- Added `__getitem__` to `(x)CentralMoments` objects. This method **does not\***
  allow changing the moments shape. If you want to do that, you'll need to work
  directly with `(x)CentralMoments.to_values()`

## v0.14.0 — 2024-06-20

### Added

- added `cmomy.resample.select_ndat` to select data size along reduction
  dimension
- Added `cmomy.randsamp_freq` to top level api

### Changed

- Updated `cmomy.resample.randsamp_freq` to select ndat from array

## v0.13.0 — 2024-06-18

### Added

- Added `cmomy.convert.moments_to_comoments` (and
  `(x)CentralMoments.moments_to_comoments`)to convert from single variable
  moments to comoments. This is useful in `thermoextrap`.
- Added `cmomy.convert.assign_weight` (and `(x)CentralMoments.assign_weights`)
  to update weights (useful in `thermoextrap`).

- Added support for `numpy>=2.0.0`. Because we still support older versions, we
  still use the old convention for the `copy` parameter to `numpy.array`. Will
  change this when minimum numpy is 2.0.

### Changed

- Renamed `cmomy.convert` function to `cmomy.convert.moments_type`A bullet item
  for the Changed category.

## v0.12.0 — 2024-06-13

### Added

- Now supports python3.12

## v0.11.0 — 2024-06-12

### Changed

- Switch to underlying numba functions using `guvectorize`. This significantly
  simplifies the code. Previously, we had separate functions for "vector" vs
  "scalar" moments. To handle arbitrary vector dimensions, the arrays were
  reshaped behind the scenes (to a single "meta" dimension). Now, this is all
  handled by the `gufunc` based library code.
- Typing support improved.
- Added `(x)CentralMoments.astype`
- Added `(x)CentralMoments.`
- Added alias `CentralMoments.to_x` which is the same as
  `CentralMoments.to_xcentralmoments`.
- Added alias `xCentralMoments.to_c` which is the same as
  `xCentralMoments.to_centralmoments`.
- Most constructors now accept `order` and `dtype` arguments.
- Most routines that process central moments accept a `parallel` parameter.
- Instead of complicated internal validation routines in `(x)CentralMoments`,
  most of this is now handled by `cmomy.reduction` or similar routines.
- Now using `xr.apply_ufunc` for most of the `xarray.DataArray` based
  calculations.

### Deprecated

- Removed classmethods `(x)CentralMoments.from_raws`. Instead, use
  `(x)CentralMoments.from_raw(...).reduce(...)`.
- Removed classmethods `(x)CentralMoments.from_datas`. Instead, use
  `(x)CentralMoments.from_data(...).reduce(...)`.
- Removed classmethod `(x)CentralMoments.from_data`. Instead, use
  `(x)CentralMoments(....)`.
- Removed ability to create `xCentralMoments` objects directly from
  `numpy.ndarray` objects. (e.g., passing in array-like to
  `xCentralmoments.from_vals` doesn't work anymore). Instead use
  `CentralMoments.from_vals(....).to_xcentralmoments(...)`, etc.
- Removed methods `push_stat`, `push_stats`, `from_stat`, `from_stats`. Instead
  use, for example, `numpy.concatenate`, to combine weights, average, and
  variance into a `data` array. A helper function may be added if called for.
- `(x)CentralMoments.resample_and_reduce` and
  `(x)CentralMoments.from_resample_vals` no longer accept `nrep=...` or
  `indices=...`. They only accept `freq=...`.

## v0.9.0 — 2024-04-10

### Changed

- Can now resample with an arbitrary number of samples. Previously, it was
  assumed that resampling should be done with a shape `(nrep, ndat)`, where
  `nrep` is the number of replicates and `ndat` is the shape of the data along
  the resampled axis. Now you can pass sample with shape `(nrep, nsamp)` where
  `nsamp` is the specified number of samples in a replicate (defaulting to
  `ndat`). This allows users to do things like jacknife resampling, etc, with
  `resample_and_reduce` methods.
- Preliminary support for using type hints in generated documentation. The
  standard sphinx autodoc support doesn't quite work for `cmomy`, as it requires
  type hints to be accessible at run time, and not in `TYPE_CHECKING` blocks.
  Instead, we use
  [`sphinx_autodoc_type`](https://github.com/tox-dev/sphinx-autodoc-typehints).
  This has the downside of expanding type aliases, but handles (most things)
  being in `TYPE_CHECKING` blocks. Over time, we'll replace some of the explicit
  parameter type documentation with those from type hints.
- Fixed creation of templates in reduction routines of `xCentralMoments`.
  Previously, we build the template for the result using something like
  `da.isel(dim=0)`. This kept scalar coordinates of `da` with `dim`. Now we use
  `da.isel(dim=0, drop=True)` to drop these.
- Updated dependencies.

## v0.8.0 — 2024-02-20

### Added

- Added `to_values` method to access underlying array data. This should be
  preferred to `.values` attribute.
- Added `to_numpy` method to access underlying `numpy.ndarray`.
- Added `to_dataarray` method to access underlying `xarray.DataArray` in
  `xCentralMoment s`

- Added submodule `cmomy.random` to handle random numbers generation. This uses
  `numpy.random.Generator` behind the scenes.
- Updated `ruff` lintering rules
- Now using `hatchling` for package building
- Update repo template

### Changed

- Now CentralMoments and xCentralMoments ensure that data/data_flat share
  memory. This may result in passed data not being the same as the internal
  data, if reshaping data creates a copy.
- Made little used arguments keyword only

## v0.7.0 — 2023-08-11

### Added

- Now use [lazy_loader](https://github.com/scientific-python/lazy_loader) to
  speed up initial load time.

- Now using `module_utilities >=0.6`.
- Changed from `custom-inherit` to `docstring-inheritance`
- Now fully supports typing (passing mypy --stict and pyright)
- Relocated numba functions to submodule `cmomy._lib`.

### Changed

- Moved tests to top level of repo (`src/cmomy/tests` to `tests`)

## v0.5.0 — 2023-06-14

### Added

- Package now available on conda-forge

- Bumped maximum python version to 3.11

[`v0.4.1...v0.5.0`](https://github.com/usnistgov/cmomy/compare/v0.4.1...v0.5.0)

### Changed

- Testing now handled with nox.

## v0.4.0 — 2023-05-02

### Added

- Moved module `_docstrings_` to `docstrings`. This can be used by other
  modules.

### Changed

- Update package layout
- New linters via pre-commit
- Development env now handled by tox

- Now use `module-utilities` to handle caching and docfiller.

[`v0.3.0...v0.4.0`](https://github.com/usnistgov/cmomy/compare/v0.3.0...v0.4.0)

## v0.3.0 - 2023-04-24

Full set of changes:
[`v0.2.2...v0.3.0`](https://github.com/usnistgov/cmomy/compare/v0.2.2...v0.3.0)

## v0.2.2 - 2023-04-05

Full set of changes:
[`v0.2.1...v0.2.2`](https://github.com/usnistgov/cmomy/compare/v0.2.1...v0.2.2)

## v0.2.1 - 2023-04-05

Full set of changes:
[`v0.2.0...v0.2.1`](https://github.com/usnistgov/cmomy/compare/v0.2.0...v0.2.1)

## v0.2.0 - 2023-03-22

Full set of changes:
[`v0.1.9...v0.2.0`](https://github.com/usnistgov/cmomy/compare/v0.1.9...v0.2.0)

## v0.1.9 - 2023-02-15

Full set of changes:
[`v0.1.8...v0.1.9`](https://github.com/usnistgov/cmomy/compare/v0.1.8...v0.1.9)

## v0.1.8 - 2022-12-02

Full set of changes:
[`v0.1.7...v0.1.8`](https://github.com/usnistgov/cmomy/compare/v0.1.7...v0.1.8)

## v0.1.7 - 2022-09-28

Full set of changes:
[`v0.1.6...v0.1.7`](https://github.com/usnistgov/cmomy/compare/v0.1.6...v0.1.7)

## v0.1.6 - 2022-09-27

Full set of changes:
[`v0.1.5...v0.1.6`](https://github.com/usnistgov/cmomy/compare/v0.1.5...v0.1.6)

## v0.1.5 - 2022-09-26

Full set of changes:
[`v0.1.4...v0.1.5`](https://github.com/usnistgov/cmomy/compare/v0.1.4...v0.1.5)

## v0.1.4 - 2022-09-15

Full set of changes:
[`v0.1.3...v0.1.4`](https://github.com/usnistgov/cmomy/compare/v0.1.3...v0.1.4)

## v0.1.3 - 2022-09-15

Full set of changes:
[`v0.1.2...v0.1.3`](https://github.com/usnistgov/cmomy/compare/v0.1.2...v0.1.3)

## v0.1.2 - 2022-09-13

Full set of changes:
[`v0.1.1...v0.1.2`](https://github.com/usnistgov/cmomy/compare/v0.1.1...v0.1.2)

## v0.1.1 - 2022-09-13

Full set of changes:
[`v0.1.0...v0.1.1`](https://github.com/usnistgov/cmomy/compare/v0.1.0...v0.1.1)

## v0.1.0 - 2022-09-13

Full set of changes:
[`v0.0.7...v0.1.0`](https://github.com/usnistgov/cmomy/compare/v0.0.7...v0.1.0)

## v0.0.7 - 2021-05-18

Full set of changes:
[`v0.0.6...v0.0.7`](https://github.com/usnistgov/cmomy/compare/v0.0.6...v0.0.7)

## v0.0.6 - 2021-02-03

Full set of changes:
[`v0.0.4...v0.0.6`](https://github.com/usnistgov/cmomy/compare/v0.0.4...v0.0.6)

## v0.0.4 - 2020-12-21

Full set of changes:
[`v0.0.3...v0.0.4`](https://github.com/usnistgov/cmomy/compare/v0.0.3...v0.0.4)
This software was developed by employees of the National Institute of Standards
and Technology (NIST), an agency of the Federal Government. Pursuant to title 17
United States Code Section 105, works of NIST employees are not subject to
copyright protection in the United States and are considered to be in the public
domain. Permission to freely use, copy, modify, and distribute this software and
its documentation without fee is hereby granted, provided that this notice and
disclaimer of warranty appears in all copies.

THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER
EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY
THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM
INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE
SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT
SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR
IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR
PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT
OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.

Distributions of NIST software should also include copyright and licensing
statements of any third-party software that are legally bundled with the code in
compliance with the conditions of those licenses.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cmomy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.8",
    "maintainer_email": null,
    "keywords": "cmomy",
    "author": null,
    "author_email": "\"William P. Krekelberg\" <wpk@nist.gov>",
    "download_url": "https://files.pythonhosted.org/packages/2b/92/84d60d13be5dd43bc5f75b35363afd7efcb2c8029605c9373d8a191f733e/cmomy-0.15.0.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD041 -->\n\n[![Repo][repo-badge]][repo-link] [![Docs][docs-badge]][docs-link]\n[![PyPI license][license-badge]][license-link]\n[![PyPI version][pypi-badge]][pypi-link]\n[![Conda (channel only)][conda-badge]][conda-link]\n[![Code style: black][black-badge]][black-link]\n\n<!--\n  For more badges, see\n  https://shields.io/category/other\n  https://naereen.github.io/badges/\n  [pypi-badge]: https://badge.fury.io/py/cmomy\n-->\n\n[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg\n[black-link]: https://github.com/psf/black\n[pypi-badge]: https://img.shields.io/pypi/v/cmomy\n[pypi-link]: https://pypi.org/project/cmomy\n[docs-badge]: https://img.shields.io/badge/docs-sphinx-informational\n[docs-link]: https://pages.nist.gov/cmomy/\n[repo-badge]: https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff\n[repo-link]: https://github.com/usnistgov/cmomy\n[conda-badge]: https://img.shields.io/conda/v/conda-forge/cmomy.svg\n[conda-link]: https://anaconda.org/conda-forge/cmomy\n[license-badge]: https://img.shields.io/pypi/l/cmomy?color=informational\n[license-link]: https://github.com/usnistgov/cmomy/blob/main/LICENSE\n\n<!-- other links -->\n\n[numpy]: https://numpy.org\n[Numba]: https://numba.pydata.org/\n[xarray]: https://docs.xarray.dev/en/stable/\n\n# cmomy\n\nA Python package to calculate and manipulate Central (co)moments. The main\nfeatures of `cmomy` are as follows:\n\n- [Numba][Numba] accelerated computation of central moments and co-moments\n- Routines to combine, and resample central moments.\n- Both [numpy][numpy] array-like and [xarray][xarray] DataArray interfaces to\n  Data.\n- Routines to convert between central and raw moments.\n\n## Overview\n\n`cmomy` is an open source package to calculate central moments and co-moments in\na numerical stable and direct way. Behind the scenes, `cmomy` makes use of\n[Numba][Numba] to rapidly calculate moments. A good introduction to the type of\nformulas used can be found\n[here](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance).\n\n## Features\n\n- Fast calculation of central moments and central co-moments with weights\n- Support for scalar or vector inputs\n- numpy and xarray api's\n- bootstrap resampling\n\n## Status\n\nThis package is actively used by the author. Please feel free to create a pull\nrequest for wanted features and suggestions!\n\n## Quick start\n\nUse one of the following\n\n```bash\npip install cmomy\n```\n\nor\n\n```bash\nconda install -c conda-forge cmomy\n```\n\n## Example usage\n\n```pycon\n>>> import numpy as np\n>>> import cmomy\n>>> rng = cmomy.random.default_rng(seed=0)\n>>> x = rng.random(100)\n>>> m = x.mean()\n>>> mom = np.array([((x - m) ** i).mean() for i in range(4)])\n>>> c = cmomy.CentralMoments.from_vals(x, mom=3, axis=0)\n\n>>> np.testing.assert_allclose(c.cmom(), mom, atol=1e-8)\n>>> c.cmom()\narray([ 1.    ,  0.    ,  0.0919, -0.0061])\n\n# break up into chunks\n>>> c = cmomy.CentralMoments.from_vals(x.reshape(-1, 2), mom=3, axis=0)\n\n>>> c\n<CentralMoments(val_shape=(2,), mom=(3,))>\narray([[ 5.0000e+01,  5.3019e-01,  8.0115e-02, -4.3748e-03],\n       [ 5.0000e+01,  5.6639e-01,  1.0297e-01, -8.9911e-03]])\n\n# Reduce along an axis\n>>> c.reduce(axis=0).cmom()\narray([ 1.    ,  0.    ,  0.0919, -0.0061])\n\n# unequal chunks\n>>> x0, x1, x2 = x[:20], x[20:60], x[60:]\n\n>>> cs = [cmomy.CentralMoments.from_vals(_, mom=3, axis=0) for _ in (x0, x1, x2)]\n\n>>> c = cs[0] + cs[1] + cs[2]\n\n>>> np.testing.assert_allclose(c.cmom(), mom, atol=1e-8)\n>>> c.cmom()\narray([ 1.    ,  0.    ,  0.0919, -0.0061])\n\n```\n\n## Note on caching\n\nThis code makes extensive use of the numba python package. This uses a jit\ncompiler to speed up vital code sections. This means that the first time a\nfunction called, it has to compile the underlying code. However, caching has\nbeen implemented. Therefore, the very first time you run a function, it may be\nslow. But all subsequent uses (including other sessions) will be already\ncompiled.\n\n<!-- end-docs -->\n\n## Documentation\n\nSee the [documentation][docs-link] for a look at `cmomy` in action.\n\n## License\n\nThis is free software. See [LICENSE][license-link].\n\n## Related work\n\nThis package is used extensively in the newest version of `thermoextrap`. See\n[here](https://github.com/usnistgov/thermo-extrap).\n\n## Contact\n\nThe author can be reached at <wpk@nist.gov>.\n\n## Credits\n\nThis package was created using\n[Cookiecutter](https://github.com/audreyr/cookiecutter) with the\n[usnistgov/cookiecutter-nist-python](https://github.com/usnistgov/cookiecutter-nist-python)\ntemplate.\n<!-- markdownlint-disable MD024 -->\n<!-- markdownlint-disable MD013 -->\n<!-- prettier-ignore-start -->\n\n# Changelog\n\nChangelog for `cmomy`\n\n## Unreleased\n\n[changelog.d]: https://github.com/usnistgov/cmomy/tree/main/changelog.d\n\nSee the fragment files in [changelog.d]\n\n<!-- prettier-ignore-end -->\n\n<!-- markdownlint-enable MD013 -->\n\n<!-- scriv-insert-here -->\n\n## v0.15.0 \u2014 2024-06-21\n\n### Added\n\n- Added `cmomy.concat` method to concatenate moments objects.\n\n- Added `__getitem__` to `(x)CentralMoments` objects. This method **does not\\***\n  allow changing the moments shape. If you want to do that, you'll need to work\n  directly with `(x)CentralMoments.to_values()`\n\n## v0.14.0 \u2014 2024-06-20\n\n### Added\n\n- added `cmomy.resample.select_ndat` to select data size along reduction\n  dimension\n- Added `cmomy.randsamp_freq` to top level api\n\n### Changed\n\n- Updated `cmomy.resample.randsamp_freq` to select ndat from array\n\n## v0.13.0 \u2014 2024-06-18\n\n### Added\n\n- Added `cmomy.convert.moments_to_comoments` (and\n  `(x)CentralMoments.moments_to_comoments`)to convert from single variable\n  moments to comoments. This is useful in `thermoextrap`.\n- Added `cmomy.convert.assign_weight` (and `(x)CentralMoments.assign_weights`)\n  to update weights (useful in `thermoextrap`).\n\n- Added support for `numpy>=2.0.0`. Because we still support older versions, we\n  still use the old convention for the `copy` parameter to `numpy.array`. Will\n  change this when minimum numpy is 2.0.\n\n### Changed\n\n- Renamed `cmomy.convert` function to `cmomy.convert.moments_type`A bullet item\n  for the Changed category.\n\n## v0.12.0 \u2014 2024-06-13\n\n### Added\n\n- Now supports python3.12\n\n## v0.11.0 \u2014 2024-06-12\n\n### Changed\n\n- Switch to underlying numba functions using `guvectorize`. This significantly\n  simplifies the code. Previously, we had separate functions for \"vector\" vs\n  \"scalar\" moments. To handle arbitrary vector dimensions, the arrays were\n  reshaped behind the scenes (to a single \"meta\" dimension). Now, this is all\n  handled by the `gufunc` based library code.\n- Typing support improved.\n- Added `(x)CentralMoments.astype`\n- Added `(x)CentralMoments.`\n- Added alias `CentralMoments.to_x` which is the same as\n  `CentralMoments.to_xcentralmoments`.\n- Added alias `xCentralMoments.to_c` which is the same as\n  `xCentralMoments.to_centralmoments`.\n- Most constructors now accept `order` and `dtype` arguments.\n- Most routines that process central moments accept a `parallel` parameter.\n- Instead of complicated internal validation routines in `(x)CentralMoments`,\n  most of this is now handled by `cmomy.reduction` or similar routines.\n- Now using `xr.apply_ufunc` for most of the `xarray.DataArray` based\n  calculations.\n\n### Deprecated\n\n- Removed classmethods `(x)CentralMoments.from_raws`. Instead, use\n  `(x)CentralMoments.from_raw(...).reduce(...)`.\n- Removed classmethods `(x)CentralMoments.from_datas`. Instead, use\n  `(x)CentralMoments.from_data(...).reduce(...)`.\n- Removed classmethod `(x)CentralMoments.from_data`. Instead, use\n  `(x)CentralMoments(....)`.\n- Removed ability to create `xCentralMoments` objects directly from\n  `numpy.ndarray` objects. (e.g., passing in array-like to\n  `xCentralmoments.from_vals` doesn't work anymore). Instead use\n  `CentralMoments.from_vals(....).to_xcentralmoments(...)`, etc.\n- Removed methods `push_stat`, `push_stats`, `from_stat`, `from_stats`. Instead\n  use, for example, `numpy.concatenate`, to combine weights, average, and\n  variance into a `data` array. A helper function may be added if called for.\n- `(x)CentralMoments.resample_and_reduce` and\n  `(x)CentralMoments.from_resample_vals` no longer accept `nrep=...` or\n  `indices=...`. They only accept `freq=...`.\n\n## v0.9.0 \u2014 2024-04-10\n\n### Changed\n\n- Can now resample with an arbitrary number of samples. Previously, it was\n  assumed that resampling should be done with a shape `(nrep, ndat)`, where\n  `nrep` is the number of replicates and `ndat` is the shape of the data along\n  the resampled axis. Now you can pass sample with shape `(nrep, nsamp)` where\n  `nsamp` is the specified number of samples in a replicate (defaulting to\n  `ndat`). This allows users to do things like jacknife resampling, etc, with\n  `resample_and_reduce` methods.\n- Preliminary support for using type hints in generated documentation. The\n  standard sphinx autodoc support doesn't quite work for `cmomy`, as it requires\n  type hints to be accessible at run time, and not in `TYPE_CHECKING` blocks.\n  Instead, we use\n  [`sphinx_autodoc_type`](https://github.com/tox-dev/sphinx-autodoc-typehints).\n  This has the downside of expanding type aliases, but handles (most things)\n  being in `TYPE_CHECKING` blocks. Over time, we'll replace some of the explicit\n  parameter type documentation with those from type hints.\n- Fixed creation of templates in reduction routines of `xCentralMoments`.\n  Previously, we build the template for the result using something like\n  `da.isel(dim=0)`. This kept scalar coordinates of `da` with `dim`. Now we use\n  `da.isel(dim=0, drop=True)` to drop these.\n- Updated dependencies.\n\n## v0.8.0 \u2014 2024-02-20\n\n### Added\n\n- Added `to_values` method to access underlying array data. This should be\n  preferred to `.values` attribute.\n- Added `to_numpy` method to access underlying `numpy.ndarray`.\n- Added `to_dataarray` method to access underlying `xarray.DataArray` in\n  `xCentralMoment s`\n\n- Added submodule `cmomy.random` to handle random numbers generation. This uses\n  `numpy.random.Generator` behind the scenes.\n- Updated `ruff` lintering rules\n- Now using `hatchling` for package building\n- Update repo template\n\n### Changed\n\n- Now CentralMoments and xCentralMoments ensure that data/data_flat share\n  memory. This may result in passed data not being the same as the internal\n  data, if reshaping data creates a copy.\n- Made little used arguments keyword only\n\n## v0.7.0 \u2014 2023-08-11\n\n### Added\n\n- Now use [lazy_loader](https://github.com/scientific-python/lazy_loader) to\n  speed up initial load time.\n\n- Now using `module_utilities >=0.6`.\n- Changed from `custom-inherit` to `docstring-inheritance`\n- Now fully supports typing (passing mypy --stict and pyright)\n- Relocated numba functions to submodule `cmomy._lib`.\n\n### Changed\n\n- Moved tests to top level of repo (`src/cmomy/tests` to `tests`)\n\n## v0.5.0 \u2014 2023-06-14\n\n### Added\n\n- Package now available on conda-forge\n\n- Bumped maximum python version to 3.11\n\n[`v0.4.1...v0.5.0`](https://github.com/usnistgov/cmomy/compare/v0.4.1...v0.5.0)\n\n### Changed\n\n- Testing now handled with nox.\n\n## v0.4.0 \u2014 2023-05-02\n\n### Added\n\n- Moved module `_docstrings_` to `docstrings`. This can be used by other\n  modules.\n\n### Changed\n\n- Update package layout\n- New linters via pre-commit\n- Development env now handled by tox\n\n- Now use `module-utilities` to handle caching and docfiller.\n\n[`v0.3.0...v0.4.0`](https://github.com/usnistgov/cmomy/compare/v0.3.0...v0.4.0)\n\n## v0.3.0 - 2023-04-24\n\nFull set of changes:\n[`v0.2.2...v0.3.0`](https://github.com/usnistgov/cmomy/compare/v0.2.2...v0.3.0)\n\n## v0.2.2 - 2023-04-05\n\nFull set of changes:\n[`v0.2.1...v0.2.2`](https://github.com/usnistgov/cmomy/compare/v0.2.1...v0.2.2)\n\n## v0.2.1 - 2023-04-05\n\nFull set of changes:\n[`v0.2.0...v0.2.1`](https://github.com/usnistgov/cmomy/compare/v0.2.0...v0.2.1)\n\n## v0.2.0 - 2023-03-22\n\nFull set of changes:\n[`v0.1.9...v0.2.0`](https://github.com/usnistgov/cmomy/compare/v0.1.9...v0.2.0)\n\n## v0.1.9 - 2023-02-15\n\nFull set of changes:\n[`v0.1.8...v0.1.9`](https://github.com/usnistgov/cmomy/compare/v0.1.8...v0.1.9)\n\n## v0.1.8 - 2022-12-02\n\nFull set of changes:\n[`v0.1.7...v0.1.8`](https://github.com/usnistgov/cmomy/compare/v0.1.7...v0.1.8)\n\n## v0.1.7 - 2022-09-28\n\nFull set of changes:\n[`v0.1.6...v0.1.7`](https://github.com/usnistgov/cmomy/compare/v0.1.6...v0.1.7)\n\n## v0.1.6 - 2022-09-27\n\nFull set of changes:\n[`v0.1.5...v0.1.6`](https://github.com/usnistgov/cmomy/compare/v0.1.5...v0.1.6)\n\n## v0.1.5 - 2022-09-26\n\nFull set of changes:\n[`v0.1.4...v0.1.5`](https://github.com/usnistgov/cmomy/compare/v0.1.4...v0.1.5)\n\n## v0.1.4 - 2022-09-15\n\nFull set of changes:\n[`v0.1.3...v0.1.4`](https://github.com/usnistgov/cmomy/compare/v0.1.3...v0.1.4)\n\n## v0.1.3 - 2022-09-15\n\nFull set of changes:\n[`v0.1.2...v0.1.3`](https://github.com/usnistgov/cmomy/compare/v0.1.2...v0.1.3)\n\n## v0.1.2 - 2022-09-13\n\nFull set of changes:\n[`v0.1.1...v0.1.2`](https://github.com/usnistgov/cmomy/compare/v0.1.1...v0.1.2)\n\n## v0.1.1 - 2022-09-13\n\nFull set of changes:\n[`v0.1.0...v0.1.1`](https://github.com/usnistgov/cmomy/compare/v0.1.0...v0.1.1)\n\n## v0.1.0 - 2022-09-13\n\nFull set of changes:\n[`v0.0.7...v0.1.0`](https://github.com/usnistgov/cmomy/compare/v0.0.7...v0.1.0)\n\n## v0.0.7 - 2021-05-18\n\nFull set of changes:\n[`v0.0.6...v0.0.7`](https://github.com/usnistgov/cmomy/compare/v0.0.6...v0.0.7)\n\n## v0.0.6 - 2021-02-03\n\nFull set of changes:\n[`v0.0.4...v0.0.6`](https://github.com/usnistgov/cmomy/compare/v0.0.4...v0.0.6)\n\n## v0.0.4 - 2020-12-21\n\nFull set of changes:\n[`v0.0.3...v0.0.4`](https://github.com/usnistgov/cmomy/compare/v0.0.3...v0.0.4)\nThis software was developed by employees of the National Institute of Standards\nand Technology (NIST), an agency of the Federal Government. Pursuant to title 17\nUnited States Code Section 105, works of NIST employees are not subject to\ncopyright protection in the United States and are considered to be in the public\ndomain. Permission to freely use, copy, modify, and distribute this software and\nits documentation without fee is hereby granted, provided that this notice and\ndisclaimer of warranty appears in all copies.\n\nTHE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, EITHER\nEXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY\nTHAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM\nINFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE\nSOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT\nSHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT,\nINDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR\nIN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,\nCONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR\nPROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT\nOF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.\n\nDistributions of NIST software should also include copyright and licensing\nstatements of any third-party software that are legally bundled with the code in\ncompliance with the conditions of those licenses.\n",
    "bugtrack_url": null,
    "license": "NIST-PD",
    "summary": "Central (co)moment calculation/manipulation",
    "version": "0.15.0",
    "project_urls": {
        "Documentation": "https://pages.nist.gov/cmomy/",
        "Homepage": "https://github.com/usnistgov/cmomy"
    },
    "split_keywords": [
        "cmomy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ce3f3a11221e7be3ce630989c52eb7ed0275adbbac1ce69c01ba29cf2b64572",
                "md5": "fe6d0ec09534e36bec7aa49078112d74",
                "sha256": "8e99269fc4f6766684a6ca5e79ef278ef72c188a54cf06c759cea91e8c23017c"
            },
            "downloads": -1,
            "filename": "cmomy-0.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe6d0ec09534e36bec7aa49078112d74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.8",
            "size": 91608,
            "upload_time": "2024-06-21T20:06:56",
            "upload_time_iso_8601": "2024-06-21T20:06:56.655783Z",
            "url": "https://files.pythonhosted.org/packages/1c/e3/f3a11221e7be3ce630989c52eb7ed0275adbbac1ce69c01ba29cf2b64572/cmomy-0.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b9284d60d13be5dd43bc5f75b35363afd7efcb2c8029605c9373d8a191f733e",
                "md5": "99a538f0866c815e80eeab4df3112d1f",
                "sha256": "80b662ae0a88ea454cb411f78a98caf2f4b6e396d481041974a1e521774895e4"
            },
            "downloads": -1,
            "filename": "cmomy-0.15.0.tar.gz",
            "has_sig": false,
            "md5_digest": "99a538f0866c815e80eeab4df3112d1f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.8",
            "size": 222225,
            "upload_time": "2024-06-21T20:06:59",
            "upload_time_iso_8601": "2024-06-21T20:06:59.165337Z",
            "url": "https://files.pythonhosted.org/packages/2b/92/84d60d13be5dd43bc5f75b35363afd7efcb2c8029605c9373d8a191f733e/cmomy-0.15.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-21 20:06:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "usnistgov",
    "github_project": "cmomy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cmomy"
}
        
Elapsed time: 0.33383s