10000 numpy-dev build failure related to array repr/str formatting changes · Issue #8959 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

numpy-dev build failure related to array repr/str formatting changes #8959

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
lesteve opened this issue May 30, 2017 · 7 comments · Fixed by #10246
Closed

numpy-dev build failure related to array repr/str formatting changes #8959

lesteve opened this issue May 30, 2017 · 7 comments · Fixed by #10246

Comments

@lesteve
Copy link
Member
lesteve commented May 30, 2017

Historical thing that is not relevant anymore go to #8959 (comment) for the current problem:

See https://travis-ci.org/scikit-learn/scikit-learn/jobs/237455099 for example.

Expected:
    GaussianProcess(beta0=None, corr=<function squared_exponential at 0x...>,
            normalize=True, nugget=array(2.22...-15),
            ...

Got:

    GaussianProcess(beta0=None,
            corr=<function squared_exponential at 0x2b0bb7aa5ae8>,
            normalize=True, nugget=array(  2.22045e-15),
            ...

Additional leading space in the repr of the nugget parameter.

@lesteve
Copy link
Member Author
lesteve commented May 30, 2017

FYI I opened numpy/numpy#9185.

@lesteve
Copy link
Member Author
lesteve commented Sep 29, 2017

I am going to rename this one, because now that numpy/numpy#9139 has been merged the 0d array has been fixed but most of the other arrays have differences in repr. See https://travis-ci.org/scikit-learn/scikit-learn/jobs/281173097 for an example of failing build. 61 failures, all of them similar to this one:

======================================================================
FAIL: Doctest: sklearn.utils.shuffle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/python/3.5.3/lib/python3.5/doctest.py", line 2190, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.utils.shuffle
  File "/home/travis/build/scikit-learn/scikit-learn/sklearn/utils/__init__.py", line 277, in shuffle

----------------------------------------------------------------------
File "/home/travis/build/scikit-learn/scikit-learn/sklearn/utils/__init__.py", line 318, in sklearn.utils.shuffle
Failed example:
    X
Expected:
    array([[ 0.,  0.],
           [ 2.,  1.],
           [ 1.,  0.]])
Got:
    array([[0., 0.],
           [2., 1.],
           [1., 0.]])
----------------------------------------------------------------------
File "/home/travis/build/scikit-learn/scikit-learn/sklearn/utils/__init__.py", line 327, in sklearn.utils.shuffle
Failed example:
    X_sparse.toarray()
Expected:
    array([[ 0.,  0.],
           [ 2.,  1.],
           [ 1.,  0.]])
Got:
    array([[0., 0.],
           [2., 1.],
           [1., 0.]])

>>  raise self.failureException(self.format_failure(<_io.StringIO object at 0x7f8a331c9c18>.getvalue()))
    

My preference would be to not do anything until numpy 1.4 is released and then either run our doctests with numpy 1.14 only. If deemed necessary we can change setup.cfg to not run the doctest by default, this way less people with numpy <= 1.13 are likely to hit test failures they will have to scratch their head over.

@lesteve lesteve changed the title numpy-dev build failure related to 0d array formatting numpy-dev build failure related to array repr/str formatting changes Sep 29, 2017
@jnothman
Copy link
Member
jnothman commented Oct 1, 2017 via email

@lesteve
Copy link
Member Author
lesteve commented Oct 1, 2017

To be honest I think I was planning to kick this one down the road for a bit. I don'am pretty sure NORMALIZE_WHITESPACE is not enough to make the doctest pass. There are two options AFAICS:

  • there is a way to set the numpy array formatting to its legacy behaviour (probably the simplest option).We could add something like this in the conftest.py in the root folder for example:
import numpy as np
try:
    np.set_printoptions(sign='legacy')
except TypeError:
    pass

@qinhanmin2014
Copy link
Member

I suppose this one should also be closed since cron job passes today.

@jnothman
Copy link
Member
jnothman commented Nov 21, 2017 via email

@lesteve
Copy link
Member Author
lesteve commented Nov 21, 2017

Thanks a lot for keeping track of this! I am going to reopen this one, because we are still skipping the doctests of the doc folder (aka make test-doc) at the moment.

I think we are just waiting for numpy/numpy#10059 and then we can enable make test-doc for the numpy-dev build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0