Commit 19d44d79 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Merge branch 'catch_signal_error_dynesty' into 'master'

Catch signal error in dynesty

See merge request !742
parents 7fd4c279 f7e89901
Pipeline #121330 passed with stages
in 6 minutes and 53 seconds
......@@ -166,9 +166,15 @@ class Dynesty(NestedSampler):
self.sampling_time = datetime.timedelta()
self.exit_code = exit_code
signal.signal(signal.SIGTERM, self.write_current_state_and_exit)
signal.signal(signal.SIGINT, self.write_current_state_and_exit)
signal.signal(signal.SIGALRM, self.write_current_state_and_exit)
try:
signal.signal(signal.SIGTERM, self.write_current_state_and_exit)
signal.signal(signal.SIGINT, self.write_current_state_and_exit)
signal.signal(signal.SIGALRM, self.write_current_state_and_exit)
except AttributeError:
logger.debug(
"Setting signal attributes unavailable on this system. "
"This is likely the case if you are running on a Windows machine"
" and is no further concern.")
def __getstate__(self):
""" For pickle: remove external_sampler, which can be an unpicklable "module" """
......
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