-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bnb/ddh norm #180
Bnb/ddh norm #180
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.
Might have a few negative tests fail that i added recently, i can handle them if you want.
else: | ||
with ThreadPoolExecutor(max_workers=max_workers) as exe: | ||
futures = {} | ||
now = dt.now() | ||
for idh, dh in enumerate(self.data_handlers): | ||
future = exe.submit(dh.normalize, self.means, self.stds, | ||
max_workers=1) | ||
max_workers=dh.norm_workers) |
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.
Is there a specific reason you would want a worker to spin up more threads within a thread pool? Historically i've been very cautious of this. I don't want my threads/processes to be forking themselves.
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.
Yeah that's fair. Makes sense to go back to 1
self._raw_data.pop(t) | ||
|
||
def parallel_data_fill(self, shifted_time_chunks, max_workers=None): | ||
def data_fill(self, shifted_time_chunks, max_workers=None): |
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.
Not a huge fan of this naming convention. I always find it confusing when there is a .method
and a ._method
. I think you're trying to hide the serial method from the "public" view but it makes the developer's job more confusing. I'd suggest _single_data_fill()
and _data_fill()
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.
I renamed this just bc it includes the serial method also so its not strictly "parallel"
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.
Yeah understood but I think _single*()
and _data_fill()
would be the most clear, dont you think?
No description provided.