Skip to content
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

Python 3 unorderable type errors in test_sparsetools.TestInt32Overflow #6292

Closed
matthew-brett opened this issue Jun 21, 2016 · 3 comments
Closed
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse
Milestone

Comments

@matthew-brett
Copy link
Contributor

Testing Scipy 0.18.0rc1 64-bit wheels on Linux, I am getting 12 errors in test_sparsetools.TestInt32Overflow, of form:

======================================================================
ERROR: test_sparsetools.TestInt32Overflow.test_bsr_1_block('matmat',)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/venv/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/venv/lib/python3.4/site-packages/scipy/sparse/tests/test_sparsetools.py", line 150, in check
    m = bsr_matrix((data, indices, indptr), blocksize=(n, n), copy=False)
  File "/venv/lib/python3.4/site-packages/scipy/sparse/bsr.py", line 169, in __init__
    maxval = max(maxval, max(blocksize))
TypeError: unorderable types: int() > NoneType()

See: https://travis-ci.org/MacPython/scipy-wheels/jobs/139084459#L368

@ev-br ev-br added this to the 0.18.0 milestone Jun 21, 2016
@ev-br
Copy link
Member

ev-br commented Jun 21, 2016

Huh. I nearly wrote "cannot reproduce it", but --- ran verbose tests, and

test_sparsetools.TestInt32Overflow.test_bsr_1_block('matmat',) ... SKIP: test requires 5000 MB of free memory

OK, free the memory (close the browser), and hey presto,

test_sparsetools.TestInt32Overflow.test_bsr_1_block('matmat',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_1_block('matvecs',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_1_block('matvec',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_1_block('diagonal',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_1_block('sort_indices',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_1_block('transpose',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('matmat',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('matvecs',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('matvec',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('diagonal',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('sort_indices',) ... ERROR
test_sparsetools.TestInt32Overflow.test_bsr_n_block('transpose',) ... ERROR

@ev-br ev-br added scipy.sparse defect A clear bug or issue that prevents SciPy from being installed or used as expected labels Jun 21, 2016
@ev-br
Copy link
Member

ev-br commented Jun 21, 2016

Ok, so the problem comes from this:

65244b9#diff-91f2a1b3e76907865e88d529447df8f8R169

                 maxval = None
                 if shape is not None:
                     maxval = max(shape)
                 if blocksize is not None:
                     maxval = max(maxval, max(blocksize))

In the test, shape is None, so maxval stays being None, and the last line tries to compare None and an integer.

@ev-br
Copy link
Member

ev-br commented Jun 21, 2016

A band-aid fix and a test which actually runs: #6295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse
Projects
None yet
Development

No branches or pull requests

2 participants