-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added max_time to calibration settings #56
Conversation
…r change, so that multiprocessing results are all evaluated and not unnecessarily stopped by either max_time or max_iterations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, only two comments. You can merge afterwards.
|
||
if time.perf_counter() - self.start_time > self.max_time: | ||
raise MaxTimeReached( | ||
f"Terminating calibration as the maximum time of {self.max_time}s has been " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace between number and unit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -113,6 +113,7 @@ def __init__(self, | |||
self.perform_square_deviation = kwargs.pop("square_deviation", False) | |||
self.result_path = kwargs.pop('result_path', None) | |||
self.max_itercount = kwargs.pop('max_itercount', np.inf) | |||
self.max_time = kwargs.pop('max_time', np.inf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this to the docstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Added functionality to set a maximum calibration time. Added general check for max_iteration and max_time and changed place of that, so that when using multiprocessing a termination is only done after the results of one multiprocessing round are evaluated, to not unnecessarily ignore finished results.
Closes #55