# friedrichromstedt/upy

upy is a package for calculating error propagation in the programming language Python. For the needed derivative information, automatic differentiation (AD) is used. (AD is also known under the name algorithmic differentiation.) upy is based on numpy, and can be used to store multidimensional arrays with uncertainty.
Python
Switch branches/tags
Nothing to show
Fetching latest commitâ€¦
Cannot retrieve the latest commit at this time.
 Failed to load latest commit information. README.rst __init__.py averaging.py characteristic.py core.py decimal2.py dependency.py id_generator.py linear_regression.py operators.py printable.py setup.py test.py umath.py

# upy Tutorial

## Webcast

There is a webcast on the sourceforge page, presenting a talk on `upy` by me. Its auditory should match you, although I'm not sure how well I matched the auditory :-).

## Example Python Session

Here is a small Python shell session:

```Python 2.6.5 (r265:79063, Jul 18 2010, 12:14:53)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin

>>> import upy
>>> ua = upy.undarray(2, 0.1)
>>> ub = upy.undarray(10, 0.05)
>>> print ua, ub
(2.00 +- 0.10) 10^0  (1.0000 +- 0.0051) 10^1
>>> print ub.printable(format='float')
10.000 +- 0.050
>>> print ua * ub
(2.00 +- 0.11) 10^1
>>> print upy.cos(ua * ub) + ub
(1.041 +- 0.092) 10^1

>>> uc = upy.undarray([[1, 2], [3, 4]], [[0.1, 0.5], [0.7, 2]])
>>> print uc
[[(1.00 +- 0.10) 10^0  (2.00 +- 0.50) 10^0 ]
[(3.00 +- 0.70) 10^0  (4.0  +- 2.0 ) 10^0 ]]

>>> ^D
Python-32(3414) malloc: *** error for object 0x239670: incorrect checksum