Skip to content

Update 7612, ENH: Add broadcast.ndim to match code elsewhere. #7754

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

Merged
merged 2 commits into from
Jun 17, 2016

Conversation

charris
Copy link
Member

@charris charris commented Jun 17, 2016

#7612.

Both ndarray and nditer call it ndim, so broadcast objects should too.

Both `ndarray` and `nditer` spell this property `ndim`, so broadcast
objects should too. The existing property remains for compatibility
add_newdoc('numpy.core', 'broadcast', ('nd',
"""
Number of dimensions of broadcasted result.
Number of dimensions of broadcasted result. For code intended for Numpy
1.12.0 and later the more consistent `ndim` if preferred.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "if" -> "is"

@mhvk
Copy link
Contributor

mhvk commented Jun 17, 2016

looks good modulo the typo.

Note that the newly added `ndim` property is an alias for `nd` and
not available in numpy versions earlier than 1.12.

Add back the tests for `nd`. They can be removed if/when `nd` is
dropped.
@charris
Copy link
Member Author

charris commented Jun 17, 2016

Fixed.

@charris charris merged commit d3afd50 into numpy:master Jun 17, 2016
@charris charris deleted the update-7612 branch June 17, 2016 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants