numcertain
==========
|code_ci| |docs_ci| |coverage| |pypi_version| |license|
This package provides a python and numpy data type (`uncertain`) which implements a
floating point value with quantified uncertainity, allowing for forward uncertainity
propagation of uncorrelated values.
============== ==============================================
PyPI ``pip install numcertain``
Source code https://github.com/garryod/numcertain
Documentation https://garryod.github.io/numcertain
Releases https://github.com/garryod/numcertain/releases
============== ==============================================
Aritmatic Examples
------------------
A brief example of arithmatic with the provided uncertain data type is presented below:
.. code:: python
a = uncertain(42.0, 5.0)
b = uncertain(36, 12)
print(a + b)
print(a - b)
print(a * b)
print(a / b)
.. code::
>> 78.0±13.0
>> 6.0±13.0
>> 1512.0±535.1784749034662
>> 1.1666666666666667±0.41294635409218067
A brief example of arithmatic with numpy arrays with the uncertain dtype is presented
below:
.. code:: python
a = array([uncertain(5.0, 3.0), uncertain(7.0, 6.0)])
b = array([uncertain(12.0, 4.0), uncertain(24.0, 8.0)])
print(a + b)
print(a - b)
print(a * b)
print(a / b)
.. code::
>> [uncertain(17.0, 5.0) uncertain(31.0, 10.0)]
>> [uncertain(-7.0, 5.0) uncertain(-17.0, 10.0)]
>> [uncertain(60.0, 41.182520563948) uncertain(168.0, 154.50566332662373)]
>> [uncertain(0.4166666666666667, 0.2859897261385278) uncertain(0.2916666666666667, 0.268238998830944)]
Alternative Methods
-------------------
In order to accurately propagate uncertainties of related values the derivative of the
computed expectation must be known with respect to expectations it is comprised of.
Automatic differentiation (autodiff) provides a mechanism for computing the derivative
of arbitrary functions with respect to their components by exploiting the fact that all
codes, regardless of complexity, are reduced to a sequence of primative arithmetic
operations during execution for which the derivatives are known, by applying the chain
rule the overall derivative can be determined automatically.
The python package `Uncertainties`_ provides a python data type which performs autodiff
to propagate the corresponding uncertainity, unforunately due to Implementation as a
python object the library is non-performant when used for array math.
Whilst `Propagation of Uncertainty with autodiff`_, describes the use of autodiff
provided by the python package `JAX`_ in propagating uncertainities for array math.
.. _Uncertainties: https://uncertainties-python-package.readthedocs.io/en/latest/
.. _Propagation of Uncertainty with autodiff: http://theoryandpractice.org/intro-exp-phys-book/error-propagation/error_propagation_with_jax.html
.. _JAX: https://jax.readthedocs.io/en/latest/
.. |code_ci| image:: https://github.com/garryod/numcertain/workflows/Code%20CI/badge.svg?branch=master
:target: https://github.com/garryod/numcertain/actions?query=workflow%3A%22Code+CI%22
:alt: Code CI
.. |docs_ci| image:: https://github.com/garryod/numcertain/workflows/Docs%20CI/badge.svg?branch=master
:target: https://github.com/garryod/numcertain/actions?query=workflow%3A%22Docs+CI%22
:alt: Docs CI
.. |coverage| image:: https://codecov.io/gh/garryod/numcertain/branch/master/graph/badge.svg
:target: https://codecov.io/gh/garryod/numcertain
:alt: Test Coverage
.. |pypi_version| image:: https://img.shields.io/pypi/v/numcertain.svg
:target: https://pypi.org/project/numcertain
:alt: Latest PyPI version
.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
:target: https://opensource.org/licenses/Apache-2.0
:alt: Apache License
..
Anything below this line is used when viewing README.rst and will be replaced
when included in index.rst
See https://garryod.github.io/numcertain for more detailed documentation.
Raw data
{
"_id": null,
"home_page": "https://github.com/garryod/numcertain",
"name": "numcertain",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "",
"author": "Garry O'Donnell",
"author_email": "garry.o'donnell@diamond.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/dc/34/c44d39a5f1be6762fd851b53aadd81655d039ef3ddd5ef8b4fe61aebe521/numcertain-0.2.0.tar.gz",
"platform": null,
"description": "numcertain\n==========\n\n|code_ci| |docs_ci| |coverage| |pypi_version| |license|\n\nThis package provides a python and numpy data type (`uncertain`) which implements a\nfloating point value with quantified uncertainity, allowing for forward uncertainity\npropagation of uncorrelated values.\n\n============== ==============================================\nPyPI ``pip install numcertain``\nSource code https://github.com/garryod/numcertain\nDocumentation https://garryod.github.io/numcertain\nReleases https://github.com/garryod/numcertain/releases\n============== ==============================================\n\nAritmatic Examples\n------------------\n\nA brief example of arithmatic with the provided uncertain data type is presented below:\n\n.. code:: python\n\n a = uncertain(42.0, 5.0)\n b = uncertain(36, 12)\n\n print(a + b)\n print(a - b)\n print(a * b)\n print(a / b)\n\n.. code::\n\n >> 78.0\u00b113.0\n >> 6.0\u00b113.0\n >> 1512.0\u00b1535.1784749034662\n >> 1.1666666666666667\u00b10.41294635409218067\n\nA brief example of arithmatic with numpy arrays with the uncertain dtype is presented\nbelow:\n\n.. code:: python\n\n a = array([uncertain(5.0, 3.0), uncertain(7.0, 6.0)])\n b = array([uncertain(12.0, 4.0), uncertain(24.0, 8.0)])\n\n print(a + b)\n print(a - b)\n print(a * b)\n print(a / b)\n\n.. code::\n\n >> [uncertain(17.0, 5.0) uncertain(31.0, 10.0)]\n >> [uncertain(-7.0, 5.0) uncertain(-17.0, 10.0)]\n >> [uncertain(60.0, 41.182520563948) uncertain(168.0, 154.50566332662373)]\n >> [uncertain(0.4166666666666667, 0.2859897261385278) uncertain(0.2916666666666667, 0.268238998830944)]\n\nAlternative Methods\n-------------------\n\nIn order to accurately propagate uncertainties of related values the derivative of the\ncomputed expectation must be known with respect to expectations it is comprised of.\nAutomatic differentiation (autodiff) provides a mechanism for computing the derivative\nof arbitrary functions with respect to their components by exploiting the fact that all\ncodes, regardless of complexity, are reduced to a sequence of primative arithmetic\noperations during execution for which the derivatives are known, by applying the chain\nrule the overall derivative can be determined automatically.\n\nThe python package `Uncertainties`_ provides a python data type which performs autodiff\nto propagate the corresponding uncertainity, unforunately due to Implementation as a\npython object the library is non-performant when used for array math.\n\nWhilst `Propagation of Uncertainty with autodiff`_, describes the use of autodiff\nprovided by the python package `JAX`_ in propagating uncertainities for array math.\n\n.. _Uncertainties: https://uncertainties-python-package.readthedocs.io/en/latest/\n\n.. _Propagation of Uncertainty with autodiff: http://theoryandpractice.org/intro-exp-phys-book/error-propagation/error_propagation_with_jax.html\n\n.. _JAX: https://jax.readthedocs.io/en/latest/\n\n.. |code_ci| image:: https://github.com/garryod/numcertain/workflows/Code%20CI/badge.svg?branch=master\n :target: https://github.com/garryod/numcertain/actions?query=workflow%3A%22Code+CI%22\n :alt: Code CI\n\n.. |docs_ci| image:: https://github.com/garryod/numcertain/workflows/Docs%20CI/badge.svg?branch=master\n :target: https://github.com/garryod/numcertain/actions?query=workflow%3A%22Docs+CI%22\n :alt: Docs CI\n\n.. |coverage| image:: https://codecov.io/gh/garryod/numcertain/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/garryod/numcertain\n :alt: Test Coverage\n\n.. |pypi_version| image:: https://img.shields.io/pypi/v/numcertain.svg\n :target: https://pypi.org/project/numcertain\n :alt: Latest PyPI version\n\n.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n :target: https://opensource.org/licenses/Apache-2.0\n :alt: Apache License\n\n..\n Anything below this line is used when viewing README.rst and will be replaced\n when included in index.rst\n\nSee https://garryod.github.io/numcertain for more detailed documentation.\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "A python & numpy data type for floating point numbers with quantified uncertainity.",
"version": "0.2.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "34ea72d4ab949e1f76c1fcdc63a2d35b",
"sha256": "35af1fcdae0c8c997c9a2996669a0136cc99104c8308d856febb586b674338e1"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "34ea72d4ab949e1f76c1fcdc63a2d35b",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 18169,
"upload_time": "2022-06-30T15:20:15",
"upload_time_iso_8601": "2022-06-30T15:20:15.172977Z",
"url": "https://files.pythonhosted.org/packages/fa/90/73ba668270b6ac79d3c075330b0a7ef422b91d9415df19ab8fa9f8bcf21e/numcertain-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "27d15fb7522b949045fc22d168dee712",
"sha256": "71b003fcbce3a1d9864dc894c4447d73dd555c920b5ebd54fe22801f0f4efe96"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "27d15fb7522b949045fc22d168dee712",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 52266,
"upload_time": "2022-06-30T15:20:17",
"upload_time_iso_8601": "2022-06-30T15:20:17.053165Z",
"url": "https://files.pythonhosted.org/packages/ce/93/79d88c266d672547001f9410dc5803c35232cf789f134c5fdc10d7353d26/numcertain-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "5ef48a598635261abcf911a3a7f7994a",
"sha256": "e1f021e8966fe4da066def4fa2647b99bb04b433fc7520a7f4e776440938aaa6"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "5ef48a598635261abcf911a3a7f7994a",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 20030,
"upload_time": "2022-06-30T15:20:19",
"upload_time_iso_8601": "2022-06-30T15:20:19.037813Z",
"url": "https://files.pythonhosted.org/packages/57/3a/30f358df06ae395385349b8af0c7e304189d7998a941fc40a1bb8db1754d/numcertain-0.2.0-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "904d9dcaf581245994cdc455b3f7ba9f",
"sha256": "60b94320f11bcacc1ed105d7d31f5d9a95760ac5968e099a0c6ccaa3d529731b"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "904d9dcaf581245994cdc455b3f7ba9f",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 18165,
"upload_time": "2022-06-30T15:20:20",
"upload_time_iso_8601": "2022-06-30T15:20:20.844376Z",
"url": "https://files.pythonhosted.org/packages/b6/f7/a01c90af2d206e16e6d582b4a81d63cbf75e4ebc017d0c22e04b66a6825f/numcertain-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "e2402a2ae275ceeafbe651aba65d0546",
"sha256": "8cf9d591bcff7bc8806b5771c70d6b576631c4ab209f1558bb35d0379d06a74c"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "e2402a2ae275ceeafbe651aba65d0546",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 51775,
"upload_time": "2022-06-30T15:20:22",
"upload_time_iso_8601": "2022-06-30T15:20:22.474552Z",
"url": "https://files.pythonhosted.org/packages/b0/28/b9058e9705e62aef74c28c277ef1d6d143542a3950cf3849b8a5219bac60/numcertain-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "11e3d36bddf38cb912d20c4920d55885",
"sha256": "7fc9db3fa805e7d2d43116f70922d39b9cbb0826db6a9a0c552d45c45619dacd"
},
"downloads": -1,
"filename": "numcertain-0.2.0-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "11e3d36bddf38cb912d20c4920d55885",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 20006,
"upload_time": "2022-06-30T15:20:24",
"upload_time_iso_8601": "2022-06-30T15:20:24.337039Z",
"url": "https://files.pythonhosted.org/packages/b8/ee/f35c0444b52e60558b55ab8f895cfd01411f4f1541235c4e1cd2df7c35d1/numcertain-0.2.0-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "7d8df75366a040daf6fd1904e4bdd2ac",
"sha256": "18724d3daac0f73e8d5dcd763822c664367bbe3e53ea0a638975dfff58b5f33b"
},
"downloads": -1,
"filename": "numcertain-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "7d8df75366a040daf6fd1904e4bdd2ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 16835,
"upload_time": "2022-06-30T15:20:25",
"upload_time_iso_8601": "2022-06-30T15:20:25.952086Z",
"url": "https://files.pythonhosted.org/packages/dc/34/c44d39a5f1be6762fd851b53aadd81655d039ef3ddd5ef8b4fe61aebe521/numcertain-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-06-30 15:20:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "garryod",
"github_project": "numcertain",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "numcertain"
}