Skip to content

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

Merged
mattip merged 1 commit into
numpy:masterfrom
sethtroisi:old_defines_in_docs
Oct 3, 2019
Merged

mattip merged 1 commit into
numpy:masterfrom
sethtroisi:old_defines_in_docs

Conversation

@sethtroisi

Copy link
Copy Markdown
Contributor

Original deprecation was submitted in #6823 in 2015.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

seberg commented Sep 26, 2019

Copy link
Copy Markdown
Member

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

Comment thread numpy/core/tests/test_multiarray.py Outdated
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
Copy Markdown
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

charris commented Sep 30, 2019

Copy link
Copy Markdown
Member

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

@seberg

seberg commented Sep 30, 2019

Copy link
Copy Markdown
Member

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

mattip commented Oct 3, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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