mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
README updated
This commit is contained in:
parent
1acb959093
commit
4d394975c5
2 changed files with 5 additions and 5 deletions
|
@ -24,8 +24,8 @@ For all pull requests to the `develop` branch tests are executed for the most re
|
||||||
```
|
```
|
||||||
pytest -v
|
pytest -v
|
||||||
```
|
```
|
||||||
and `flake8` is executed with the command
|
and the linter `flake8` is executed with the command
|
||||||
```
|
```
|
||||||
flake8 --ignore=E501,E722 --exclude=__init__.py pyerrors
|
flake8 --ignore=E501,E722 --exclude=__init__.py pyerrors
|
||||||
```
|
```
|
||||||
Please make sure that all tests are passed for a new pull request.
|
Please make sure that all tests are passed for a new pull requests.
|
||||||
|
|
|
@ -22,21 +22,21 @@ pip install git+https://github.com/fjosw/pyerrors.git
|
||||||
## Usage
|
## Usage
|
||||||
The basic objects of a pyerrors analysis are instances of the class `Obs`. They can be initialized with an array of Monte Carlo data (e.g. `samples1`) and a name for the given ensemble (e.g. `'ensemble1'`). The `gamma_method` can then be used to compute the statistical error, taking into account autocorrelations. The `print` method outputs a human readable result.
|
The basic objects of a pyerrors analysis are instances of the class `Obs`. They can be initialized with an array of Monte Carlo data (e.g. `samples1`) and a name for the given ensemble (e.g. `'ensemble1'`). The `gamma_method` can then be used to compute the statistical error, taking into account autocorrelations. The `print` method outputs a human readable result.
|
||||||
```python
|
```python
|
||||||
import numpy as np
|
|
||||||
import pyerrors as pe
|
import pyerrors as pe
|
||||||
|
|
||||||
obs1 = pe.Obs([samples1], ['ensemble1'])
|
obs1 = pe.Obs([samples1], ['ensemble1'])
|
||||||
obs1.gamma_method()
|
obs1.gamma_method()
|
||||||
obs1.print()
|
obs1.print()
|
||||||
```
|
```
|
||||||
Often one is interested in secondary observables which can be arbitrary functions of primary observables. `pyerrors` overloads most basic math operations and numpy functions such that the user can work with `Obs` objects as if they were floats
|
Often one is interested in secondary observables which can be arbitrary functions of primary observables. `pyerrors` overloads most basic math operations and `numpy` functions such that the user can work with `Obs` objects as if they were floats
|
||||||
```python
|
```python
|
||||||
|
import numpy as np
|
||||||
obs3 = 12.0 / obs1 ** 2 - np.exp(-1.0 / obs2)
|
obs3 = 12.0 / obs1 ** 2 - np.exp(-1.0 / obs2)
|
||||||
obs3.gamma_method()
|
obs3.gamma_method()
|
||||||
obs3.print()
|
obs3.print()
|
||||||
```
|
```
|
||||||
|
|
||||||
More detailed examples can be found in the `/examples` folder:
|
More detailed examples can be found in the `examples` folder:
|
||||||
|
|
||||||
* [01_basic_example](examples/01_basic_example.ipynb)
|
* [01_basic_example](examples/01_basic_example.ipynb)
|
||||||
* [02_correlators](examples/02_correlators.ipynb)
|
* [02_correlators](examples/02_correlators.ipynb)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue