Skip to content

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

Merged
seberg merged 2 commits into
numpy:masterfrom
kianasun:change-set-printoptions-error
Jul 25, 2019
Merged

seberg merged 2 commits into
numpy:masterfrom
kianasun:change-set-printoptions-error

Conversation

@kianasun

@kianasun kianasun commented Jul 3, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@eric-wieser

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

kianasun commented Jul 3, 2019

Copy link
Copy Markdown
Contributor Author

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

@eric-wieser eric-wieser left a comment

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.

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

@charris

charris commented Jul 3, 2019

Copy link
Copy Markdown
Member

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

kianasun commented Jul 3, 2019

Copy link
Copy Markdown
Contributor Author

Hi @charris , I added a release note.

@kianasun

kianasun commented Jul 8, 2019

Copy link
Copy Markdown
Contributor Author

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

@eric-wieser

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

seberg commented Jul 24, 2019 •

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Comment thread changelog/13899.changes.rst Resolved
@seberg

seberg commented Jul 25, 2019

Copy link
Copy Markdown
Member

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