8000 BUG: Errors thrown by 0d arrays in setitem are silenced and replaced by eric-wieser · Pull Request #9752 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Errors thrown by 0d arrays in setitem are silenced and replaced #9752

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 24, 2017

Conversation

eric-wieser
Copy link
Member

Fixes gh-8461

a_u[()] = np.ma.masked
assert_equal(a_u[()], u'--')

@dec.knownfailureif(True, "See gh-9750")
Copy link
Member Author

Choose a reason for hiding this comment

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

#9750 and #9751 are not new bugs from this patch - they're in 1.13 too

@eric-wieser eric-wieser force-pushed the workaround-numeric-setitem branch from 98e6149 to df79005 Compare September 23, 2017 16:28
Copy link
Contributor
@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

This looks good, modulo the nitpick on the name. What message does one get now? (in python3?)

@@ -36,6 +36,16 @@
#include <limits.h>
#include <assert.h>

/* check for sequences, but ignore the types numpy considers scalars */
static NPY_INLINE npy_bool
MyPySequence_Check(PyObject *op) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this, perhaps call it PySequence_NoString_Check? (Think it is fine not to mention the array scalar - that more obviously is not a sequence.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Name fixed

@eric-wieser
Copy link
Member Author

The error now is something about not being able to convert masked constant to int.

@eric-wieser eric-wieser force-pushed the workaround-numeric-setitem branch from df79005 to f61f65a Compare September 23, 2017 20:08
@@ -36,6 +36,16 @@
#include <limits.h>
#include <assert.h>

/* check for sequences, but ignore the types numpy considers scalars */
static NPY_INLINE npy_bool
PySequence_Check(PyObject *op) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Forgot to change the name in its definition...

@eric-wieser eric-wieser force-pushed the workaround-numeric-setitem branch from f61f65a to 8e26a5d Compare September 23, 2017 20:21
@charris charris merged commit b79b09f into numpy:master Sep 24, 2017
@charris
Copy link
Member
charris commented Sep 24, 2017

LGTM, thanks Eric, Marten.

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
0