mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
20b74384ef
6 changed files with 17 additions and 4 deletions
1
.github/workflows/pytest.yml
vendored
1
.github/workflows/pytest.yml
vendored
|
@ -40,6 +40,7 @@ jobs:
|
||||||
pip install pytest
|
pip install pytest
|
||||||
pip install pytest-cov
|
pip install pytest-cov
|
||||||
pip install pytest-benchmark
|
pip install pytest-benchmark
|
||||||
|
pip freeze
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pytest --cov=pyerrors -vv
|
run: pytest --cov=pyerrors -vv
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -12,3 +12,4 @@ core.*
|
||||||
htmlcov
|
htmlcov
|
||||||
build
|
build
|
||||||
pyerrors.egg-info
|
pyerrors.egg-info
|
||||||
|
dist
|
||||||
|
|
|
@ -602,7 +602,7 @@ class Corr:
|
||||||
if variant == 'log':
|
if variant == 'log':
|
||||||
newcontent = []
|
newcontent = []
|
||||||
for t in range(self.T - 1):
|
for t in range(self.T - 1):
|
||||||
if (self.content[t] is None) or (self.content[t + 1] is None):
|
if ((self.content[t] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0):
|
||||||
newcontent.append(None)
|
newcontent.append(None)
|
||||||
else:
|
else:
|
||||||
newcontent.append(self.content[t] / self.content[t + 1])
|
newcontent.append(self.content[t] / self.content[t + 1])
|
||||||
|
@ -622,7 +622,7 @@ class Corr:
|
||||||
|
|
||||||
newcontent = []
|
newcontent = []
|
||||||
for t in range(self.T - 1):
|
for t in range(self.T - 1):
|
||||||
if (self.content[t] is None) or (self.content[t + 1] is None):
|
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t + 1][0].value == 0):
|
||||||
newcontent.append(None)
|
newcontent.append(None)
|
||||||
# Fill the two timeslices in the middle of the lattice with their predecessors
|
# Fill the two timeslices in the middle of the lattice with their predecessors
|
||||||
elif variant == 'sinh' and t in [self.T / 2, self.T / 2 - 1]:
|
elif variant == 'sinh' and t in [self.T / 2, self.T / 2 - 1]:
|
||||||
|
@ -637,7 +637,7 @@ class Corr:
|
||||||
elif variant == 'arccosh':
|
elif variant == 'arccosh':
|
||||||
newcontent = []
|
newcontent = []
|
||||||
for t in range(1, self.T - 1):
|
for t in range(1, self.T - 1):
|
||||||
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t - 1] is None):
|
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t - 1] is None) or (self.content[t][0].value == 0):
|
||||||
newcontent.append(None)
|
newcontent.append(None)
|
||||||
else:
|
else:
|
||||||
newcontent.append((self.content[t + 1] + self.content[t - 1]) / (2 * self.content[t]))
|
newcontent.append((self.content[t + 1] + self.content[t - 1]) / (2 * self.content[t]))
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -1,10 +1,16 @@
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from distutils.util import convert_path
|
||||||
|
|
||||||
this_directory = Path(__file__).parent
|
this_directory = Path(__file__).parent
|
||||||
long_description = (this_directory / "README.md").read_text()
|
long_description = (this_directory / "README.md").read_text()
|
||||||
|
|
||||||
|
version = {}
|
||||||
|
with open(convert_path('pyerrors/version.py')) as ver_file:
|
||||||
|
exec(ver_file.read(), version)
|
||||||
|
|
||||||
setup(name='pyerrors',
|
setup(name='pyerrors',
|
||||||
version='2.2.0+dev',
|
version=version['__version__'],
|
||||||
description='Error analysis for lattice QCD',
|
description='Error analysis for lattice QCD',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy
|
import scipy
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
import pyerrors as pe
|
import pyerrors as pe
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -440,6 +441,7 @@ def test_spaghetti_plot():
|
||||||
|
|
||||||
corr.spaghetti_plot(True)
|
corr.spaghetti_plot(True)
|
||||||
corr.spaghetti_plot(False)
|
corr.spaghetti_plot(False)
|
||||||
|
plt.close('all')
|
||||||
|
|
||||||
|
|
||||||
def _gen_corr(val, samples=2000):
|
def _gen_corr(val, samples=2000):
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import autograd.numpy as np
|
import autograd.numpy as np
|
||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
import pyerrors as pe
|
import pyerrors as pe
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ def test_Obs_exceptions():
|
||||||
one.gamma_method()
|
one.gamma_method()
|
||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
one.plot_piechart()
|
one.plot_piechart()
|
||||||
|
plt.close('all')
|
||||||
|
|
||||||
def test_dump():
|
def test_dump():
|
||||||
value = np.random.normal(5, 10)
|
value = np.random.normal(5, 10)
|
||||||
|
@ -368,6 +370,7 @@ def test_utils():
|
||||||
assert my_obs < (my_obs + 1)
|
assert my_obs < (my_obs + 1)
|
||||||
float(my_obs)
|
float(my_obs)
|
||||||
str(my_obs)
|
str(my_obs)
|
||||||
|
plt.close('all')
|
||||||
|
|
||||||
|
|
||||||
def test_cobs():
|
def test_cobs():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue