Commit 39d37b0b authored by Gregory Ashton's avatar Gregory Ashton

Merge branch 'add-catch-for-broken-resume-false' into 'master'

Add a catch for broken resume files

See merge request !517
parents 23a4ff2c 1c537b0b
Pipeline #66474 passed with stages
in 6 minutes and 8 seconds
......@@ -307,10 +307,14 @@ class Dynesty(NestedSampler):
if os.path.isfile(self.resume_file):
logger.info("Reading resume file {}".format(self.resume_file))
with open(self.resume_file, 'rb') as file:
saved = pickle.load(file)
logger.info(
"Succesfuly read resume file {}".format(self.resume_file))
try:
with open(self.resume_file, 'rb') as file:
saved = pickle.load(file)
logger.info(
"Succesfuly read resume file {}".format(self.resume_file))
except EOFError as e:
logger.warning("Resume file reading failed with error {}".format(e))
return False
self.sampler.saved_u = list(saved['unit_cube_samples'])
self.sampler.saved_v = list(saved['physical_samples'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment