Merge branch 'develop' into documentation

This commit is contained in:
fjosw 2022-06-14 14:14:32 +00:00
commit 20b74384ef
6 changed files with 17 additions and 4 deletions

View file

@ -40,6 +40,7 @@ jobs:
pip install pytest
pip install pytest-cov
pip install pytest-benchmark
pip freeze
- name: Run tests
run: pytest --cov=pyerrors -vv

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ core.*
htmlcov
build
pyerrors.egg-info
dist

View file

@ -602,7 +602,7 @@ class Corr:
if variant == 'log':
newcontent = []
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)
else:
newcontent.append(self.content[t] / self.content[t + 1])
@ -622,7 +622,7 @@ class Corr:
newcontent = []
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)
# 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]:
@ -637,7 +637,7 @@ class Corr:
elif variant == 'arccosh':
newcontent = []
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)
else:
newcontent.append((self.content[t + 1] + self.content[t - 1]) / (2 * self.content[t]))

View file

@ -1,10 +1,16 @@
from setuptools import setup, find_packages
from pathlib import Path
from distutils.util import convert_path
this_directory = Path(__file__).parent
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',
version='2.2.0+dev',
version=version['__version__'],
description='Error analysis for lattice QCD',
long_description=long_description,
long_description_content_type='text/markdown',

View file

@ -1,6 +1,7 @@
import os
import numpy as np
import scipy
import matplotlib.pyplot as plt
import pyerrors as pe
import pytest
@ -440,6 +441,7 @@ def test_spaghetti_plot():
corr.spaghetti_plot(True)
corr.spaghetti_plot(False)
plt.close('all')
def _gen_corr(val, samples=2000):

View file

@ -1,6 +1,7 @@
import autograd.numpy as np
import os
import copy
import matplotlib.pyplot as plt
import pyerrors as pe
import pytest
@ -56,6 +57,7 @@ def test_Obs_exceptions():
one.gamma_method()
with pytest.raises(Exception):
one.plot_piechart()
plt.close('all')
def test_dump():
value = np.random.normal(5, 10)
@ -368,6 +370,7 @@ def test_utils():
assert my_obs < (my_obs + 1)
float(my_obs)
str(my_obs)
plt.close('all')
def test_cobs():