Skip to content

DOC: Recommend the use of np.ndim over np.isscalar, and explain the differences #11882

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 1 commit into from
Sep 8, 2018

Conversation

eric-wieser
Copy link
Member

Brought on by #4701

@eric-wieser
Copy link
Member Author

eric-wieser commented Sep 5, 2018

Places where we still use isscalar internally sensibly:

  • assert_equal - probably harmless
  • linspace - used as an optimization check without breaking duck-types

Places where we shouldn't be using it:

  • np.poly1d - Only used in an optimization path. Since this is pseudo-deprecated anyway, it's not worth touching this..
  • np.matrix - Cause of a bug - m[:, np.array(0)] is the transpose of a[:, 0]. Not worth fixing since matrix is in many ways broken by design
  • np.piecewise - used for an undocumented special case that probably shouldn't exist in the first place.
  • np.ma.apply_along_axis - Cause of a bug, fixed in MAINT: make np.ma.apply_along_axis consistent with np.apply_along_axis #8511

Places where we no longer do because it caused issues:

Copy link
Contributor

@jeffyancey jeffyancey left a comment

Choose a reason for hiding this comment

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

TIL! Looks good to me, the table is very informative.

@dopplershift
Copy link

Very informative--I learned a lot just reading this PR.

@eric-wieser
Copy link
Member Author

@charris, can you restart the appveyor build?

Although probably safe to ignore, since this is a doc-only change

@mattip
Copy link
Member

mattip commented Sep 6, 2018

Apparently it is not possible to restart single jobs on AppVeyor

@eric-wieser
Copy link
Member Author

eric-wieser commented Sep 6, 2018

Right now it's not even possible for me to restart the whole appveyor run, since the appveyor account is not the org one (as discussed elsewhere).

Seems wasteful to rerun all the tests on a doc-only just because appveyor failed

@rgommers
Copy link
Member

rgommers commented Sep 6, 2018

Seems wasteful to rerun all the tests on a doc-only just because appveyor failed

agreed

@rgommers rgommers added this to the 1.16.0 release milestone Sep 6, 2018
@charris charris merged commit 639004c into numpy:master Sep 8, 2018
@charris
Copy link
Member

charris commented Sep 8, 2018

Thanks Eric.

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.

6 participants