Merge branch 'develop' into feature/covobs

This commit is contained in:
Simon Kuberski 2021-11-29 15:45:25 +01:00
commit 9db709a171
9 changed files with 135 additions and 176 deletions

View file

@ -1578,38 +1578,6 @@ def pseudo_Obs(value, dvalue, name, samples=1000):
return res
def dump_object(obj, name, **kwargs):
"""Dump object into pickle file.
Parameters
----------
obj : object
object to be saved in the pickle file
name : str
name of the file
path : str
specifies a custom path for the file (default '.')
"""
if 'path' in kwargs:
file_name = kwargs.get('path') + '/' + name + '.p'
else:
file_name = name + '.p'
with open(file_name, 'wb') as fb:
pickle.dump(obj, fb)
def load_object(path):
"""Load object from pickle file.
Parameters
----------
path : str
path to the file
"""
with open(path, 'rb') as file:
return pickle.load(file)
def import_jackknife(jacks, name, idl=None):
"""Imports jackknife samples and returns an Obs