Skip to content

Instantly share code, notes, and snippets.

@fnauman
Created January 29, 2019 07:30
Show Gist options
  • Save fnauman/8e51f41316710a8621e5d5cdb864c9ea to your computer and use it in GitHub Desktop.
Save fnauman/8e51f41316710a8621e5d5cdb864c9ea to your computer and use it in GitHub Desktop.
shenfun error
python -m pytest .
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /home/fnauman/python3/shenfun, inifile:
collected 3563 items
test_curl.py .... [ 0%]
test_demos.py F [ 0%]
test_forms.py ........................... [ 0%]
test_io.py ...F...F...F...F...F...F [ 1%]
test_la.py .... [ 1%]
test_lagrangian_particles.py . [ 1%]
test_matrices.py ....................................................... [ 3%]
........................................................................ [ 5%]
........................................................................ [ 7%]
........................................................................ [ 9%]
........................................................................ [ 11%]
........................................................................ [ 13%]
........................................................................ [ 15%]
........................................................................ [ 17%]
........................................................................ [ 19%]
........................................................................ [ 21%]
........................................................................ [ 23%]
........................................................................ [ 25%]
........................................................................ [ 27%]
........................................................................ [ 29%]
........................................................................ [ 31%]
........................................................................ [ 33%]
........................................................................ [ 35%]
........................................................................ [ 37%]
........................................................................ [ 39%]
........................................................................ [ 41%]
........................................................................ [ 43%]
........................................................................ [ 45%]
........................................................................ [ 47%]
........................................................................ [ 49%]
........................................................................ [ 51%]
........................................................................ [ 53%]
........................................................................ [ 55%]
........................................................................ [ 57%]
........................................................................ [ 59%]
........................................................................ [ 61%]
........................................................................ [ 63%]
........................................................................ [ 65%]
........................................................................ [ 67%]
........................................................................ [ 69%]
........................................................................ [ 71%]
........................................................................ [ 73%]
........................................................................ [ 76%]
........................................................................ [ 78%]
........................................................................ [ 80%]
........................................................................ [ 82%]
........................................................................ [ 84%]
........................................................................ [ 86%]
........................................................................ [ 88%]
....... [ 88%]
test_tensorproductspace.py ............................................. [ 89%]
........................................................................ [ 91%]
........................................................................ [ 93%]
..... [ 93%]
test_transforms.py ..................................................... [ 95%]
........................................................................ [ 97%]
........................................................................ [ 99%]
......................... [100%]
=================================== FAILURES ===================================
__________________________________ test_demos __________________________________
def test_demos():
subprocess.check_output("/bin/bash rundemos.sh", shell=True,
> cwd=os.path.join(os.getcwd(), "tests"))
test_demos.py:7:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/subprocess.py:336: in check_output
**kwargs).stdout
../../../anaconda3/envs/shenfun_prec/lib/python3.6/subprocess.py:403: in run
with Popen(*popenargs, **kwargs) as process:
../../../anaconda3/envs/shenfun_prec/lib/python3.6/subprocess.py:709: in __init__
restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <subprocess.Popen object at 0x7f30dc423128>
args = ['/bin/sh', '-c', '/bin/bash rundemos.sh'], executable = b'/bin/sh'
preexec_fn = None, close_fds = True, pass_fds = ()
cwd = '/home/fnauman/python3/shenfun/tests/tests', env = None
startupinfo = None, creationflags = 0, shell = True, p2cread = -1, p2cwrite = -1
c2pread = 11, c2pwrite = 12, errread = -1, errwrite = -1, restore_signals = True
start_new_session = False
def _execute_child(self, args, executable, preexec_fn, close_fds,
pass_fds, cwd, env,
startupinfo, creationflags, shell,
p2cread, p2cwrite,
c2pread, c2pwrite,
errread, errwrite,
restore_signals, start_new_session):
"""Execute program (POSIX version)"""
if isinstance(args, (str, bytes)):
args = [args]
else:
args = list(args)
if shell:
args = ["/bin/sh", "-c"] + args
if executable:
args[0] = executable
if executable is None:
executable = args[0]
orig_executable = executable
# For transferring possible exec failure from child to parent.
# Data format: "exception name:hex errno:description"
# Pickle is not used; it is complex and involves memory allocation.
errpipe_read, errpipe_write = os.pipe()
# errpipe_write must not be in the standard io 0, 1, or 2 fd range.
low_fds_to_close = []
while errpipe_write < 3:
low_fds_to_close.append(errpipe_write)
errpipe_write = os.dup(errpipe_write)
for low_fd in low_fds_to_close:
os.close(low_fd)
try:
try:
# We must avoid complex work that could involve
# malloc or free in the child process to avoid
# potential deadlocks, thus we do all this here.
# and pass it to fork_exec()
if env is not None:
env_list = []
for k, v in env.items():
k = os.fsencode(k)
if b'=' in k:
raise ValueError("illegal environment variable name")
env_list.append(k + b'=' + os.fsencode(v))
else:
env_list = None # Use execv instead of execve.
executable = os.fsencode(executable)
if os.path.dirname(executable):
executable_list = (executable,)
else:
# This matches the behavior of os._execvpe().
executable_list = tuple(
os.path.join(os.fsencode(dir), executable)
for dir in os.get_exec_path(env))
fds_to_keep = set(pass_fds)
fds_to_keep.add(errpipe_write)
self.pid = _posixsubprocess.fork_exec(
args, executable_list,
close_fds, tuple(sorted(map(int, fds_to_keep))),
cwd, env_list,
p2cread, p2cwrite, c2pread, c2pwrite,
errread, errwrite,
errpipe_read, errpipe_write,
restore_signals, start_new_session, preexec_fn)
self._child_created = True
finally:
# be sure the FD is closed no matter what
os.close(errpipe_write)
# self._devnull is not always defined.
devnull_fd = getattr(self, '_devnull', None)
if p2cread != -1 and p2cwrite != -1 and p2cread != devnull_fd:
os.close(p2cread)
if c2pwrite != -1 and c2pread != -1 and c2pwrite != devnull_fd:
os.close(c2pwrite)
if errwrite != -1 and errread != -1 and errwrite != devnull_fd:
os.close(errwrite)
if devnull_fd is not None:
os.close(devnull_fd)
# Prevent a double close of these fds from __init__ on error.
self._closed_child_pipe_fds = True
# Wait for exec to fail or succeed; possibly raising an
# exception (limited in size)
errpipe_data = bytearray()
while True:
part = os.read(errpipe_read, 50000)
errpipe_data += part
if not part or len(errpipe_data) > 50000:
break
finally:
# be sure the FD is closed no matter what
os.close(errpipe_read)
if errpipe_data:
try:
pid, sts = os.waitpid(self.pid, 0)
if pid == self.pid:
self._handle_exitstatus(sts)
else:
self.returncode = sys.maxsize
except ChildProcessError:
pass
try:
exception_name, hex_errno, err_msg = (
errpipe_data.split(b':', 2))
# The encoding here should match the encoding
# written in by the subprocess implementations
# like _posixsubprocess
err_msg = err_msg.decode()
except ValueError:
exception_name = b'SubprocessError'
hex_errno = b'0'
err_msg = 'Bad exception data from child: {!r}'.format(
bytes(errpipe_data))
child_exception_type = getattr(
builtins, exception_name.decode('ascii'),
SubprocessError)
if issubclass(child_exception_type, OSError) and hex_errno:
errno_num = int(hex_errno, 16)
child_exec_never_called = (err_msg == "noexec")
if child_exec_never_called:
err_msg = ""
# The error must be from chdir(cwd).
err_filename = cwd
else:
err_filename = orig_executable
if errno_num != 0:
err_msg = os.strerror(errno_num)
if errno_num == errno.ENOENT:
err_msg += ': ' + repr(err_filename)
> raise child_exception_type(errno_num, err_msg, err_filename)
E FileNotFoundError: [Errno 2] No such file or directory: '/home/fnauman/python3/shenfun/tests/tests': '/home/fnauman/python3/shenfun/tests/tests'
../../../anaconda3/envs/shenfun_prec/lib/python3.6/subprocess.py:1344: FileNotFoundError
________________________ test_regular_2D[netcdf-False] _________________________
backend = 'netcdf', forward_output = False
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
def test_regular_2D(backend, forward_output):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F')
K1 = Basis(N[1], 'C', bc=(0, 0))
T = TensorProductSpace(comm, (K0, K1))
filename = 'test2Dr_{}'.format(ex[forward_output])
> hfile = writer(filename, T, backend=backend)
test_io.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test2Dr_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
_______________________ test_mixed_2D[True-netcdf-False] _______________________
backend = 'netcdf', forward_output = False, as_scalar = True
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
@pytest.mark.parametrize('as_scalar', (True, False))
def test_mixed_2D(backend, forward_output, as_scalar):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F')
K1 = Basis(N[1], 'C')
T = TensorProductSpace(comm, (K0, K1))
TT = MixedTensorProductSpace([T, T])
filename = 'test2Dm_{}'.format(ex[forward_output])
> hfile = writer(filename, TT, backend=backend)
test_io.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test2Dm_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
______________________ test_mixed_2D[False-netcdf-False] _______________________
backend = 'netcdf', forward_output = False, as_scalar = False
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
@pytest.mark.parametrize('as_scalar', (True, False))
def test_mixed_2D(backend, forward_output, as_scalar):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F')
K1 = Basis(N[1], 'C')
T = TensorProductSpace(comm, (K0, K1))
TT = MixedTensorProductSpace([T, T])
filename = 'test2Dm_{}'.format(ex[forward_output])
> hfile = writer(filename, TT, backend=backend)
test_io.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test2Dm_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
________________________ test_regular_3D[netcdf-False] _________________________
backend = 'netcdf', forward_output = False
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
def test_regular_3D(backend, forward_output):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F', dtype='D', domain=(0, np.pi))
K1 = Basis(N[1], 'F', dtype='d', domain=(0, 2*np.pi))
K2 = Basis(N[2], 'C', dtype='d', bc=(0, 0))
T = TensorProductSpace(comm, (K0, K1, K2))
filename = 'test3Dr_{}'.format(ex[forward_output])
> hfile = writer(filename, T, backend=backend)
test_io.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test3Dr_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
_______________________ test_mixed_3D[True-netcdf-False] _______________________
backend = 'netcdf', forward_output = False, as_scalar = True
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
@pytest.mark.parametrize('as_scalar', (True, False))
def test_mixed_3D(backend, forward_output, as_scalar):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F', dtype='D', domain=(0, np.pi))
K1 = Basis(N[1], 'F', dtype='d', domain=(0, 2*np.pi))
K2 = Basis(N[2], 'C')
T = TensorProductSpace(comm, (K0, K1, K2))
TT = VectorTensorProductSpace(T)
filename = 'test3Dm_{}'.format(ex[forward_output])
> hfile = writer(filename, TT, backend=backend)
test_io.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test3Dm_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
______________________ test_mixed_3D[False-netcdf-False] _______________________
backend = 'netcdf', forward_output = False, as_scalar = False
@pytest.mark.skipif(skip, reason='h5py not installed')
@pytest.mark.parametrize('forward_output', (True, False))
@pytest.mark.parametrize('backend', ('hdf5', 'netcdf'))
@pytest.mark.parametrize('as_scalar', (True, False))
def test_mixed_3D(backend, forward_output, as_scalar):
if backend == 'netcdf' and forward_output is True:
return
K0 = Basis(N[0], 'F', dtype='D', domain=(0, np.pi))
K1 = Basis(N[1], 'F', dtype='d', domain=(0, 2*np.pi))
K2 = Basis(N[2], 'C')
T = TensorProductSpace(comm, (K0, K1, K2))
TT = VectorTensorProductSpace(T)
filename = 'test3Dm_{}'.format(ex[forward_output])
> hfile = writer(filename, TT, backend=backend)
test_io.py:119:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/__init__.py:31: in ShenfunFile
return NCFile(name+'.nc', T, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/io/nc_file.py:26: in __init__
BaseFile.__init__(self, ncname, T, domain=T.mesh(), clobber=clobber, mode=mode, **kw)
../../../anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/mpi4py_fft/utilities/nc_file.py:44: in __init__
self.f = f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True, comm=comm, **kw)
netCDF4/_netCDF4.pyx:2135: in netCDF4._netCDF4.Dataset.__init__
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E OSError: [Errno -128] NetCDF: Attempt to use feature that was not turned on when netCDF was built.: b'test3Dm_r.nc'
netCDF4/_netCDF4.pyx:1752: OSError
=============================== warnings summary ===============================
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/forms/arguments.py:510
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/forms/arguments.py:510: PytestWarning: cannot collect test class 'TestFunction' because it has a __init__ constructor
class TestFunction(BasisFunction):
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/h5py/__init__.py:34
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/h5py/tests/old/test_attrs_data.py:251
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/h5py/tests/old/test_attrs_data.py:251: DeprecationWarning: invalid escape sequence \H
s = b"Hello\x00\Hello"
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/forms/arguments.py:510
/home/fnauman/anaconda3/envs/shenfun_prec/lib/python3.6/site-packages/shenfun/forms/arguments.py:510: PytestWarning: cannot collect test class 'TestFunction' because it has a __init__ constructor
class TestFunction(BasisFunction):
tests/test_la.py::test_solve[GC]
/home/fnauman/.local/lib/python3.6/site-packages/scipy/sparse/linalg/dsolve/linsolve.py:133: SparseEfficiencyWarning: spsolve requires A be CSC or CSR matrix format
SparseEfficiencyWarning)
tests/test_la.py::test_solve[GL]
/home/fnauman/.local/lib/python3.6/site-packages/scipy/sparse/linalg/dsolve/linsolve.py:133: SparseEfficiencyWarning: spsolve requires A be CSC or CSR matrix format
SparseEfficiencyWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
============== 7 failed, 3556 passed, 6 warnings in 70.22 seconds ==============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment