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

numpy-1.14.2+mkl-pp3510-pp3510-win32 test errors/failures #10735

Closed
cgohlke opened this issue Mar 12, 2018 · 5 comments
Closed

numpy-1.14.2+mkl-pp3510-pp3510-win32 test errors/failures #10735

cgohlke opened this issue Mar 12, 2018 · 5 comments

Comments

@cgohlke
Copy link
Contributor

cgohlke commented Mar 12, 2018

Since PyPy compatibility was mentioned in the release announcement for numpy-1.14.2, here are the test errors and failures on PyPy 5.10.1 for Windows:

Python 3.5.3 (3f6eaa010fce, Jan 11 2018, 04:46:12)
[PyPy 5.10.1 with MSC v.1500 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
>>>> numpy.test()
Running unit tests for numpy
NumPy version 1.14.2
NumPy relaxed strides checking option: True
NumPy is installed in x:\pypy3\site-packages\numpy
Python version 3.5.3 (3f6eaa010fce, Jan 11 2018, 04:46:12)[PyPy 5.10.1 with MSC v.1500 32 bit]
nose version 1.3.7
<snip>
======================================================================
ERROR: numpy.core.tests.test_arrayprint.TestArray2String.test_refcount
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\core\tests\test_arrayprint.py", line 396, in test_refcount
    r1 = sys.getrefcount(a)
AttributeError: module 'sys' has no attribute 'getrefcount'

======================================================================
ERROR: Failure: OSError (no file with expected extension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "x:\pypy3\site-packages\nose\loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "x:\pypy3\site-packages\nose\importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "x:\pypy3\site-packages\nose\importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "x:\pypy3\lib-python\3\imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "x:\pypy3\lib-python\3\imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 694, in _load
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<builtin>/frozen importlib._bootstrap_external", line 686, in exec_module
  File "<frozen importlib._bootstrap>", line 223, in _call_with_frames_removed
  File "x:\pypy3\site-packages\numpy\core\tests\test_indexing.py", line 25, in <module>
    cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.__file__)
  File "x:\pypy3\site-packages\numpy\ctypeslib.py", line 155, in load_library
    raise OSError("no file with expected extension")
OSError: no file with expected extension

======================================================================
ERROR: numpy.core.tests.test_memmap.TestMemmap.test_filename
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 385, in tearDown
    try_run(self.inst, ('teardown', 'tearDown'))
  File "x:\pypy3\site-packages\nose\util.py", line 471, in try_run
    return func()
  File "x:\pypy3\site-packages\numpy\core\tests\test_memmap.py", line 30, in teardown
    shutil.rmtree(self.tempdir)
  File "x:\pypy3\lib-python\3\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "x:\pypy3\lib-python\3\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "x:\pypy3\lib-python\3\shutil.py", line 387, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\X\\AppData\\Local\\Temp\\tmpfd046wbj\\mmapu9uhq5io'

======================================================================
ERROR: numpy.core.tests.test_memmap.TestMemmap.test_open_with_filename
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 385, in tearDown
    try_run(self.inst, ('teardown', 'tearDown'))
  File "x:\pypy3\site-packages\nose\util.py", line 471, in try_run
    return func()
  File "x:\pypy3\site-packages\numpy\core\tests\test_memmap.py", line 30, in teardown
    shutil.rmtree(self.tempdir)
  File "x:\pypy3\lib-python\3\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "x:\pypy3\lib-python\3\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "x:\pypy3\lib-python\3\shutil.py", line 387, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\X\\AppData\\Local\\Temp\\tmpp5k0m6aq\\mmap85i65gqo'

======================================================================
ERROR: numpy.core.tests.test_memmap.TestMemmap.test_path
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 385, in tearDown
    try_run(self.inst, ('teardown', 'tearDown'))
  File "x:\pypy3\site-packages\nose\util.py", line 471, in try_run
    return func()
  File "x:\pypy3\site-packages\numpy\core\tests\test_memmap.py", line 30, in teardown
    shutil.rmtree(self.tempdir)
  File "x:\pypy3\lib-python\3\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "x:\pypy3\lib-python\3\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "x:\pypy3\lib-python\3\shutil.py", line 387, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\X\\AppData\\Local\\Temp\\tmpt1qxrgv8\\mmapbaplj7z9'

======================================================================
ERROR: test suite for <module 'numpy.lib.tests.test_format' from 'x:\\pypy3\\site-packages\\numpy\\lib\\tests\\test_format.py'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\suite.py", line 229, in run
    self.tearDown()
  File "x:\pypy3\site-packages\nose\suite.py", line 352, in tearDown
    self.teardownContext(ancestor)
  File "x:\pypy3\site-packages\nose\suite.py", line 368, in teardownContext
    try_run(context, names)
  File "x:\pypy3\site-packages\nose\util.py", line 471, in try_run
    return func()
  File "x:\pypy3\site-packages\numpy\lib\tests\test_format.py", line 307, in teardown_module
    shutil.rmtree(tempdir)
  File "x:\pypy3\lib-python\3\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "x:\pypy3\lib-python\3\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "x:\pypy3\lib-python\3\shutil.py", line 387, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\X\\AppData\\Local\\Temp\\tmpygq4rrmv\\compressed.npz'

======================================================================
ERROR: numpy.lib.tests.test_function_base.TestAdd_newdoc.test_add_doc
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_function_base.py", line 3492, in test_add_doc
    assert_equal(np.core.flatiter.index.__doc__[:len(tgt)], tgt)
TypeError: 'NoneType' object is not subscriptable

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_1D
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 645, in test_1D
    x = np.loadtxt(c, dtype=int)
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_binary_load
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 1019, in test_binary_load
    x = np.loadtxt(f, encoding="UTF-8", dtype=np.unicode)
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_empty_field_after_tab
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 928, in test_empty_field_after_tab
    x = np.loadtxt(c, dtype=dt, delimiter='\t')
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_encoding
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 559, in test_encoding
    x = self.loadfunc(path, encoding="UTF-16")
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_from_float_hex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 904, in test_from_float_hex
    res = np.loadtxt(c, dtype=dt)
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_generator_source
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 991, in test_generator_source
    res = np.loadtxt(count())
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: numpy.lib.tests.test_io.TestLoadTxt.test_ndmin_keyword
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 970, in test_ndmin_keyword
    x = np.loadtxt(e, dtype=int, delimiter=',', ndmin=2)
  File "x:\pypy3\site-packages\numpy\lib\npyio.py", line 1099, in loadtxt
    X.resize(nshape)
ValueError: cannot resize an array with refcheck=True on PyPy.
Use the resize function or refcheck=False

======================================================================
ERROR: Failure: OSError (no file with expected extension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "x:\pypy3\site-packages\nose\loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "x:\pypy3\site-packages\nose\importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "x:\pypy3\site-packages\nose\importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "x:\pypy3\lib-python\3\imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "x:\pypy3\lib-python\3\imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 694, in _load
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<builtin>/frozen importlib._bootstrap_external", line 686, in exec_module
  File "<frozen importlib._bootstrap>", line 223, in _call_with_frames_removed
  File "x:\pypy3\site-packages\numpy\tests\test_ctypeslib.py", line 18, in <module>
    cdll = load_library('multiarray', np.core.multiarray.__file__)
  File "x:\pypy3\site-packages\numpy\ctypeslib.py", line 155, in load_library
    raise OSError("no file with expected extension")
OSError: no file with expected extension

======================================================================
ERROR: numpy.tests.test_scripts.test_f2py
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "x:\pypy3\site-packages\numpy\tests\test_scripts.py", line 72, in test_f2py
    code, stdout, stderr = run_command([sys.executable, f2py_cmd, '-v'])
  File "x:\pypy3\site-packages\numpy\tests\test_scripts.py", line 57, in run_command
    'stderr', '------', '{2}']).format(cmd, stdout, stderr))
RuntimeError: Command "['x:\\pypy3\\pypy3.exe', 'x:\\pypy3\\Scripts\\f2py.py', '-v']" failed with
stdout
------
b''

stderr
------
b"FileNotFoundError: [Errno 2] No such file or directory: 'x:\\\\pypy3\\\\Scripts\\\\f2py.py'\n"

======================================================================
FAIL: numpy.core.tests.test_nditer.TestIterNested.test_dtype_copy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\core\tests\test_nditer.py", line 2302, in test_dtype_copy
    assert_equal(a, [[1, 2, 3], [4, 5, 6]])
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 344, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 855, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 779, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 100.0%)
 x: array([[0., 1., 2.],
       [3., 4., 5.]], dtype=float32)
 y: array([[1, 2, 3],
       [4, 5, 6]])

======================================================================
FAIL: numpy.core.tests.test_nditer.test_iter_nbo_align_contig
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\core\tests\test_nditer.py", line 790, in test_iter_nbo_align_contig
    assert_equal(au, [2]*6)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 344, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 855, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 779, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 83.33333333333333%)
 x: array([0., 1., 2., 3., 4., 5.], dtype=float32)
 y: array([2, 2, 2, 2, 2, 2])

======================================================================
FAIL: numpy.core.tests.test_nditer.test_iter_array_cast
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\core\tests\test_nditer.py", line 882, in test_iter_array_cast
    assert_equal(a[2, 1, 1], -12.5)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 411, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: 18.0
 DESIRED: -12.5

======================================================================
FAIL: Strings containing an unrepresentable float overflow
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\core\tests\test_scalar_ctors.py", line 34, in test_floating_overflow
    flongdouble = assert_warns(RuntimeWarning, np.longdouble, '1e10000')
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 1731, in assert_warns
    return func(*args, **kwargs)
  File "x:\pypy3\lib-python\3\contextlib.py", line 66, in __exit__
    next(self.gen)
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 1688, in _assert_warns_context
    raise AssertionError("No warning raised" + name_str)
AssertionError: No warning raised when calling float64

======================================================================
FAIL: numpy.lib.tests.test_io.test_load_refcount
----------------------------------------------------------------------
Traceback (most recent call last):
  File "x:\pypy3\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "x:\pypy3\site-packages\numpy\lib\tests\test_io.py", line 2368, in test_load_refcount
    assert_(gc.isenabled())
  File "x:\pypy3\site-packages\numpy\testing\nose_tools\utils.py", line 93, in assert_
    raise AssertionError(smsg)
AssertionError

----------------------------------------------------------------------
Ran 6343 tests in 135.580s

FAILED (KNOWNFAIL=19, SKIP=22, errors=16, failures=5)
<nose.result.TextTestResult run=6343 errors=16 failures=5>
@pv
Copy link
Member

pv commented Mar 12, 2018

Refcount, npyio and the test_indexing OSError ones are fixed in gh-10737.
The nditer ones require gh-9998.

The unlink failures are because there's no way to close np.memmap on Pypy, except waiting for gc.
This probably requires adding memmap.close(refcheck=False), similar to what ndarray.resize has.

The docstring-related ones are probably because add_newdocs is doing evil that Pypy's cpyext cannot exorcise. The docstring assignments could e.g. be moved to a header generated at build time from the contents of add_newdocs.py, like it was done in scipy.special.

The test_ctypeslib OSError looks like windows-specific, probably has to do with using the correct platform tag/DLL extension. Probably simple to fix in principle.

Not sure about the "No warning raised when calling float64".

@njsmith
Copy link
Member

njsmith commented Mar 12, 2018

The docstring assignments could e.g. be moved to a header generated at build time from the contents of add_newdocs.py, like it was done in scipy.special.

Alternatively it might make sense to move the actual strings into C, like most extension modules do, and remove add_newdocs.py entirely. IIUC add_newdocs.py was created back in the days when it was unreasonable to require contributors to be able to build numpy themselves, so it was desireable to keep things in Python as much as possible. But these days building is much simpler, or if you can't build then the CI will tell you about any issues, so the value is much lower...

@charris
Copy link
Member

charris commented Mar 12, 2018

@njsmith Some compilers (MS) also had trouble with long strings, and line breaks were a pain. Creating the docstrings in Python is very convenient, especially if we include utf-8 encoding at some point, so I'd probably be more in favor of generating an include file or writing the interface in Cython.

@mattip
Copy link
Member

mattip commented Mar 15, 2018

There is an open issue specifically for addocs issue #10167 . That is next on my list after finishing pr #9998

@mattip
Copy link
Member

mattip commented Aug 18, 2019

Closing. We have PyPy in CI (for linux64). Please reopen/open a new issue if there are still issues with win32 and PyPy, since we don't test that regularily

@mattip mattip closed this as completed Aug 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants