Skip to content
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

DEP: Complete deprecation of invalid array/memory order #14596

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

sethtroisi
Copy link
Contributor

Original deprecation was submitted in #6823 in 2015.

return NPY_SUCCEED;
/* 2015-12-14, 1.11 DEPRECATED */
/* 2019-09-25, 1.18 ERROR */
PyErr_SetString(PyExc_ValueError, "Non-string object detected for "
Copy link
Member

Choose a reason for hiding this comment

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

I think for errors I prefer the formatting:

PyErr_SetString(PyExc_ValueError,
        "this is a very long error message .... ... ... .. "
        "...");

As for the above comment, I do not think we typically put that in, not that it hurts, though, hmmm. The idea of the DEPRECATED comment is to find these places that need updating easier. What is important here is only the release note.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the PyErr_SetString, I'm happy to

Copy link
Member

Choose a reason for hiding this comment

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

Others may disagree, but if you do not mind, lets just remove the comments, they are not interesting internally for numpy, only for downstream. And downstream would read the release notes.

Can you reformat the other error setting as well?

The main thing to do is add the release note snippet, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed comments and added a release note snippet.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. LGTM. Do you want to squash it into a single commit with DEP: ...? I can also squash merge, but thought I would mention just in case, since we slightly prefer merges.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to do what you prefer.

I'm squashing and force committing a single commit with the correctish title

@seberg
Copy link
Member

seberg commented Sep 26, 2019

Interesting. The test failures seem real. There must be some documentation around which actually uses the deprecated version, hah...

Fixed order=FORTRAN in docs
Added release snippet
@seberg seberg changed the title DEP: Complete deprecation of invalid flatten order DEP: Complete deprecation of invalid array/memory order Sep 26, 2019
@sethtroisi
Copy link
Contributor Author

There's one test failure in windows for TestMatmulOperator.test_matrix_vector_values. I don't know how flaky numpy's test (or the window tests) are. I gave it a quick glance and it doesn't look like I caused it. I'm closing and opening this to re-try the test.

@sethtroisi sethtroisi closed this Sep 28, 2019
@sethtroisi sethtroisi reopened this Sep 28, 2019
@charris
Copy link
Member

charris commented Sep 30, 2019

It's a Heisenbug that shows up randomly, usually on windows 32 bits.

@seberg
Copy link
Member

seberg commented Sep 30, 2019

Hmmm, there once was a bug with sqrt in the kernel calculation that was triggered in numpy. It seems that at the time that seems maybe not fixed everywhere. Although unless the machines run OpenBLAS with a different number of threads (on a different) cpu once in a while, it is surprising that it is so rare (although possibly it matters how quickly threads finish, hmmm). Maybe should just fix those things upstream in any case, might help...

EDIT: Anyway, made a PR for OpenBLAS, if we are lucky, the next update fixes it, I guess...

@mattip mattip merged commit cacdf26 into numpy:master Oct 3, 2019
@mattip
Copy link
Member

mattip commented Oct 3, 2019

Thanks @sethtroisi

@sethtroisi sethtroisi deleted the old_defines_in_docs branch October 3, 2019 10:01
# invalid after gh-14596
for order in ['Z', 'c', False, True, 0, 8]:
x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
assert_raises(ValueError, x.flatten, {"order": order})
Copy link
Member

Choose a reason for hiding this comment

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

This test is unfortunately nonsense, this passes a dict as the order argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants