Open ngoldbaum opened 4 years ago
I think the most straightforward way to support this would be to cast the arguments to ndarray and just ignore the units. That's more useful than completely erroring out. We could probably also print a warning saying that the units are being ignored.
I don't think we can support ufuncs generated via frompyfunc
without degrading to ignoring the units because we'd have no ability to introspect and determine what the units should be.
Description
Right now using a function wrapped with
np.vectorize
ornp.frompyfunc
raises an error.This was originally reported against yt as https://github.com/yt-project/yt/issues/2465.
What I Did
Running this script:
Produces the following traceback:
Similarly:
For what it's worth, astropy produces exactly the same error: