Skip to content

MNT try non-scientific formatting in numpy output #21329

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

Closed
wants to merge 4 commits into from

Conversation

adrinjalali
Copy link
Member

Maybe fixes #21324
Trying to see if this fixes our issues with numpy formats

@adrinjalali
Copy link
Member Author

cc @glemaitre

@glemaitre
Copy link
Member

Nop. It does not seem to work. But I don't understand why only one build is failing while we have several builds with NumPy 1.21.2?

@glemaitre
Copy link
Member

I did not look at it yet, but I found this entry in the release note: https://numpy.org/doc/stable/release/1.21.0-notes.html#new-min-digits-argument-for-printing-float-values

@adrinjalali
Copy link
Member Author

And I can't reproduce it on a conda environment with the same versions. Hmmm

@rgommers anywhere in particular you could point us at?

@rgommers
Copy link
Contributor

That looks unfamiliar to me. It may have been an unintended side effect of numpy/numpy#18629. @ahaldane, @seberg any thoughts on this one?

@seberg
Copy link
Contributor

seberg commented Oct 14, 2021

I don't really understand it, or how it would have to do anything with this. Would it be possible to get the print options to see if it is possible/how to reproduce it? Because I cannot locally.

@adrinjalali
Copy link
Member Author

@seberg here's the print options right where the error happens:

{'edgeitems': 3, 'threshold': 1000, 'floatmode': 'maxprec', 'precision': 8, 'suppress': False, 'linewidth': 75, 'nanstr': 'nan', 'infstr': 'inf', 'sign': '-', 'formatter': None, 'legacy': False}

@adrinjalali
Copy link
Member Author

It's very confusing, because locally I have the same numpy version, the same print options, but this is what I get:

>>> numpy.float64(9.987631416202845e-01)
0.9987631416202845
>>> numpy.array([9.987631416202845e-01])
array([0.99876314])

which is what I'd expect, but it's not what we get in the CI.

@glemaitre
Copy link
Member

glemaitre commented Oct 14, 2021 via email

@glemaitre
Copy link
Member

glemaitre commented Oct 14, 2021 via email

@seberg
Copy link
Contributor

seberg commented Oct 14, 2021

Confusing, is it possible that the runner has custom, non-default, printing for float objects? Maybe try printing repr/string for the normal Python float?

@adrinjalali
Copy link
Member Author

So it seems like some patch on python or other libs on the conda main channel. Using conda-forge fixes the issue (I think): #21337

@ogrisel
Copy link
Member

ogrisel commented Oct 15, 2021

I think we can close this debug PR because this specific problem has gone away.

@ogrisel ogrisel closed this Oct 15, 2021
@adrinjalali adrinjalali deleted the numpy-format branch October 18, 2021 12:23
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.

CI docstring failure due to NumPy switch to scientific notation
5 participants