-
Notifications
You must be signed in to change notification settings - Fork 46
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
Inconsistent behaviour between np.arange and np.linspace #50
Comments
I doubt there’s anything we can do about this without defining a wrapper around arange that behaves as you’re expecting. It may be the case that in the future we could override this with |
|
Yet another case where arrays-with-units are special: we want scalars with units to work seamlessly too :) |
I am not sure if this is the right place to bring this up, but it would great to be able to define custom dispatching for function like I guess one option would be for to NumPy to dispatch on scalars as well as arrays. Is this incompatible with the NEP? Would anything break with this change? EDIT: Moved here numpy/numpy#12028 (comment) |
I'm pretty sure that's a question for the numpy issue tracker or mailing list, not for the unyt bug tracker :) |
@ngoldbaum Sorry! I was clicking around on issues and didn't realize I had switched repos :) |
Description
When using
np.arange
on quantities, I'd expect the result to be a unyt_array, just like when usingnp.linspace
. The result, however, is a standard numpy array.What I Did
The text was updated successfully, but these errors were encountered: