Skip to main content

Central (co)moment calculation/manipulation

Project description

cmomy

Central (co)moment calculation/manipulation

  • Free software: NIST license

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 to rapidly calculate moments. A good introduction to the type of formulas used can be found here.

Features

  • Fast calculation of central moments and central co-moments with weights

  • Support for scalar or vector inputs

  • numpy and xarray api’s

Installation

Use one of the following

pip install cmomy
conda install -c wpk-nist cmomy

Basic Usage

For a quick introduction to the usage of cmomy, please see the basic usage

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.

Testing

Tests are packaged with the distribution intentionally. To test code run:

pytest --pyargs cmomy

By running the tests once, you create a cache of the numba code for most cases. The first time you run the tests, it will take a while (about 1.5 min on my machine). However, subsequent runs will be much faster (about 3 seconds on my machine).

Credits

This package was created with Cookiecutter and the wpk-nist-gov/cookiecutter-pypackage Project template forked from audreyr/cookiecutter-pypackage.

History

0.0.5 (2020-12-30)

  • First release on PyPI.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmomy-0.1.5.tar.gz (135.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmomy-0.1.5-py3-none-any.whl (64.2 kB view details)

Uploaded Python 3

File details

Details for the file cmomy-0.1.5.tar.gz.

File metadata

  • Download URL: cmomy-0.1.5.tar.gz
  • Upload date:
  • Size: 135.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for cmomy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5d1c1eba87a2cee251d7094dfff123d6b949bf49b3adc71aca484e497ecc1cdf
MD5 7e6e7a69ba76325c77ad3c89aa296e75
BLAKE2b-256 0e23a4a0a515adeb3d631d4af8e6d83d186f8ff5bfdf49970145865ee9941d4e

See more details on using hashes here.

File details

Details for the file cmomy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: cmomy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 64.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for cmomy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e50f76a48b44f1871496a1d8931bf93df41ddd73dafcfb3ae82e9e3e25170646
MD5 fb5120e13c971aec9b9fef918bb2cc97
BLAKE2b-256 bf4f6c9485227278501d1c0aab3ca9a3240fd122b95b570c049d7d41b7c8af38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page