File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1010import math
1111import copy
1212import time
13- import pickle
1413import os
1514from collections import namedtuple
1615from functools import partial
1716import numpy as np
1817from scipy .special import logsumexp
19-
18+ import pickle as pickle_module
19+ # To allow replacing of the pickler
2020try :
2121 import tqdm
2222except ImportError :
@@ -1697,7 +1697,7 @@ def restore_sampler(fname, pool=None):
16971697 """
16981698 from ._version import __version__ as DYNESTY_VERSION
16991699 with open (fname , 'rb' ) as fp :
1700- res = pickle .load (fp )
1700+ res = pickle_module .load (fp )
17011701 sampler = res ['sampler' ]
17021702 save_ver = res ['version' ]
17031703 dynesty_format_version = 1
@@ -1744,7 +1744,7 @@ def save_sampler(sampler, fname):
17441744 tmp_fname = fname + '.tmp'
17451745 try :
17461746 with open (tmp_fname , 'wb' ) as fp :
1747- pickle .dump (D , fp )
1747+ pickle_module .dump (D , fp )
17481748 os .rename (tmp_fname , fname )
17491749 except : # noqa
17501750 try :
You can’t perform that action at this time.
0 commit comments