odlgroup / odl

Operator Discretization Library https://odlgroup.github.io/odl/
Mozilla Public License 2.0
372 stars 105 forks source link

Trouble with pytest #1532

Closed aringh closed 5 years ago

aringh commented 5 years ago

I am having trouble running the test in odl. I just installed a new conda environment, but still the troubles prevail. When I run pytest in the root directory, it starts showing images (examples?) and then crashes with a large error message. Here is the first few lines:

============================= test session starts ==============================
platform linux -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: [...]/git/odl, inifile: setup.cfg
plugins: pep8-1.0.6
collected 0 items / 304 errors                                                  

==================================== ERRORS ====================================
_______________________ ERROR collecting odl/__init__.py _______________________
odl/__init__.py:75: in <module>
    from . import tomo
odl/tomo/__init__.py:19: in <module>
    from .operators import *
odl/tomo/operators/__init__.py:14: in <module>
    from .ray_trafo import *
odl/tomo/operators/ray_trafo.py:21: in <module>
    from odl.tomo.backends import (
odl/tomo/backends/__init__.py:21: in <module>
    from .astra_cuda import *
odl/tomo/backends/astra_cuda.py:17: in <module>
    from packaging.version import parse as parse_version
E   ModuleNotFoundError: No module named 'packaging'
___________________ ERROR collecting odl/contrib/__init__.py ___________________
../../miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
______________ ERROR collecting odl/contrib/datasets/__init__.py _______________
../../miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
________________ ERROR collecting odl/contrib/datasets/util.py _________________
../../miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
_____________ ERROR collecting odl/contrib/datasets/ct/__init__.py _____________
../../miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
_______________ ERROR collecting odl/contrib/datasets/ct/fips.py _______________
odl/contrib/datasets/ct/fips.py:21: in <module>
    from odl.tomo import FanBeamGeometry
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
_______________ ERROR collecting odl/contrib/datasets/ct/mayo.py _______________
odl/contrib/datasets/ct/mayo.py:22: in <module>
    import dicom
E   ModuleNotFoundError: No module named 'dicom'
_________ ERROR collecting odl/contrib/datasets/ct/mayo_dicom_dict.py __________
../../miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
____ ERROR collecting odl/contrib/datasets/ct/examples/fips_reconstruct.py _____
odl/contrib/datasets/ct/examples/fips_reconstruct.py:3: in <module>
    import odl
odl/__init__.py:57: in <module>
    __all__ += set.__all__
E   AttributeError: type object 'set' has no attribute '__all__'
____ ERROR collecting odl/contrib/datasets/ct/examples/mayo_reconstruct.py _____

When I try to run python -c "import odl; odl.test()":

Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'odl' has no attribute 'test'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "[...]/git/odl/odl/__init__.py", line 75, in <module>
    from . import tomo
  File "[...]/git/odl/odl/tomo/__init__.py", line 19, in <module>
    from .operators import *
  File "[...]/git/odl/odl/tomo/operators/__init__.py", line 14, in <module>
    from .ray_trafo import *
  File "[...]/git/odl/odl/tomo/operators/ray_trafo.py", line 21, in <module>
    from odl.tomo.backends import (
  File "[...]/git/odl/odl/tomo/backends/__init__.py", line 21, in <module>
    from .astra_cuda import *
  File "[...]/git/odl/odl/tomo/backends/astra_cuda.py", line 17, in <module>
    from packaging.version import parse as parse_version
ModuleNotFoundError: No module named 'packaging'

List of packages installed in the conda environemt:

# packages in environment at [...]/miniconda3/envs/odl-py36_tmp:
#
_libgcc_mutex             0.1                        free  
alabaster                 0.7.10                   py36_0  
astroid                   1.5.3                    py36_0  
babel                     2.5.0                    py36_0  
blas                      1.0                    openblas  
bleach                    1.5.0                    py36_0  
certifi                   2016.2.28                py36_0  
chardet                   3.0.4                    py36_0  
cycler                    0.10.0                   py36_0  
dbus                      1.10.20                       0  
decorator                 4.1.2                    py36_0  
docutils                  0.14                     py36_0  
entrypoints               0.2.3                    py36_0  
execnet                   1.3.0                    py36_1  
expat                     2.1.0                         0  
fontconfig                2.12.1                        3  
freetype                  2.5.5                         2  
future                    0.16.0                   py36_1  
glib                      2.50.2                        1  
gst-plugins-base          1.8.0                         0  
gstreamer                 1.8.0                         0  
html5lib                  0.9999999                py36_0  
icu                       54.1                          0  
imagesize                 0.7.1                    py36_0  
ipykernel                 4.6.1                    py36_0  
ipython                   6.1.0                    py36_0  
ipython_genutils          0.2.0                    py36_0  
isort                     4.2.15                   py36_0  
jedi                      0.10.2                   py36_2  
jinja2                    2.9.6                    py36_0  
jpeg                      9b                            0  
jsonschema                2.6.0                    py36_0  
jupyter_client            5.1.0                    py36_0  
jupyter_core              4.3.0                    py36_0  
lazy-object-proxy         1.3.1                    py36_0  
libffi                    3.2.1                         1  
libgcc                    5.2.0                         0  
libgfortran               3.0.0                         1  
libiconv                  1.14                          0  
libpng                    1.6.30                        1  
libsodium                 1.0.10                        0  
libxcb                    1.12                          1  
libxml2                   2.9.4                         0  
markupsafe                1.0                      py36_0  
matplotlib                2.0.2               np113py36_0  
mistune                   0.7.4                    py36_0  
nbconvert                 5.2.1                    py36_0  
nbformat                  4.4.0                    py36_0  
nomkl                     3.0                           0  
numpy                     1.13.1             py36_nomkl_0  [nomkl]
numpydoc                  0.7.0                    py36_0  
openblas                  0.2.19                        0  
openssl                   1.0.2l                        0  
pandocfilters             1.4.2                    py36_0  
path.py                   10.3.1                   py36_0  
pcre                      8.39                          1  
pep8                      1.7.0                    py36_0  
pexpect                   4.2.1                    py36_0  
pickleshare               0.7.4                    py36_0  
pip                       9.0.1                    py36_1  
prompt_toolkit            1.0.15                   py36_0  
psutil                    5.2.2                    py36_0  
ptyprocess                0.5.2                    py36_0  
py                        1.4.34                   py36_0  
pycodestyle               2.3.1                    py36_0  
pyflakes                  1.6.0                    py36_0  
pygments                  2.2.0                    py36_0  
pylint                    1.7.2                    py36_0  
pyparsing                 2.2.0                    py36_0  
pyqt                      5.6.0                    py36_2  
pytest                    3.2.1                    py36_0  
pytest-cache              1.0                      py36_0  
pytest-pep8               1.0.6                    py36_0  
python                    3.6.2                         0  
python-dateutil           2.6.1                    py36_0  
pytz                      2017.2                   py36_0  
pyzmq                     16.0.2                   py36_0  
qt                        5.6.2                         5  
qtawesome                 0.4.4                    py36_0  
qtconsole                 4.3.1                    py36_0  
qtpy                      1.3.1                    py36_0  
readline                  6.2                           2  
requests                  2.14.2                   py36_0  
rope                      0.9.4                    py36_1  
scipy                     0.19.1          np113py36_nomkl_0  [nomkl]
setuptools                36.4.0                   py36_1  
simplegeneric             0.8.1                    py36_1  
singledispatch            3.4.0.3                  py36_0  
sip                       4.18                     py36_0  
six                       1.10.0                   py36_0  
snowballstemmer           1.2.1                    py36_0  
sphinx                    1.6.3                    py36_0  
sphinxcontrib             1.0                      py36_0  
sphinxcontrib-websupport  1.0.1                    py36_0  
spyder                    3.2.3                    py36_0  
sqlite                    3.13.0                        0  
testpath                  0.3.1                    py36_0  
tk                        8.5.18                        0  
tornado                   4.5.2                    py36_0  
traitlets                 4.3.2                    py36_0  
wcwidth                   0.1.7                    py36_0  
wheel                     0.29.0                   py36_0  
wrapt                     1.10.11                  py36_0  
xz                        5.2.3                         0  
zeromq                    4.1.5                         0  
zlib                      1.2.11                        0  

Does anyone know what the problem could be?

aringh commented 5 years ago

Some soul searching later, I realize that the installation of odl might not have worked properly... When installing it using pip (following instructions here, i.e., running pip install --editable in the root directory of odl), I got the following error message

(odl-py36_tmp) [...]/git/odl$ pip install --editable .
Obtaining file:///[...]/git/odl
Collecting setuptools>=39.2.0 (from odl===file-.odl-VERSION)
  Downloading https://files.pythonhosted.org/packages/d9/de/554b6310ac87c5b921bc45634b07b11394fe63bc4cb5176f5240addf18ab/setuptools-41.6.0-py2.py3-none-any.whl (582kB)
    100% |████████████████████████████████| 583kB 653kB/s 
Requirement already satisfied: future>=0.14 in [...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages (from odl===file-.odl-VERSION)
Collecting packaging>=15.0 (from odl===file-.odl-VERSION)
  Downloading https://files.pythonhosted.org/packages/cf/94/9672c2d4b126e74c4496c6b3c58a8b51d6419267be9e70660ba23374c875/packaging-19.2-py2.py3-none-any.whl
Collecting numpy!=1.14.0,!=1.14.1,!=1.14.2,>=1.13.3 (from odl===file-.odl-VERSION)
  Downloading https://files.pythonhosted.org/packages/0e/46/ae6773894f7eacf53308086287897ec568eac9768918d913d5b9d366c5db/numpy-1.17.3-cp36-cp36m-manylinux1_x86_64.whl (20.0MB)
    100% |████████████████████████████████| 20.0MB 86kB/s 
Requirement already satisfied: scipy>=0.14 in [...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages (from odl===file-.odl-VERSION)
Requirement already satisfied: pyparsing>=2.0.2 in [...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages (from packaging>=15.0->odl===file-.odl-VERSION)
Requirement already satisfied: six in [...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages (from packaging>=15.0->odl===file-.odl-VERSION)
Installing collected packages: setuptools, packaging, numpy, odl
  Found existing installation: setuptools 36.4.0
    Uninstalling setuptools-36.4.0:
      Successfully uninstalled setuptools-36.4.0
  Rolling back uninstall of setuptools
Exception:
Traceback (most recent call last):
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/pip/locations.py", line 141, in distutils_scheme
    d.parse_config_files()
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/setuptools/dist.py", line 437, in parse_config_files
    parse_configuration(self, self.command_options)
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/setuptools/config.py", line 110, in parse_configuration
    options.parse()
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/setuptools/config.py", line 382, in parse
    section_parser_method(section_options)
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/setuptools/config.py", line 520, in parse_section_entry_points
    self['entry_points'] = parsed
  File "[...]/miniconda3/envs/odl-py36_tmp/lib/python3.6/site-packages/setuptools/config.py", line 163, in __setitem__
    raise KeyError(option_name)
KeyError: 'entry_points'

In the send, I seem to end up with no installation of packaging, and setuptools version 36.4.0 and not 39.2.0 as required in according to setup.cfg. However, I do not seem to be ablo to get a later version than 36.4.0 in conda, and installing packaging (16.8.0) does not solve the problem. But it does alter the error; when running pytest the first lines now look like

=========================================================================================== test session starts ============================================================================================
platform linux -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: [...]/git/odl, inifile: setup.cfg
plugins: pep8-1.0.6
collected 3773 items / 56 errors                                                                                                                                                                            

================================================================================================== ERRORS ==================================================================================================
_____________________________________________________________________________ ERROR collecting odl/contrib/datasets/ct/mayo.py _____________________________________________________________________________
odl/contrib/datasets/ct/mayo.py:22: in <module>
    import dicom
E   ModuleNotFoundError: No module named 'dicom'
__________________________________________________________________ ERROR collecting odl/contrib/datasets/ct/examples/fips_reconstruct.py ___________________________________________________________________
odl/contrib/datasets/ct/examples/fips_reconstruct.py:10: in <module>
    ray_transform = odl.tomo.RayTransform(space, geometry)
odl/tomo/operators/ray_trafo.py:397: in __init__
    variant='forward', **kwargs)
odl/tomo/operators/ray_trafo.py:117: in __init__
    raise RuntimeError('no ray transform back-end available; '
E   RuntimeError: no ray transform back-end available; this requires 3rd party packages, please check the install docs
__________________________________________________________________ ERROR collecting odl/contrib/datasets/ct/examples/mayo_reconstruct.py ___________________________________________________________________
odl/contrib/datasets/ct/examples/mayo_reconstruct.py:11: in <module>
    from odl.contrib.datasets.ct import mayo
odl/contrib/datasets/ct/mayo.py:22: in <module>
    import dicom
E   ModuleNotFoundError: No module named 'dicom'
_________________________________________________________________________ ERROR collecting odl/contrib/datasets/images/__init__.py _________________________________________________________________________
odl/contrib/datasets/images/__init__.py:15: in <module>
    from .cambridge import *
odl/contrib/datasets/images/cambridge.py:21: in <module>
    import skimage.transform
E   ModuleNotFoundError: No module named 'skimage'
________________________________________________________________________ ERROR collecting odl/contrib/datasets/images/cambridge.py _________________________________________________________________________
odl/contrib/datasets/images/cambridge.py:21: in <module>
    import skimage.transform
E   ModuleNotFoundError: No module named 'skimage'
________________________________________________________________ ERROR collecting odl/contrib/datasets/images/examples/cambridge_images.py _________________________________________________________________
odl/contrib/datasets/images/examples/cambridge_images.py:3: in <module>
    import odl.contrib.datasets.images as images
odl/contrib/datasets/images/__init__.py:15: in <module>
    from .cambridge import *
odl/contrib/datasets/images/cambridge.py:21: in <module>
    import skimage.transform
E   ModuleNotFoundError: No module named 'skimage'
____________________________________________________________________ ERROR collecting odl/contrib/fom/examples/noise_power_spectrum.py _____________________________________________________________________
odl/contrib/fom/examples/noise_power_spectrum.py:18: in <module>
    odl.tomo.parallel_beam_geometry(space))
odl/tomo/operators/ray_trafo.py:397: in __init__
    variant='forward', **kwargs)
odl/tomo/operators/ray_trafo.py:117: in __init__
    raise RuntimeError('no ray transform back-end available; '
E   RuntimeError: no ray transform back-end available; this requires 3rd party packages, please check the install docs
aringh commented 5 years ago

Actually, looking at it I have a too old version of numpy as well... but I cannot upgrade that either in conda... :disappointed:

aringh commented 5 years ago

So... after updating my conda environment (conda update conda) I can install the later versions of dependencies, and things seem to work better. However, I still get errors on many skipif-parts, but I assume that is related to #1514.

kohr-h commented 5 years ago

So... after updating my conda environment (conda update conda) I can install the later versions of dependencies, and things seem to work better. However, I still get errors on many skipif-parts, but I assume that is related to #1514.

Those errors should be warnings though, or ignored, after applying the temporary fix in https://github.com/odlgroup/odl/commit/d1afcedaf61adb279fabd58e23b50abba2f583f2 Are you really getting errors? If yes, with variants to run the tests, i.e. pytest and odl.test()?

aringh commented 5 years ago

I use pytest, and those are really errors. And I think that this time I have all dependencies correct, with

# packages in environment at [...]/miniconda3/envs/odl-py36_new:
#
future                    0.18.2                    <pip>
numpy                     1.17.3                    <pip>
packaging                 19.2                       py_0
pytest                    5.0.1                    py36_0
scipy                     1.3.1                     <pip>
setuptools                41.6.0                   py36_0

This is the first and last parts of the (very long) output in the terminal

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.0.1, py-1.8.0, pluggy-0.13.0
rootdir: [...]/git/odl, inifile: setup.cfg, testpaths: odl
plugins: pep8-1.0.6, odl-1.0.0.dev0
collected 5075 items                                                           

odl/deform/linearized.py ...                                             [  0%]
odl/diagnostics/examples.py .                                            [  0%]
odl/discr/diff_ops.py .....                                              [  0%]
odl/discr/discr_mappings.py ..                                           [  0%]
odl/discr/discr_ops.py ...                                               [  0%]
odl/discr/discretization.py ..                                           [  0%]
odl/discr/grid.py ...........................                            [  0%]
odl/discr/lp_discr.py ............                                       [  1%]
odl/discr/partition.py ...................                               [  1%]
odl/operator/default_ops.py ................................             [  2%]
odl/operator/operator.py ..................                              [  2%]
odl/operator/oputils.py ....                                             [  2%]
odl/operator/pspace_ops.py ..................                            [  2%]
odl/operator/tensor_ops.py ............                                  [  3%]
odl/phantom/geometric.py ...                                             [  3%]
odl/set/domain.py ................                                       [  3%]
odl/set/sets.py ................                                         [  3%]
odl/set/space.py ....                                                    [  3%]
odl/solvers/functional/default_functionals.py ..................         [  4%]
odl/solvers/functional/derivatives.py ...                                [  4%]
odl/solvers/functional/example_funcs.py .                                [  4%]
odl/solvers/functional/functional.py .....                               [  4%]
odl/solvers/util/callback.py ............                                [  4%]
odl/solvers/util/steplen.py ..                                           [  4%]
odl/space/base_tensors.py ..                                             [  4%]
odl/space/fspace.py .....                                                [  4%]
odl/space/npy_tensors.py .......................                         [  5%]
odl/space/pspace.py ................                                     [  5%]
odl/space/space_utils.py ....                                            [  5%]
odl/test/test_doc.py EEEEEEEEEEEEEEEEEEEE                                [  6%]
odl/test/test_examples.py EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [  6%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                                       [  7%]
odl/test/deform/linearized_deform_test.py .................s....s....s.. [  8%]
..s..............s....s.........                                         [  8%]
odl/test/discr/diff_ops_test.py ........................................ [  9%]
........................................................................ [ 11%]
........................................................................ [ 12%]
...................................                                      [ 13%]
odl/test/discr/discr_mappings_test.py ........                           [ 13%]
odl/test/discr/discr_ops_test.py .................................       [ 13%]
odl/test/discr/grid_test.py ........................                     [ 14%]
odl/test/discr/lp_discr_test.py ........................................ [ 15%]
........................................................................ [ 16%]
...............................                                          [ 17%]
odl/test/discr/partition_test.py ...............                         [ 17%]
odl/test/largescale/solvers/nonsmooth/default_functionals_slow_test.py E [ 17%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 19%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 20%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 21%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 23%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 24%]
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [ 26%]
EEEEEEEEEEEEEEEE                                                         [ 26%]
odl/test/largescale/space/tensor_space_slow_test.py EEEEEEEEEEEEEEEEEEEE [ 26%]
EEEEEEEEEEEEEEEE                                                         [ 27%]
odl/test/largescale/tomo/analytic_slow_test.py sssssssssssssssssssssssss [ 27%]
sssssssssssssssssssssss                                                  [ 28%]
odl/test/largescale/tomo/ray_transform_slow_test.py ssssssssssssssssssss [ 28%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 29%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 31%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 32%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 34%]
ssssssssssssssssssssssssssssssssssssssssssssssssssss                     [ 35%]
odl/test/largescale/trafos/fourier_slow_test.py EEssssEEssEEssEE         [ 35%]
odl/test/operator/operator_test.py ..................................... [ 36%]
................................                                         [ 36%]
odl/test/operator/oputils_test.py ..........                             [ 37%]
odl/test/operator/pspace_ops_test.py ......................              [ 37%]
odl/test/operator/tensor_ops_test.py ..........s....s.........s......... [ 38%]
.............                                                            [ 38%]
odl/test/set/domain_test.py .......................                      [ 38%]
odl/test/set/sets_test.py ......                                         [ 38%]
odl/test/set/space_test.py ............                                  [ 39%]
odl/test/solvers/functional/default_functionals_test.py ................ [ 39%]
........................................................................ [ 40%]
.........................................................                [ 42%]
odl/test/solvers/functional/functional_test.py ......................... [ 42%]
.......................................................................s [ 44%]
s....................................................................... [ 45%]
............................                                             [ 45%]
odl/test/solvers/iterative/iterative_test.py .................           [ 46%]
odl/test/solvers/nonsmooth/admm_test.py ..                               [ 46%]
odl/test/solvers/nonsmooth/alternating_dual_updates_test.py .            [ 46%]
odl/test/solvers/nonsmooth/difference_convex_test.py .                   [ 46%]
odl/test/solvers/nonsmooth/douglas_rachford_test.py ....                 [ 46%]
odl/test/solvers/nonsmooth/forward_backward_test.py .....                [ 46%]
odl/test/solvers/nonsmooth/primal_dual_hybrid_gradient_test.py ..        [ 46%]
odl/test/solvers/nonsmooth/proximal_operator_test.py ...............     [ 46%]
odl/test/solvers/nonsmooth/proximal_utils_test.py ...................... [ 47%]
..................................................                       [ 48%]
odl/test/solvers/smooth/smooth_test.py ................................. [ 48%]
...............................                                          [ 49%]
odl/test/solvers/util/steplen_test.py ...                                [ 49%]
odl/test/space/fspace_test.py .......................................... [ 50%]
........................................................................ [ 51%]
....................................                                     [ 52%]
odl/test/space/pspace_test.py .......................................... [ 53%]
.........................................ss                              [ 54%]
odl/test/space/space_utils_test.py .                                     [ 54%]
odl/test/space/tensors_test.py ......................................... [ 55%]
........................................................................ [ 56%]
........................................................................ [ 57%]
........................................................................ [ 59%]
........................................................................ [ 60%]
........................................................................ [ 62%]
........................................................................ [ 63%]
........................................................................ [ 65%]
........................................................................ [ 66%]
........................................................................ [ 67%]
........................................................................ [ 69%]
........................................................................ [ 70%]
........................................................................ [ 72%]
........................................................................ [ 73%]
.............................................                            [ 74%]
odl/test/system/import_test.py .                                         [ 74%]
odl/test/tomo/backends/astra_cpu_test.py ss                              [ 74%]
odl/test/tomo/backends/astra_cuda_test.py sssss                          [ 74%]
odl/test/tomo/backends/astra_setup_test.py ssssssssssss                  [ 74%]
odl/test/tomo/backends/skimage_test.py s                                 [ 74%]
odl/test/tomo/geometry/geometry_test.py ................................ [ 75%]
...................                                                      [ 75%]
odl/test/tomo/geometry/spect_geometry_test.py .                          [ 75%]
odl/test/tomo/operators/ray_trafo_test.py ssssssssssssssssssssssssssssss [ 76%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 77%]
ssssssssssssssssssss                                                     [ 78%]
odl/test/trafos/fourier_test.py ...................................sssss [ 79%]
ssssssssssss......ss......ss.s.............                              [ 79%]
odl/test/trafos/wavelet_test.py ssssssssssssssssssssssssssssssssssssssss [ 80%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 82%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 83%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 84%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 86%]
ssssssss                                                                 [ 86%]
odl/test/trafos/backends/pyfftw_bindings_test.py sssssssssssssssssssssss [ 86%]
ssssssssssssssss                                                         [ 87%]
odl/test/trafos/backends/pywt_bindings_test.py ssssss                    [ 87%]
odl/test/trafos/util/ft_utils_test.py ..................                 [ 87%]
odl/test/util/normalize_test.py ........................................ [ 88%]
...........                                                              [ 88%]
odl/test/util/numerics_test.py ......................................... [ 89%]
........................................................................ [ 90%]
........................................................................ [ 92%]
........................................................................ [ 93%]
..............................................                           [ 94%]
odl/test/util/utility_test.py ....                                       [ 94%]
odl/test/util/vectorization_test.py .........                            [ 94%]
odl/tomo/analytic/filtered_back_projection.py .                          [ 95%]
odl/tomo/geometry/conebeam.py ............                               [ 95%]
odl/tomo/geometry/detector.py ................                           [ 95%]
odl/tomo/geometry/geometry.py ..                                         [ 95%]
odl/tomo/geometry/parallel.py ..............                             [ 95%]
odl/tomo/util/utility.py ....                                            [ 95%]
odl/trafos/fourier.py ..                                                 [ 96%]
odl/ufunc_ops/ufunc_ops.py ............................................. [ 96%]
........................................................................ [ 98%]
..........................................................               [ 99%]
odl/util/normalize.py ....                                               [ 99%]
odl/util/numerics.py ...                                                 [ 99%]
odl/util/testutils.py ....                                               [ 99%]
odl/util/utility.py ................                                     [ 99%]
odl/util/vectorization.py .                                              [100%]

==================================== ERRORS ====================================
_ ERROR at setup of test_file[/home/axel/git/odl/doc/source/guide/vectorization_guide.rst] _
Error evaluating 'skipif' expression
    not pytest.config.getoption('--doctest-doc')
pytest.PytestDeprecationWarning: the `pytest.config` global is deprecated.  Please use `request.config` or `pytest_configure` (if you're a pytest plugin) instead.

[...]
[...]
[...]

_ ERROR at setup of test_fourier_trafo_forward_complex[ domain=uniform_discr([-2., -2., -2.], [ 2.,  2.,  2.], (200, 200, 200), dtype=complex) - impl=ParameterSet(values=('numpy',), marks=(), id=None) ] _
Error evaluating 'skipif' expression
    not pytest.config.getoption('--largescale')
pytest.PytestDeprecationWarning: the `pytest.config` global is deprecated.  Please use `request.config` or `pytest_configure` (if you're a pytest plugin) instead.

=============================== warnings summary ===============================
odl/operator/oputils.py::odl.operator.oputils.as_scipy_operator
  [...]/miniconda3/envs/odl-py36_new/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/iterative.py:2: DeprecationWarning: scipy.sparse.linalg.cg called without specifying `atol`. The default value will be changed in a future release. For compatibility, specify a value for `atol` explicitly, e.g., ``cg(..., atol=0)``, or to retain the old behavior ``cg(..., atol='legacy')``

odl/test/solvers/functional/default_functionals_test.py::test_kullback_leibler_cross_entorpy[ space=power_space_unif_discr - tspace_impl='numpy' ]
  [...]/git/odl/odl/space/npy_tensors.py:430: ComplexWarning: Casting complex values to real discards the imaginary part
    order=order)

odl/test/solvers/functional/default_functionals_test.py::test_kullback_leibler_cross_entorpy[ space=r10 - tspace_impl='numpy' ]
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: overflow encountered in exp
    res = ufunc(*inputs, **kwargs)

odl/test/solvers/functional/default_functionals_test.py::test_kullback_leibler_cross_entorpy[ space=r10 - tspace_impl='numpy' ]
  [...]/git/odl/odl/space/npy_tensors.py:1797: RuntimeWarning: invalid value encountered in multiply
    out.data[:] = a * x1.data + b * x2.data

odl/test/space/pspace_test.py::test_real_setter_product_space[ space=product_space - element=space ]
odl/test/space/pspace_test.py::test_imag_setter_product_space[ space=product_space - element=space ]
odl/test/space/pspace_test.py::test_real_setter_product_space[ space=power_space - element=space ]
odl/test/space/pspace_test.py::test_imag_setter_product_space[ space=power_space - element=space ]
  [...]/git/odl/odl/space/base_tensors.py:666: ComplexWarning: Casting complex values to real discards the imaginary part
    return self.asarray().astype(dtype, copy=False)

odl/test/trafos/util/ft_utils_test.py::test_reciprocal_grid_nd_axes
odl/test/trafos/util/ft_utils_test.py::test_reciprocal_grid_nd_axes
  [...]/git/odl/odl/util/testutils.py:114: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
    if iter1 == iter2:

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arccos_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in arccos
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arccosh_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in arccosh
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arcsin_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in arcsin
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arctanh_func
  [...]/git/odl/odl/ufunc_ops/ufunc_ops.py:334: RuntimeWarning: divide by zero encountered in arctanh
    return getattr(np, name)(x)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arctanh_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: divide by zero encountered in arctanh
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.arctanh_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in arctanh
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.log10_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in log10
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.log1p_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: divide by zero encountered in log1p
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.log2_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in log2
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.log_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in log
    res = ufunc(*inputs, **kwargs)

odl/ufunc_ops/ufunc_ops.py::odl.ufunc_ops.ufunc_ops.sqrt_op
  [...]/git/odl/odl/space/npy_tensors.py:1669: RuntimeWarning: invalid value encountered in sqrt
    res = ufunc(*inputs, **kwargs)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
====== 3508 passed, 974 skipped, 21 warnings, 593 error in 19.24 seconds =======
aringh commented 5 years ago

Looking at the output again, the errors are confined to the following files

So the errors are confined to the test folder itself, or slow tests that should not be run since I did not give the flag --largescale.

kohr-h commented 5 years ago

It's clearly #1514, but it shouldn't result in errors anyway...

One thing that strikes me is that it says inifile: setup.cfg at the top, and I realized that the fix

# Temporary fix for https://github.com/odlgroup/odl/issues/1514, works with pytest<5.1
filterwarnings =
    ignore::pytest.PytestDeprecationWarning

is only in odl/pytest.ini, not in setup.cfg. It seems like pytest will pick up the latter for configuration (since there is a [tool:pytest] section, unless run explicitly with pytest odl/test or so.

Could you try adding the above lines to the setup.cfg section?

I just tried a fresh installation of master and can't reproduce the errors. I'm on pytest 4.* though.

aringh commented 5 years ago

You seem to correctly have identified the problem :smile: When I run python -c "import odl; odl.test()" I do not get errors, but when I run pytest I do. And adding the above line in setup.cfg, under [tool:pytest], removes the errors. I will push the fix.

kohr-h commented 5 years ago

Great, thanks for investigating!