Skip to main content

A small pure-python package for math relatedutility functions.

Project description

|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|

A small pure-python package for data comathure related utility functions.

.. code-block:: python

>>> from comath.array import percentile
>>> percentile([4,6,8,9,11], 0.4)

.. contents::

.. section-numbering::


Install ``comath`` with:

.. code-block:: bash

pip install comath


``comath`` is divided into four sub-modules.


Array operations like percentile and median.


Utility function like a smooth step function and closest larger power of 2.


Computing moving metrics (moving average, precision and variance).


Defines a one-dimensional line segment.


Package author and current maintainer is Shay Palachy (; You are more than welcome to approach him for help. Contributions are very welcomed.

Installing for development


.. code-block:: bash

git clone

Install in development mode with test dependencies:

.. code-block:: bash

cd comath
pip install -e ".[test]"

Running the tests

To run the tests, use:

.. code-block:: bash

python -m pytest --cov=comath --doctest-modules

Adding documentation

This project is documented using the `numpy docstring conventions`_, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings (in my personal opinion, of course). When documenting code you add to this project, please follow `these conventions`_.

.. _`numpy docstring conventions`:
.. _`these conventions`:

Created by Shay Palachy (

.. |PyPI-Status| image::

.. |PyPI-Versions| image::

.. |Build-Status| image::

.. |LICENCE| image::

.. |Codecov| image::

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

comath-0.0.0.tar.gz (18.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page