Skip to content

pytest fails in contrib/quimb #3769

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

Closed
kevinsung opened this issue Feb 9, 2021 · 1 comment · Fixed by #4296
Closed

pytest fails in contrib/quimb #3769

kevinsung opened this issue Feb 9, 2021 · 1 comment · Fixed by #4296
Labels
area/contrib/quimb area/python area/testing kind/bug-report Something doesn't seem to work. kind/health For CI/testing/release process/refactoring/technical debt items

Comments

@kevinsung
Copy link
Collaborator

Description of the issue
pytest fails to run tests in contrib/quimb. I'm running Python 3.9.1.

How to reproduce the issue
In a fresh virtual environment, install Cirq, the dev tools, and the contrib requirements. Then run

./check/pytest

This gives 4 errors; they're all similar so I'll just display one here:

___________________________________________________________________________ ERROR collecting cirq/contrib/quimb/density_matrix_test.py ____________________________________________________________________________
../../environments/cirq/lib/python3.9/site-packages/py/_path/local.py:704: in pyimport
    __import__(modname)
cirq/contrib/quimb/__init__.py:1: in <module>
    from cirq.contrib.quimb.state_vector import (
cirq/contrib/quimb/state_vector.py:5: in <module>
    import quimb
../../environments/cirq/lib/python3.9/site-packages/quimb/__init__.py:62: in <module>
    from .linalg.base_linalg import (
../../environments/cirq/lib/python3.9/site-packages/quimb/linalg/base_linalg.py:12: in <module>
    from .numpy_linalg import (
../../environments/cirq/lib/python3.9/site-packages/quimb/linalg/numpy_linalg.py:9: in <module>
    from .autoblock import eigensystem_autoblocked
../../environments/cirq/lib/python3.9/site-packages/quimb/linalg/autoblock.py:14: in <module>
    def _add_to_groups(i, j, groups):  # pragma: no cover
../../environments/cirq/lib/python3.9/site-packages/numba/core/decorators.py:218: in wrapper
    disp.compile(sig)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_lock.py:32: in _acquire_compile_lock
    return func(*args, **kwargs)
../../environments/cirq/lib/python3.9/site-packages/numba/core/dispatcher.py:819: in compile
    cres = self._compiler.compile(args, return_type)
../../environments/cirq/lib/python3.9/site-packages/numba/core/dispatcher.py:78: in compile
    status, retval = self._compile_cached(args, return_type)
../../environments/cirq/lib/python3.9/site-packages/numba/core/dispatcher.py:92: in _compile_cached
    retval = self._compile_core(args, return_type)
../../environments/cirq/lib/python3.9/site-packages/numba/core/dispatcher.py:105: in _compile_core
    cres = compiler.compile_extra(self.targetdescr.typing_context,
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler.py:627: in compile_extra
    return pipeline.compile_extra(func)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler.py:363: in compile_extra
    return self._compile_bytecode()
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler.py:425: in _compile_bytecode
    return self._compile_core()
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler.py:405: in _compile_core
    raise e
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler.py:396: in _compile_core
    pm.run(self.state)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_machinery.py:341: in run
    raise patched_exception
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_machinery.py:332: in run
    self._runPass(idx, pass_inst, state)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_lock.py:32: in _acquire_compile_lock
    return func(*args, **kwargs)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_machinery.py:291: in _runPass
    mutated |= check(pss.run_pass, internal_state)
../../environments/cirq/lib/python3.9/site-packages/numba/core/compiler_machinery.py:264: in check
    mangled = func(compiler_state)
../../environments/cirq/lib/python3.9/site-packages/numba/core/untyped_passes.py:86: in run_pass
    func_ir = interp.interpret(bc)
../../environments/cirq/lib/python3.9/site-packages/numba/core/interpreter.py:125: in interpret
    flow.run()
../../environments/cirq/lib/python3.9/site-packages/numba/core/byteflow.py:107: in run
    runner.dispatch(state)
../../environments/cirq/lib/python3.9/site-packages/numba/core/byteflow.py:269: in dispatch
    raise UnsupportedError(msg, loc=self.get_debug_loc(inst.lineno))
E   numba.core.errors.UnsupportedError: Failed in nopython mode pipeline (step: analyzing bytecode)
E   Use of unsupported opcode (CONTAINS_OP) found
E   
E   File "../../environments/cirq/lib/python3.9/site-packages/quimb/linalg/autoblock.py", line 16:
E   def _add_to_groups(i, j, groups):  # pragma: no cover
E       <source elided>
E       for group in groups:
E           if i in group:
E           ^
E   

Cirq version
f08b344

@kevinsung kevinsung added the kind/bug-report Something doesn't seem to work. label Feb 9, 2021
@kevinsung
Copy link
Collaborator Author

I fixed this by installing numba at the commit tagged 0.53.0rc1 from https://github.com/numba/numba.

@balopat balopat added area/testing area/contrib/quimb kind/health For CI/testing/release process/refactoring/technical debt items labels Feb 23, 2021
CirqBot pushed a commit that referenced this issue Jul 7, 2021
Adds py39 to windows, mac and linux pytest matrices.
Fixes #3772 
Fixes #3769
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Adds py39 to windows, mac and linux pytest matrices.
Fixes quantumlib#3772 
Fixes quantumlib#3769
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
Adds py39 to windows, mac and linux pytest matrices.
Fixes quantumlib#3772 
Fixes quantumlib#3769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/contrib/quimb area/python area/testing kind/bug-report Something doesn't seem to work. kind/health For CI/testing/release process/refactoring/technical debt items
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants