Skip to main content
comath
#########
|PyPI-Status| |PyPI-Versions| |Build-Status| |Codecov| |LICENCE|

A small pure-python package for math-related utility functions.

.. code-block:: python

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

.. contents::

.. section-numbering::


Installation
============

Install ``comath`` with:

.. code-block:: bash

pip install comath


Use
===

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

array
----

Array operations like percentile and median.


func
----

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


metric
------

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


segment
----------

Defines a one-dimensional line segment.


Contributing
============

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

Installing for development
--------------------------

Clone:

.. code-block:: bash

git clone git@github.com:shaypal5/comath.git


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`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _`these conventions`: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt


Credits
=======
Created by Shay Palachy (shay.palachy@gmail.com).

.. |PyPI-Status| image:: https://img.shields.io/pypi/v/comath.svg
:target: https://pypi.python.org/pypi/comath

.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/comath.svg
:target: https://pypi.python.org/pypi/comath

.. |Build-Status| image:: https://travis-ci.org/shaypal5/comath.svg?branch=master
:target: https://travis-ci.org/shaypal5/comath

.. |LICENCE| image:: https://img.shields.io/pypi/l/comath.svg
:target: https://pypi.python.org/pypi/comath

.. |Codecov| image:: https://codecov.io/github/shaypal5/comath/coverage.svg?branch=master
:target: https://codecov.io/github/shaypal5/comath?branch=master

Release files for comath 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comath 0.0.3
File Size Uploaded
comath-0.0.3.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for comath 0.0.3
File Interpreter ABI Platform
comath-0.0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 30.8 kB

Release files / comath-0.0.3.tar.gz

Download URL comath-0.0.3.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5609f8a7c4242207a7fc4cbe5e9916c89a034c365068083a774d8471c4f3b1af
BLAKE2b-256 checksum
How to use checksums
0d4f02077a45dd3539f3131eea07a905f1502653866f1ace24f1251ef6804db9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / comath-0.0.3-py2.py3-none-any.whl

Download URL comath-0.0.3-py2.py3-none-any.whl
Size 9.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
487fc8e14f75e4c07a5b8710c5ffb5117bc16d62324a5ac9a9ff066a777d7ae9
BLAKE2b-256 checksum
How to use checksums
aad2afe03a63bba73584d436f9703b95fd63288b8fc5ecbdd12de7b0027d9088
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.0.7

2 release files

0.0.6

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page