-
Notifications
You must be signed in to change notification settings - Fork 9
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
DM-12766: Add __reduce__ to CoaddDriver so to know how to pickle #41
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.
A couple of style changes requested, and one important omission: the __reduce__
method doesn't preserve the reuse
argument.
def __reduce__(self): | ||
"""Pickler""" | ||
return unpickle, (self.__class__, [], dict(config=self.config, name=self._name, | ||
parentTask=self._parentTask, log=self.log)) |
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.
Indent to match paren above.
def unpickle(factory, args, kwargs): | ||
"""Unpickle something by calling a factory""" | ||
return factory(*args, **kwargs) | ||
|
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.
Two lines between function and class.
def __reduce__(self): | ||
"""Pickler""" | ||
return unpickle, (self.__class__, [], dict(config=self.config, name=self._name, | ||
parentTask=self._parentTask, log=self.log)) |
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.
Where's reuse
?
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.
Thanks for the catch. Adding it to MultiBandDriver too.
8e41c51
to
5d3342f
Compare
5d3342f
to
1492ab6
Compare
Running coaddDriver with cores >1 has been producing
MPI_Abort(MPI_COMM_WORLD, 1)