8000 MAINT: Change the type of error raised in set_printoptions by kianasun · Pull Request #13899 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Change the type of error raised in set_printoptions #13899

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
Jul 25, 2019

Conversation

kianasun
Copy link
Contributor
@kianasun kianasun commented Jul 3, 2019

No description provided.

@eric-wieser
Copy link
Member

I don't think this is an improvement - passing np.nan should not give a TypeError if passing 1.0 does not, because they have the same type.

If you want to go down this path, then you should split the condition in two, and raise TypeError for non-numeric types, and ValueError for nans

@kianasun kianasun force-pushed the change-set-printoptions-error branch from c2c5f66 to cdffafd Compare July 3, 2019 04:01
@kianasun
Copy link
Contributor Author
kianasun commented Jul 3, 2019

@eric-wieser You are right. I have split it into two conditions.

Copy link
Member
@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

@mattip, think the message is still clear enough for clueless stackoverflow users using threshold='nan'?

@charris
Copy link
Member
charris commented Jul 3, 2019

Needs a release note because of changed behavior.

@charris charris added the 56 - Needs Release Note. Needs an entry in doc/release/upcoming_changes label Jul 3, 2019
@kianasun kianasun force-pushed the change-set-printoptions-error branch from cdffafd to 8564444 Compare July 3, 2019 22:37
@kianasun
Copy link
Contributor Author
kianasun commented Jul 3, 2019

Hi @charris , I added a release note.

@kianasun
Copy link
Contributor Author
kianasun commented Jul 8, 2019

@charris @eric-wieser @mattip Anything else need to be changed?

@eric-wieser
Copy link
Member

I think it would be best to wait for the #13908 stuff to go in first - your release note is in the wrong place, but the right place is about to change.

@seberg
Copy link
Member
seberg commented Jul 24, 2019

@kianasun can you move your release note into the file changelog/13899.changes.rst, it will be a very short file containing only what you wrote. I think after that happens we can probably just merge it, so just ping me on that (I can do that if you like, but would be happy if you can move it).

EDIT: Sorry, you have to rebase on master first, or the changelog folder will not exist.

@kianasun
Copy link
Contributor Author

@seberg Sure! will do this soon.

@kianasun kianasun force-pushed the change-set-printoptions-error branch from 8564444 to 55a8193 Compare July 25, 2019 16:15
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
@seberg
Copy link
Member
seberg commented Jul 25, 2019

Thanks @kianasun!

@seberg seberg merged commit feee90d into numpy:master Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0