Skip to main content

No project description provided

Project description

travis codecov pypi readthedocs

logo

Chaospy is a numerical tool for performing uncertainty quantification using polynomial chaos expansions and advanced Monte Carlo methods implemented in Python 2 and 3.

A article in Elsevier Journal of Computational Science has been published introducing the software: here. If you are to use this software in work that is published, please cite this paper.

Installation

Installation should be straight forward:

pip install chaospy

From Source

Alternativly, to get the most current version, the code can be installed from github as follows:

git clone git@github.com:jonathf/chaospy.git
cd chaospy
pip install -r requirements.txt
python setupy.py install

The last command might need sudo prefix, depending on your python setup.

Optional Packages

Optionally, to support more regression methods, install the Scikit-learn package:

pip install scikit-learn

Example Usage

chaospy is created to be simple and modular. A simple script to implement point collocation method will look as follows:

>>> import chaospy as cp
>>> import numpy as np

>>> def foo(coord, prm): # your code wrapper goes here
...     return prm[0] * np.e ** (-prm[1] * np.linspace(0, 10, 100))

>>> distribution = cp.J(
...     cp.Uniform(1, 2),
...     cp.Uniform(0.1, 0.2)
... )

>>> polynomial_expansion = cp.orth_ttr(8, distribution)

>>> foo_approx = cp.fit_regression(
...     polynomial_expansion, samples, evals)

>>> expected = cp.E(foo_approx, distribution)
>>> deviation = cp.Std(foo_approx, distribution)

For a more extensive description of what going on, see the tutorial. For a collection of reciepies, see the cookbook.

Testing

To test the build locally:

pip install -r requirements-dev.txt
python setup.py test

It will run pytest-runner and execute all tests.

Questions & Troubleshooting

For any problems and questions you might have related to chaospy, please feel free to file an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for chaospy, version 2.1.1
Filename, size File type Python version Upload date Hashes
Filename, size chaospy-2.1.2-py2.py3-none-any.whl (146.9 kB) File type Wheel Python version any Upload date Hashes View
Filename, size chaospy-2.1.3-py2.py3-none-any.whl (146.9 kB) File type Wheel Python version any Upload date Hashes View
Filename, size chaospy-2.1.4-py2.py3-none-any.whl (151.9 kB) File type Wheel Python version any Upload date Hashes View
Filename, size chaospy-2.2.0-py2.py3-none-any.whl (223.1 kB) File type Wheel Python version any Upload date Hashes View
Filename, size chaospy-2.2.0.tar.gz (117.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page