uncertainties


Nameuncertainties JSON
Version 3.2.2 PyPI version JSON
download
home_pageNone
Summarycalculations with values with uncertainties, error propagation
upload_time2024-07-07 22:37:06
maintainerNone
docs_urlhttps://pythonhosted.org/uncertainties/
authorNone
requires_python>=3.8
licenseRevised BSD License
keywords error propagation uncertainties uncertainty calculations standard deviation derivatives partial derivatives differentiation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            uncertainties
=============

.. image:: https://readthedocs.org/projects/uncertainties/badge/?version=latest
   :target: https://uncertainties.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/pypi/v/uncertainties.svg
   :target: https://pypi.org/project/uncertainties/
.. image:: https://pepy.tech/badge/uncertainties/week
   :target: https://pepy.tech/project/uncertainties
.. image:: https://codecov.io/gh/lmfit/uncertainties/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/lmfit/uncertainties/
.. image:: https://img.shields.io/github/actions/workflow/status/lmfit/uncertainties/python-package.yml?logo=github%20actions
   :target: https://github.com/lmfit/uncertainties/actions/workflows/python-package.yml

The ``uncertainties`` package allows calculations with values that have
uncertaintes, such as (2 +/- 0.1)*2 = 4 +/- 0.2.  ``uncertainties`` takes the
pain and complexity out of error propagation and calculations of values with
uncertainties.  For more information, see https://uncertainties.readthedocs.io/

Basic examples
--------------

.. code-block:: python

    >>> from uncertainties import ufloat
    >>> x = ufloat(2, 0.25)
    >>> x
    2.0+/-0.25

    >>> square = x**2
    >>> square
    4.0+/-1.0
    >>> square.nominal_value
    4.0
    >>> square.std_dev  # Standard deviation
    1.0

    >>> square - x*x
    0.0  # Exactly 0: correlations taken into account

    >>> from uncertainties.umath import sin, cos  # and many more.
    >>> sin(1+x**2)
    -0.95892427466313845+/-0.2836621854632263

    >>> print (2*x+1000).derivatives[x]  # Automatic calculation of derivatives
    2.0

    >>> from uncertainties import unumpy  # Array manipulation
    >>> varr = unumpy.uarray([1, 2], [0.1, 0.2])
    >>> print(varr)
    [1.0+/-0.1 2.0+/-0.2]
    >>> print(varr.mean())
    1.50+/-0.11
    >>> print(unumpy.cos(varr))
    [0.540302305868+/-0.0841470984808 -0.416146836547+/-0.181859485365]

Main features
-------------

- **Transparent calculations with uncertainties**: Liittle or
  no modification of existing code is needed to convert calculations of floats
  to calculations of values with uncertainties.

- **Correlations** between expressions are correctly taken into
  account.  Thus, ``x-x`` is exactly zero.

- **Most  mathematical operations** are supported, including most
  functions from the standard math_ module (sin,...).  Comparison
  operators (``>``, ``==``, etc.) are supported too.

- Many **fast operations on arrays and matrices** of numbers with
  uncertainties are supported.

- **Extensive support for printing** numbers with uncertainties
  (including LaTeX support and pretty-printing).

- Most uncertainty calculations are performed **analytically**.

- This module also gives access to the **derivatives** of any
  mathematical expression (they are used by `error
  propagation theory`_, and are thus automatically calculated by this
  module).


Installation or upgrade
-----------------------

To install `uncertainties`, use::

     pip install uncertainties

To upgrade from an older version, use::

     pip install --upgrade uncertainties

Further details are in the `on-line documentation
<https://uncertainties.readthedocs.io/en/latest/install.html>`_.


Git branches
------------

The GitHub ``master`` branch is the latest development version, and is intended
to be a stable pre-release version. It will be experimental, but should pass
all tests..  Tagged releases will be available on GitHub, and correspond to the
releases to PyPI.  The GitHub ``gh-pages`` branch will contain a stable test version
of the documentation that can be viewed at
`<https://lmfit.github.io/uncertainties/>`_.  Other Github branches should be
treated as unstable and in-progress development branches.


License
-------

This package and its documentation are released under the `Revised BSD
License <LICENSE.txt>`_.


History
-------

..
   Note from Eric Lebigot: I would like the origin of the package to
   remain documented for its whole life. Thanks!

This package was created back around 2009 by `Eric O. LEBIGOT <https://github.com/lebigot>`_.

Ownership of the package was taken over by the `lmfit GitHub organization <https://github.com/lmfit>`_ in 2024.

.. _IPython: https://ipython.readthedocs.io/en/stable/
.. _math: https://docs.python.org/library/math.html
.. _error propagation theory: https://en.wikipedia.org/wiki/Propagation_of_uncertainty
.. _main website: https://uncertainties.readthedocs.io/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "uncertainties",
    "maintainer": null,
    "docs_url": "https://pythonhosted.org/uncertainties/",
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "error propagation, uncertainties, uncertainty calculations, standard deviation, derivatives, partial derivatives, differentiation",
    "author": null,
    "author_email": "\"Eric O. LEBIGOT (EOL)\" <eric.lebigot@normalesup.org>",
    "download_url": "https://files.pythonhosted.org/packages/a0/b0/f926a3faf468b9784bdecb8d9328b531743937ead284b2e8d406d96e8b0f/uncertainties-3.2.2.tar.gz",
    "platform": null,
    "description": "uncertainties\n=============\n\n.. image:: https://readthedocs.org/projects/uncertainties/badge/?version=latest\n   :target: https://uncertainties.readthedocs.io/en/latest/?badge=latest\n.. image:: https://img.shields.io/pypi/v/uncertainties.svg\n   :target: https://pypi.org/project/uncertainties/\n.. image:: https://pepy.tech/badge/uncertainties/week\n   :target: https://pepy.tech/project/uncertainties\n.. image:: https://codecov.io/gh/lmfit/uncertainties/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/lmfit/uncertainties/\n.. image:: https://img.shields.io/github/actions/workflow/status/lmfit/uncertainties/python-package.yml?logo=github%20actions\n   :target: https://github.com/lmfit/uncertainties/actions/workflows/python-package.yml\n\nThe ``uncertainties`` package allows calculations with values that have\nuncertaintes, such as (2 +/- 0.1)*2 = 4 +/- 0.2.  ``uncertainties`` takes the\npain and complexity out of error propagation and calculations of values with\nuncertainties.  For more information, see https://uncertainties.readthedocs.io/\n\nBasic examples\n--------------\n\n.. code-block:: python\n\n    >>> from uncertainties import ufloat\n    >>> x = ufloat(2, 0.25)\n    >>> x\n    2.0+/-0.25\n\n    >>> square = x**2\n    >>> square\n    4.0+/-1.0\n    >>> square.nominal_value\n    4.0\n    >>> square.std_dev  # Standard deviation\n    1.0\n\n    >>> square - x*x\n    0.0  # Exactly 0: correlations taken into account\n\n    >>> from uncertainties.umath import sin, cos  # and many more.\n    >>> sin(1+x**2)\n    -0.95892427466313845+/-0.2836621854632263\n\n    >>> print (2*x+1000).derivatives[x]  # Automatic calculation of derivatives\n    2.0\n\n    >>> from uncertainties import unumpy  # Array manipulation\n    >>> varr = unumpy.uarray([1, 2], [0.1, 0.2])\n    >>> print(varr)\n    [1.0+/-0.1 2.0+/-0.2]\n    >>> print(varr.mean())\n    1.50+/-0.11\n    >>> print(unumpy.cos(varr))\n    [0.540302305868+/-0.0841470984808 -0.416146836547+/-0.181859485365]\n\nMain features\n-------------\n\n- **Transparent calculations with uncertainties**: Liittle or\n  no modification of existing code is needed to convert calculations of floats\n  to calculations of values with uncertainties.\n\n- **Correlations** between expressions are correctly taken into\n  account.  Thus, ``x-x`` is exactly zero.\n\n- **Most  mathematical operations** are supported, including most\n  functions from the standard math_ module (sin,...).  Comparison\n  operators (``>``, ``==``, etc.) are supported too.\n\n- Many **fast operations on arrays and matrices** of numbers with\n  uncertainties are supported.\n\n- **Extensive support for printing** numbers with uncertainties\n  (including LaTeX support and pretty-printing).\n\n- Most uncertainty calculations are performed **analytically**.\n\n- This module also gives access to the **derivatives** of any\n  mathematical expression (they are used by `error\n  propagation theory`_, and are thus automatically calculated by this\n  module).\n\n\nInstallation or upgrade\n-----------------------\n\nTo install `uncertainties`, use::\n\n     pip install uncertainties\n\nTo upgrade from an older version, use::\n\n     pip install --upgrade uncertainties\n\nFurther details are in the `on-line documentation\n<https://uncertainties.readthedocs.io/en/latest/install.html>`_.\n\n\nGit branches\n------------\n\nThe GitHub ``master`` branch is the latest development version, and is intended\nto be a stable pre-release version. It will be experimental, but should pass\nall tests..  Tagged releases will be available on GitHub, and correspond to the\nreleases to PyPI.  The GitHub ``gh-pages`` branch will contain a stable test version\nof the documentation that can be viewed at\n`<https://lmfit.github.io/uncertainties/>`_.  Other Github branches should be\ntreated as unstable and in-progress development branches.\n\n\nLicense\n-------\n\nThis package and its documentation are released under the `Revised BSD\nLicense <LICENSE.txt>`_.\n\n\nHistory\n-------\n\n..\n   Note from Eric Lebigot: I would like the origin of the package to\n   remain documented for its whole life. Thanks!\n\nThis package was created back around 2009 by `Eric O. LEBIGOT <https://github.com/lebigot>`_.\n\nOwnership of the package was taken over by the `lmfit GitHub organization <https://github.com/lmfit>`_ in 2024.\n\n.. _IPython: https://ipython.readthedocs.io/en/stable/\n.. _math: https://docs.python.org/library/math.html\n.. _error propagation theory: https://en.wikipedia.org/wiki/Propagation_of_uncertainty\n.. _main website: https://uncertainties.readthedocs.io/\n",
    "bugtrack_url": null,
    "license": "Revised BSD License",
    "summary": "calculations with values with uncertainties, error propagation",
    "version": "3.2.2",
    "project_urls": {
        "Changelog": "https://github.com/lmfit/uncertainties/blob/master/CHANGES.rst",
        "Documentation": "https://uncertainties.readthedocs.io/",
        "Issues": "https://github.com/lmfit/uncertainties/issues",
        "Repository": "https://github.com/lmfit/uncertainties"
    },
    "split_keywords": [
        "error propagation",
        " uncertainties",
        " uncertainty calculations",
        " standard deviation",
        " derivatives",
        " partial derivatives",
        " differentiation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fafc97711d2a502881d871e3cf2d2645e21e7f8e4d4fd9a56937557790cade6a",
                "md5": "a70ebcb4886fe5c6bc92d2ffcfe4ca70",
                "sha256": "fd8543355952f4052786ed4150acaf12e23117bd0f5bd03ea07de466bce646e7"
            },
            "downloads": -1,
            "filename": "uncertainties-3.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a70ebcb4886fe5c6bc92d2ffcfe4ca70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 58266,
            "upload_time": "2024-07-07T22:37:03",
            "upload_time_iso_8601": "2024-07-07T22:37:03.942096Z",
            "url": "https://files.pythonhosted.org/packages/fa/fc/97711d2a502881d871e3cf2d2645e21e7f8e4d4fd9a56937557790cade6a/uncertainties-3.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0b0f926a3faf468b9784bdecb8d9328b531743937ead284b2e8d406d96e8b0f",
                "md5": "d52c9e535ddd1b7a8bacdb095656d61d",
                "sha256": "e62c86fdc64429828229de6ab4e11466f114907e6bd343c077858994cc12e00b"
            },
            "downloads": -1,
            "filename": "uncertainties-3.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d52c9e535ddd1b7a8bacdb095656d61d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 143865,
            "upload_time": "2024-07-07T22:37:06",
            "upload_time_iso_8601": "2024-07-07T22:37:06.567478Z",
            "url": "https://files.pythonhosted.org/packages/a0/b0/f926a3faf468b9784bdecb8d9328b531743937ead284b2e8d406d96e8b0f/uncertainties-3.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-07 22:37:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lmfit",
    "github_project": "uncertainties",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "uncertainties"
}
        
Elapsed time: 0.65201s