-
Notifications
You must be signed in to change notification settings - Fork 0
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 parallel search logic #10
base: master
Are you sure you want to change the base?
Conversation
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.
Nice work! I don't spot any obvious problem at this moment.
One question about the stile: in SearchJobInstance
you used the type hints for the return value like def fun(args) -> float:
, do you think it would make sense to consistently use it in all functions? (Along with argument type hints)
Other than that, I like the idea of letting the user define the job class.
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! Left one minor comment
@abstractmethod | ||
def kill(self) -> None: | ||
"""Finish job | ||
""" | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def end(self) -> None: | ||
"""Run any task necessary when done | ||
""" | ||
raise NotImplementedError |
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.
Are these two functions called by anyone? If not, I would not include them in the abstract SearchJobInstance
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.
They are not called now. I thought they might be useful but you are right, they are not needed.
I'll remove them for now :)
Hey guys (@fedetask @CarolinaBianchi @cserranocolome ), so the code is pure garbage but I use it a lot and I wanted to have parallel optimization
So in an effort to make it a bit cleaner I refactored it a bit and added a ParallelSearcher class which schedules calls to SearchJobInstance abstract class.
This SearchJobInstance has to be implemented by the user populating functions to launch a particular job, check if it is finished, get the result and this sort of stuff
Let me know if you have any comments on this (or if you care at all) otherwise I'll just merge it to master. One day it would be nice to make a major cleanup of this repo though