Skip to main content

Code CI Docs CI Test Coverage Latest PyPI version Apache 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/DiamondLightSource/numcertain

Documentation

https://DiamondLightSource.github.io/numcertain

Releases

https://github.com/DiamondLightSource/numcertain/releases

Aritmatic Examples

A brief example of arithmatic with the provided uncertain data type is presented below:

a = uncertain(42.0, 5.0)
b = uncertain(36, 12)

print(a + b)
print(a - b)
print(a * b)
print(a / b)
>> 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:

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)
>> [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.

See https://DiamondLightSource.github.io/numcertain for more detailed documentation.

Release files for numcertain 0.3.0

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

Source distribution (sdist)

Source distribution for numcertain 0.3.0
File Size Uploaded
numcertain-0.3.0.tar.gz 48.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for numcertain 0.3.0
File
numcertain-0.3.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
numcertain-0.3.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
numcertain-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-64 Details
numcertain-0.3.0-cp311-cp311-musllinux_1_1_i686.whl CPython 3.11 CPython 3.11 Linux musl 1.1+ x86-32 Details
numcertain-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
numcertain-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
numcertain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
numcertain-0.3.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
numcertain-0.3.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
numcertain-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-64 Details
numcertain-0.3.0-cp310-cp310-musllinux_1_1_i686.whl CPython 3.10 CPython 3.10 Linux musl 1.1+ x86-32 Details
numcertain-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
numcertain-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
numcertain-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
numcertain-0.3.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
numcertain-0.3.0-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
numcertain-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-64 Details
numcertain-0.3.0-cp39-cp39-musllinux_1_1_i686.whl CPython 3.9 CPython 3.9 Linux musl 1.1+ x86-32 Details
numcertain-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
numcertain-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
numcertain-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 922.5 kB

Release files / numcertain-0.3.0.tar.gz

Download URL numcertain-0.3.0.tar.gz
Size 48.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2df04d884c2bc95e7aeecf59e246dbcd7d7e061bcef25339f262311b206db966
BLAKE2b-256 checksum
How to use checksums
2b5789e6932a943459a426e3ec12f05ba55dfa5a974f041e98a7089f55f1439d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-win_amd64.whl

Download URL numcertain-0.3.0-cp311-cp311-win_amd64.whl
Size 21.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
46e92b4012146abdc8064d890119758754024006604f5214125031e35a84c5b9
BLAKE2b-256 checksum
How to use checksums
14db31a953b0ffb9c6dc1a2d4e7554637794269e2240d6b69af145079c2734b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-win32.whl

Download URL numcertain-0.3.0-cp311-cp311-win32.whl
Size 21.0 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
64c765ce4976b771844d9ca7dbd32b72f904637427cf34a004ffe90a8abb7dee
BLAKE2b-256 checksum
How to use checksums
99be30bcf621887cbaf073badf1e2966cc28dd95fe1c4eb022d6129e72f51165
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl

Download URL numcertain-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl
Size 63.2 kB
Tags CPython 3.11 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
ff350aad6758f460772fce09fe767c3d1b9b0b0f53867a4d17009e3fe253adb6
BLAKE2b-256 checksum
How to use checksums
cbfb55983a80387598195d846116006303ff9085bb3cdd2255ddd5812a55dc62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-musllinux_1_1_i686.whl

Download URL numcertain-0.3.0-cp311-cp311-musllinux_1_1_i686.whl
Size 60.4 kB
Tags CPython 3.11 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
b55e0bc399dd5171dd06325478de6383e861f115abc8474de79c7ca859c8a713
BLAKE2b-256 checksum
How to use checksums
feda6c25fc1d2e100bc1e76a80e34af4a22970c8dc9f38f11e003c099f5cf4d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL numcertain-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 55.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fd02dccb1bea83338908db740b4b9c784bb87fd8435f50f4e5be1379c18ac027
BLAKE2b-256 checksum
How to use checksums
48f16be37bbfa9deb0e76831e21a9debafeb0d2f8b03cca67f384cd1042ce4f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL numcertain-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 51.5 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
47a0d9860b562c48165b7802496b9c86585cf40fa0f245863c99a4fe601c1d19
BLAKE2b-256 checksum
How to use checksums
6f6c6571fc5e4acf16cb5f8643d93122a15e1f80f7abde7fe694b5f7df4e9f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl

Download URL numcertain-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Size 20.3 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
41f44d2e967e0f91e19c85aa43c1bf92559bb980f0a454228af45a08abe609a0
BLAKE2b-256 checksum
How to use checksums
4fbaa4bb654f4bd28d8faf83602d238ab016da1b519e9637702b9e0786deac9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-win_amd64.whl

Download URL numcertain-0.3.0-cp310-cp310-win_amd64.whl
Size 21.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5317b6089a6eff8bf2a355738424458f9700312bea55a9dbea89d93912ba4142
BLAKE2b-256 checksum
How to use checksums
f9ce3221fadb5c36daa582a7f2dea676dff46d59fe1d4603467ba625da50981e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-win32.whl

Download URL numcertain-0.3.0-cp310-cp310-win32.whl
Size 21.0 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
ebdf8e5c4984b25cda92adb1e39ac52dcacb30271f585effc25ac6a08d134927
BLAKE2b-256 checksum
How to use checksums
e68c124356d868548ba55bbc1bbf8e0342612c0e9bcf2ee102f606bdda64c231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl

Download URL numcertain-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl
Size 62.5 kB
Tags CPython 3.10 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
8c49f5bbb5020fe8bf91e2195f0f496aec109caeea30cc16ebd6b732a6bad52a
BLAKE2b-256 checksum
How to use checksums
fc03b6b9e900b04da89f8e0b5802bb2948669e5798c975a7e83cd22f94f0d78f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-musllinux_1_1_i686.whl

Download URL numcertain-0.3.0-cp310-cp310-musllinux_1_1_i686.whl
Size 59.6 kB
Tags CPython 3.10 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
d740027844c1af813120565b13e43f9d51f8f340465eaac19b890431d58ca7df
BLAKE2b-256 checksum
How to use checksums
c623d0684a928702eb24f5e0c4a777f884348d9512d5d7848dc67048c8437705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL numcertain-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 55.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
99c3c349dc824f8e93af123b0937fddde453ce105b8f24099e6c017d60797fbd
BLAKE2b-256 checksum
How to use checksums
e6e5eb3511cff405afeeea47c34941b4fcc77877269f7186ec6cd82e58876397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL numcertain-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 50.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
c61ab7477efb1c9a944e2244efd532cec7111e9935bc329db489818fcd8fe95a
BLAKE2b-256 checksum
How to use checksums
f0fb07e5cd2243d08e2491b1c338544db7fe86aa4f83dc245e89cf54c40d6426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl

Download URL numcertain-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Size 20.3 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3febd980e018671b5f98fe96497cee1a86db15d50aefeb7c0d069d9cd1c5a2fd
BLAKE2b-256 checksum
How to use checksums
1747a894db5a0c5852034d6f48c14c919ed00cbc50d403d1bc02e3191eff5f83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-win_amd64.whl

Download URL numcertain-0.3.0-cp39-cp39-win_amd64.whl
Size 21.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
2e61e6cbbb67fbde009a4992766fd08c827e062e3c01c385df06a59bdd405d2d
BLAKE2b-256 checksum
How to use checksums
bec2d09ad974f94edb9e11daae261af8c5d9e888ad5bdc023285494a2009a4e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-win32.whl

Download URL numcertain-0.3.0-cp39-cp39-win32.whl
Size 21.0 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
c8d53e258814949cf564e5aeac6455061faa729d680eee1e84aa715c9183b6ec
BLAKE2b-256 checksum
How to use checksums
22ab2dca5a5ef28d6264d31c1cb0a456f27e75d3e47f07f38c04a0d2269de7e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl

Download URL numcertain-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
Size 62.0 kB
Tags CPython 3.9 Linux musl 1.1+ x86-64
SHA-256 checksum
How to use checksums
74e3c48512fdb4384ac45d61ceaddeceef493891f08356ddc6008ab9dded6e30
BLAKE2b-256 checksum
How to use checksums
d203d45e7c37b913121f6db29fdbd189fb832c69a17fa9b851c2852693ff46f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-musllinux_1_1_i686.whl

Download URL numcertain-0.3.0-cp39-cp39-musllinux_1_1_i686.whl
Size 58.9 kB
Tags CPython 3.9 Linux musl 1.1+ x86-32
SHA-256 checksum
How to use checksums
034fa85d3db1aa0847daee6a154a8710ad18795ea8684ebfb9f4bfa07aa510d9
BLAKE2b-256 checksum
How to use checksums
ed567ab75f8ca8b263ab6c6dc6c0234c105fb552986dfc7b510599a0d547861a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL numcertain-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 54.8 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
631e0b48d35aa2af626fd8dfc3156d01d9a2136e88352fccb60aa95d0cf22149
BLAKE2b-256 checksum
How to use checksums
8b7cfdf34020e31d11d4f3484e31c28d6e9cd0ab3d3307f2d78675e9f2db2a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL numcertain-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 50.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
20032bb75ee1927f8666a13917dfda0175bc6eb1c1391899f87058ee19960079
BLAKE2b-256 checksum
How to use checksums
af7e90a350e94923e84f2a8f6c7637a2672619aef7ffba83b84cc6d1b75ace96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / numcertain-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl

Download URL numcertain-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 20.3 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
953268868a721bb636d1b83b584317ee2ec3e1befddeb11b5316c950c09ccc36
BLAKE2b-256 checksum
How to use checksums
f716878c0e96c6165430b826920119c2a92be0e0db15db09984cbc71a3d0ed12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.3.0 This release

22 release files

0.2.0

7 release files

0.1.0

7 release files

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