You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reduction "dtype" is required but docstring says optional #6278
I'm playing around with the dask.array.reduction function while working on a custom algorithm and was confused when I got a ValueError for not specifying the dtype when the docstring says it is optional and will default to x.dtype if not provided. See:
Either do the default that the docstring says or make dtype a required argument.
Minimal Complete Verifiable Example:
I can make one if you really need it, but this is more of a behavioral question about what is actually desired. Is defaulting to the input array's dtype going to cause issues in the future (has it happened in other dask functions)? If so, I'll update the docstring and make a PR. If not, I'll update the code to default to x.dtype.
Thanks @djhoese for reporting this. I think if dtype isn't provided it should be inferred from doing the operation on meta like map_blocks does. As far as I can tell, this mandatory dtype was implemented in #1755, so I'm pinging @jcrist in case he has input on what the behavior should be.
Activity
jsignell commentedon Jun 2, 2020
Thanks @djhoese for reporting this. I think if dtype isn't provided it should be inferred from doing the operation on
metalikemap_blocksdoes. As far as I can tell, this mandatorydtypewas implemented in #1755, so I'm pinging @jcrist in case he has input on what the behavior should be.