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
Add missing meta kwarg to gufunc class #7423
Conversation
Reposting #7384 (comment) here to provide a brief explanation on what this PR is attempting to resolve:
|
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.
Thank you for writing this up @pentschev and sorry I didn't review it sooner. It seems to me that this is a clear improvement and if we want to finesse how other kwargs are handled in the future we can reasonably do that as well. Having the meta
as a kwarg is a good escape hatch.
@@ -560,6 +560,9 @@ class gufunc: | |||
dimensions are to consist only of one chunk. | |||
Warning: enabling this can increase memory usage significantly. | |||
Defaults to ``False``. | |||
meta: Optional, tuple, keyword only | |||
tuple of empty ndarrays describing the shape and dtype of the output of the gufunc. |
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.
tuple of empty ndarrays describing the shape and dtype of the output of the gufunc. | |
tuple of empty ndarrays describing the type of array and dtype of the output of the gufunc. |
@@ -602,6 +616,7 @@ def __init__(self, pyfunc, **kwargs): | |||
self.output_sizes = kwargs.pop("output_sizes", None) | |||
self.output_dtypes = kwargs.pop("output_dtypes", None) | |||
self.allow_rechunk = kwargs.pop("allow_rechunk", False) | |||
self.meta = kwargs.pop("meta", 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.
Should we check, and throw a warning in case of, mismatch between output_dtypes
and the dtypes as given in meta
?
@jsignell Oops, I had still noticed two small improvements to this PR... Sorry, for not giving input sooner, had other stuff on my plate. Just too late I guess. |
No worries, you are welcome to open another PR with these changes if you like :) |
black dask
/flake8 dask