Skip to content

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

Closed

Description

@lesteve

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.

Activity

  1. lesteve commented on May 30, 2017

    @lesteve
    MemberAuthor

    FYI I opened numpy/numpy#9185.

  2. lesteve commented on Sep 29, 2017

    @lesteve
    MemberAuthor

    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.

  3. changed the title [-]numpy-dev build failure related to 0d array formatting[/-] [+]numpy-dev build failure related to array repr/str formatting changes[/+] on Sep 29, 2017
  4. jnothman commented on Oct 1, 2017

    @jnothman
    Member
  5. lesteve commented on Oct 1, 2017

    @lesteve
    MemberAuthor

    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
  6. qinhanmin2014 commented on Nov 21, 2017

    @qinhanmin2014
    Member

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

  7. jnothman commented on Nov 21, 2017

    @jnothman
    Member
  8. lesteve commented on Nov 21, 2017

    @lesteve
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions