-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Fixed meshgrid to return arrays with same dtype as arguments. #5302
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
Conversation
return [x * mult_fact for x in output] | ||
else: | ||
return np.broadcast_arrays(*output) | ||
output = np.broadcast_arrays(*output) |
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.
Might want subok=True
here to match the asanyarray
above. Otherwise LGTM.
Should probably add a check that the input arrays are all 1-D. |
NVM, looks like that inputs are all flattened, at least if they aren't matrices. That should be in the documentation somewhere. |
LGTM in general, just need to decide on the |
Makes sense, but I wonder if we should put it into the release notes. If you used to have an integer arange input and now use meshgrid, it seems like you used to get floats. That could create annoying casting issues. |
I just ran into this and was about to file a bug. What's keeping this from being merged? |
I added subok=True in the call to broadcast_arrays as per charris' comments. Can someone please look at merging this? Please let me know if there is anything else I can do. |
That doesn't seem to be the case, with numpy 1.11.1:
Changing output dtypes of |
makes sense to change that. |
Merged, thanks @idfah |
Fixes issue with meshgrid discussed in issue #5297.
A few things to note:
copy=False
had been set.