-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
repr change for arrays of size 1 even with np.set_printoptions(legacy=True) in numpy master #10026
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
Comments
It's a feature, not a bug ;) The default print formatting will change in 1.14. We are aware that this will break doctests. From the release notes
Note that there are various ways to relax whitespace sensitivity of doctests which are probably worth looking into if you want to continue to rely on doctests. @ahaldane Further suggestions? |
Note that there are more changes than you show, for instance
Note missing spaces. |
Oops, I see that you did use the legacy mode, so we can maybe fix that. |
That would be great! For now our strategy is to use the legacy mode to have compatibility of our doctest with numpy 1.14dev and 1.13. When numpy 1.14 is released we will revisit our strategy. One possible solution is to update all of our doctests to work with 1.14 and just skip them for numpy <= 1.13. |
(this was not the issue I meant to comment on, and this thread actually answered my question, sorry for the noise) |
Something that was printed as 1.0 is now printed as 0.99999999(...?) is that also a feature? |
What code exactly printed |
I'll take a look at the space in the legacy option, I'm pretty sure that is a fixable bug. |
There is a case for |
Yes, we can discuss that. But if you see a number that is printed as The goal of the new algorithm is to round "correctly" for all float sizes, so if there is an instance where it isn't rounding correctly, that is important. |
Just a quick update, it is now |
In scikit-learn we have seen failures in doctests for a few days on our build using numpy-dev. This is one of them:
With numpy master:
With numpy 1.13 (note the space before the 0):
The text was updated successfully, but these errors were encountered: