mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 20:13:41 +02:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
d64720b031
3 changed files with 19 additions and 3 deletions
|
@ -584,16 +584,17 @@ class Corr:
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def dump(self, filename):
|
def dump(self, filename, **kwargs):
|
||||||
"""Dumps the Corr into a pickle file
|
"""Dumps the Corr into a pickle file
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
filename : str
|
filename : str
|
||||||
Name of the file
|
Name of the file
|
||||||
|
path : str
|
||||||
|
specifies a custom path for the file (default '.')
|
||||||
"""
|
"""
|
||||||
dump_object(self, filename)
|
dump_object(self, filename, **kwargs)
|
||||||
return
|
|
||||||
|
|
||||||
def print(self, range=[0, None]):
|
def print(self, range=[0, None]):
|
||||||
print(self.__repr__(range))
|
print(self.__repr__(range))
|
||||||
|
|
|
@ -118,6 +118,7 @@ def test_utility():
|
||||||
corr.print([2, 4])
|
corr.print([2, 4])
|
||||||
corr.show()
|
corr.show()
|
||||||
|
|
||||||
|
corr.dump('test_dump', path='.')
|
||||||
corr.dump('test_dump')
|
corr.dump('test_dump')
|
||||||
new_corr = pe.load_object('test_dump.p')
|
new_corr = pe.load_object('test_dump.p')
|
||||||
os.remove('test_dump.p')
|
os.remove('test_dump.p')
|
||||||
|
|
14
tests/mpm_test.py
Normal file
14
tests/mpm_test.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import numpy as np
|
||||||
|
import pyerrors as pe
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
np.random.seed(0)
|
||||||
|
|
||||||
|
|
||||||
|
def test_mpm():
|
||||||
|
corr_content = []
|
||||||
|
for t in range(8):
|
||||||
|
f = 0.8 * np.exp(-0.4 * t)
|
||||||
|
corr_content.append(pe.pseudo_Obs(np.random.normal(f, 1e-2 * f), 1e-2 * f, 't'))
|
||||||
|
|
||||||
|
res = pe.mpm.matrix_pencil_method(corr_content)
|
Loading…
Add table
Add a link
Reference in a new issue