From 8aa3fba222ecad11226787324f541d82a3b02cc9 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sat, 23 Oct 2021 17:02:50 +0100 Subject: [PATCH 1/2] README updated --- README.md | 10 +++++++--- setup.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e67157ea..d1f22b1e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![flake8](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![CI](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml) [![](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/) +[![flake8](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![Build/Test](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml) [![](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/) # pyerrors `pyerrors` is a python package for error computation and propagation of Markov chain Monte Carlo data. It is based on the **gamma method** [arXiv:hep-lat/0306017](https://arxiv.org/abs/hep-lat/0306017). Some of its features are: @@ -16,7 +16,11 @@ There exist similar implementations of gamma method error analysis suites in ## Installation To install the most recent release of `pyerrors` run ```bash -pip install git+https://github.com/fjosw/pyerrors.git +pip install git+https://github.com/fjosw/pyerrors.git@master +``` +to install the current `develop` version run +```bash +pip install git+https://github.com/fjosw/pyerrors.git@develop ``` ## Usage @@ -31,6 +35,7 @@ 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 ```python import numpy as np + obs3 = 12.0 / obs1 ** 2 - np.exp(-1.0 / obs2) obs3.gamma_method() obs3.print() @@ -44,6 +49,5 @@ More detailed examples can be found in the `examples` folder: * [04_fit_example](examples/04_fit_example.ipynb) * [05_matrix_operations](examples/05_matrix_operations.ipynb) - ## License [MIT](https://choosealicense.com/licenses/mit/) diff --git a/setup.py b/setup.py index df32d698..20e4803b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup(name='pyerrors', - version='1.1.0', + version='2.0.0', description='Error analysis for lattice QCD', author='Fabian Joswig', author_email='fabian.joswig@ed.ac.uk', From e1fd4606d3b770bfe1655fc8122b5f0bda36be98 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sat, 23 Oct 2021 17:24:39 +0100 Subject: [PATCH 2/2] Tests made more rigorous --- tests/test_linalg.py | 8 ++------ tests/test_pyerrors.py | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_linalg.py b/tests/test_linalg.py index b978b35b..49a1aaa0 100644 --- a/tests/test_linalg.py +++ b/tests/test_linalg.py @@ -94,15 +94,11 @@ def test_matrix_functions(): for (i, j), entry in np.ndenumerate(check): diff = entry - sym[i, j] - diff.gamma_method() - assert math.isclose(diff.value, 0.0, abs_tol=1e-9), 'value ' + str(i) + ',' + str(j) - assert math.isclose(diff.dvalue, 0.0, abs_tol=1e-9), 'dvalue ' + str(i) + ',' + str(j) + assert diff.is_zero() # Check eigh e, v = pe.linalg.eigh(sym) for i in range(dim): tmp = sym @ v[:, i] - v[:, i] * e[i] for j in range(dim): - tmp[j].gamma_method() - assert math.isclose(tmp[j].value, 0.0, abs_tol=1e-9), 'value ' + str(i) + ',' + str(j) - assert math.isclose(tmp[j].dvalue, 0.0, abs_tol=1e-9), 'dvalue ' + str(i) + ',' + str(j) + assert tmp[j].is_zero() diff --git a/tests/test_pyerrors.py b/tests/test_pyerrors.py index 2740d5d9..39192c6f 100644 --- a/tests/test_pyerrors.py +++ b/tests/test_pyerrors.py @@ -245,4 +245,4 @@ def test_cobs(): assert np.allclose(0.0, diff.real.deltas['t']) assert np.allclose(0.0, diff.imag.deltas['t']) - div = my_cobs / other + assert (my_cobs / other * other - my_cobs).is_zero()