pyerrors.py renamed to obs.py, h5py added as dependency

This commit is contained in:
Fabian Joswig 2021-11-07 11:24:56 +00:00
parent 012bf8ad17
commit 9805ee2b4b
14 changed files with 13 additions and 15 deletions

View file

@ -1,4 +1,4 @@
from .pyerrors import * from .obs import *
from .correlators import * from .correlators import *
from .fits import * from .fits import *
from . import dirac from . import dirac

View file

@ -3,7 +3,7 @@ import numpy as np
import autograd.numpy as anp import autograd.numpy as anp
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import scipy.linalg import scipy.linalg
from .pyerrors import Obs, dump_object, reweight, correlate from .obs import Obs, dump_object, reweight, correlate
from .fits import least_squares from .fits import least_squares
from .linalg import eigh, inv, cholesky from .linalg import eigh, inv, cholesky
from .roots import find_root from .roots import find_root

View file

@ -11,7 +11,7 @@ from scipy.odr import ODR, Model, RealData
import iminuit import iminuit
from autograd import jacobian from autograd import jacobian
from autograd import elementwise_grad as egrad from autograd import elementwise_grad as egrad
from .pyerrors import Obs, derived_observable, covariance, pseudo_Obs from .obs import Obs, derived_observable, covariance, pseudo_Obs
class Fit_result(Sequence): class Fit_result(Sequence):

View file

@ -4,7 +4,7 @@
import ctypes import ctypes
import hashlib import hashlib
import autograd.numpy as np # Thinly-wrapped numpy import autograd.numpy as np # Thinly-wrapped numpy
from ..pyerrors import Obs from ..obs import Obs
def read_ADerrors(file_path, bdio_path='./libbdio.so', **kwargs): def read_ADerrors(file_path, bdio_path='./libbdio.so', **kwargs):

View file

@ -4,7 +4,7 @@
import os import os
import h5py import h5py
import numpy as np import numpy as np
from ..pyerrors import Obs, CObs from ..obs import Obs, CObs
from ..correlators import Corr from ..correlators import Corr
from ..npr import Npr_matrix from ..npr import Npr_matrix

View file

@ -6,7 +6,7 @@ import fnmatch
import re import re
import struct import struct
import numpy as np # Thinly-wrapped numpy import numpy as np # Thinly-wrapped numpy
from ..pyerrors import Obs from ..obs import Obs
def read_pbp(path, prefix, **kwargs): def read_pbp(path, prefix, **kwargs):

View file

@ -6,7 +6,7 @@ import fnmatch
import re import re
import struct import struct
import numpy as np # Thinly-wrapped numpy import numpy as np # Thinly-wrapped numpy
from ..pyerrors import Obs from ..obs import Obs
from ..fits import fit_lin from ..fits import fit_lin

View file

@ -5,7 +5,7 @@ import os
import fnmatch import fnmatch
import re import re
import numpy as np # Thinly-wrapped numpy import numpy as np # Thinly-wrapped numpy
from ..pyerrors import Obs from ..obs import Obs
def read_sfcf(path, prefix, name, **kwargs): def read_sfcf(path, prefix, name, **kwargs):

View file

@ -4,7 +4,7 @@
import numpy as np import numpy as np
from autograd import jacobian from autograd import jacobian
import autograd.numpy as anp # Thinly-wrapped numpy import autograd.numpy as anp # Thinly-wrapped numpy
from .pyerrors import derived_observable, CObs, Obs from .obs import derived_observable, CObs, Obs
from functools import partial from functools import partial
from autograd.extend import defvjp from autograd.extend import defvjp

View file

@ -2,7 +2,7 @@
# coding: utf-8 # coding: utf-8
import numpy as np import numpy as np
from .pyerrors import Obs from .obs import Obs
def gen_correlated_data(means, cov, name, tau=0.5, samples=1000): def gen_correlated_data(means, cov, name, tau=0.5, samples=1000):

View file

@ -3,7 +3,7 @@
import numpy as np import numpy as np
import scipy.linalg import scipy.linalg
from .pyerrors import Obs from .obs import Obs
from .linalg import svd, eig, pinv from .linalg import svd, eig, pinv
@ -105,8 +105,6 @@ def matrix_pencil_method_old(data, p, noise_level=None, verbose=1, **kwargs):
# MoorePenrose pseudoinverse # MoorePenrose pseudoinverse
pinv_y1 = pinv(y1) pinv_y1 = pinv(y1)
# Note: Automatic differentiation of eig is implemented in the git of autograd
# but not yet released to PyPi (1.3). The code is currently part of pyerrors
e = eig((pinv_y1 @ y2), **kwargs) e = eig((pinv_y1 @ y2), **kwargs)
energy_levels = -np.log(np.abs(e)) energy_levels = -np.log(np.abs(e))
return sorted(energy_levels, key=lambda x: abs(x.value)) return sorted(energy_levels, key=lambda x: abs(x.value))

View file

@ -3,7 +3,7 @@
import scipy.optimize import scipy.optimize
from autograd import jacobian from autograd import jacobian
from .pyerrors import derived_observable, pseudo_Obs from .obs import derived_observable, pseudo_Obs
def find_root(d, func, guess=1.0, **kwargs): def find_root(d, func, guess=1.0, **kwargs):

View file

@ -9,5 +9,5 @@ setup(name='pyerrors',
author_email='fabian.joswig@ed.ac.uk', author_email='fabian.joswig@ed.ac.uk',
packages=find_packages(), packages=find_packages(),
python_requires='>=3.6.0', python_requires='>=3.6.0',
install_requires=['numpy>=1.16', 'autograd>=1.2', 'numdifftools', 'matplotlib>=3.3', 'scipy', 'iminuit<2'] install_requires=['numpy>=1.16', 'autograd>=1.2', 'numdifftools', 'matplotlib>=3.3', 'scipy', 'iminuit<2', 'h5py']
) )