Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!742Catch signal error in dynesty
Pipeline #121330 passed with warnings
......@@ -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" """
......
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