Skip to content
Snippets Groups Projects
Commit bf501b17 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Add a check to make sure the sampling time exists before trying to update

For runs cancelled during the marginalized parameter reconstruction,
this can lead to cases where the start_time isn't defined causing an
attribute error. This ensures that doesn't occur.
parent 88ecd92e
No related branches found
No related tags found
No related merge requests found
...@@ -436,8 +436,9 @@ class Dynesty(NestedSampler): ...@@ -436,8 +436,9 @@ class Dynesty(NestedSampler):
logger.info("Writing checkpoint file {}".format(self.resume_file)) logger.info("Writing checkpoint file {}".format(self.resume_file))
end_time = datetime.datetime.now() end_time = datetime.datetime.now()
self.sampling_time += end_time - self.start_time if hasattr(self, 'start_time'):
self.start_time = end_time self.sampling_time += end_time - self.start_time
self.start_time = end_time
current_state = dict( current_state = dict(
unit_cube_samples=self.sampler.saved_u, unit_cube_samples=self.sampler.saved_u,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment