Running with gitlab-runner 12.9.0 (4c96e5ad)
  on universal-tn4 d3cf9985
section_start:1611141550:prepare_executor
Preparing the "docker" executor
Using Docker executor with image gitlab.kwant-project.org:5005/kwant/kwant ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image gitlab.kwant-project.org:5005/kwant/kwant ...
Using docker image sha256:3b0a14e5028f34c59abed300d492408bf827d6fe5523e89ea589cab97af9f9c8 for gitlab.kwant-project.org:5005/kwant/kwant ...
section_end:1611141550:prepare_executor
section_start:1611141550:prepare_script
Preparing environment
Authenticating with credentials from /root/.docker/config.json
Running on runner-d3cf9985-project-1202-concurrent-3 via tnw-tn4.tudelft.net...
section_end:1611141556:prepare_script
section_start:1611141556:get_sources
Getting source from Git repository
Authenticating with credentials from /root/.docker/config.json
Fetching changes...
Reinitialized existing Git repository in /builds/quaeritis/kwant/.git/
Checking out 888a0e6a as phi_matrix...
Removing build.conf
Removing build/
Removing kwant/__pycache__/
Removing kwant/_system.c
Removing kwant/_system.cpython-37m-x86_64-linux-gnu.so
Removing kwant/graph/core.c
Removing kwant/graph/core.cpython-37m-x86_64-linux-gnu.so
Removing kwant/graph/dijkstra.c
Removing kwant/graph/dijkstra.cpython-37m-x86_64-linux-gnu.so
Removing kwant/linalg/_mumps.c
Removing kwant/linalg/_mumps.cpython-37m-x86_64-linux-gnu.so
Removing kwant/linalg/lapack.c
Removing kwant/linalg/lapack.cpython-37m-x86_64-linux-gnu.so
Removing kwant/operator.c
Removing kwant/operator.cpython-37m-x86_64-linux-gnu.so

Skipping Git submodules setup
section_end:1611141561:get_sources
section_start:1611141561:restore_cache
Restoring cache
Authenticating with credentials from /root/.docker/config.json
section_end:1611141567:restore_cache
section_start:1611141567:download_artifacts
Downloading artifacts
Authenticating with credentials from /root/.docker/config.json
Downloading artifacts for build:latest (157898)...
Downloading artifacts from coordinator... ok        id=157898 responseStatus=200 OK token=eikNcExA
section_end:1611141573:download_artifacts
section_start:1611141573:build_script
Running before_script and script
Authenticating with credentials from job payload (GitLab Registry)
$ source deactivate
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
$ source activate kwant-latest
$ py.test -r w --flakes kwant --junitxml=tests.xml --durations=10
/usr/local/envs/kwant-latest/lib/python3.9/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
============================= test session starts ==============================
platform linux -- Python 3.9.0, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /builds/quaeritis/kwant, configfile: pytest.ini, testpaths: kwant
plugins: cov-2.10.1, flakes-4.0.2, pep8-1.0.6
collected 550 items

kwant/__init__.py .                                                      [  0%]
kwant/_colormaps.py .                                                    [  0%]
kwant/_common.py .                                                       [  0%]
kwant/_kwant_version.py .                                                [  0%]
kwant/_plotter.py .                                                      [  0%]
kwant/builder.py F                                                       [  1%]
kwant/digest.py .                                                        [  1%]
kwant/kpm.py .                                                           [  1%]
kwant/lattice.py .                                                       [  1%]
kwant/plotter.py .                                                       [  1%]
kwant/qsymm.py .                                                         [  2%]
kwant/rmt.py .                                                           [  2%]
kwant/system.py .                                                        [  2%]
kwant/version.py .                                                       [  2%]
kwant/wraparound.py .                                                    [  2%]
kwant/continuum/__init__.py .                                            [  2%]
kwant/continuum/_common.py .                                             [  3%]
kwant/continuum/discretizer.py .                                         [  3%]
kwant/continuum/landau_levels.py .                                       [  3%]
kwant/continuum/tests/__init__.py .                                      [  3%]
kwant/continuum/tests/test_common.py ................................... [ 10%]
.....                                                                    [ 10%]
kwant/continuum/tests/test_discretizer.py .............................. [ 16%]
..............................                                           [ 21%]
kwant/continuum/tests/test_landau_levels.py .......                      [ 23%]
kwant/graph/__init__.py .                                                [ 23%]
kwant/graph/defs.py .                                                    [ 23%]
kwant/graph/tests/__init__.py .                                          [ 23%]
kwant/graph/tests/test_core.py .........                                 [ 25%]
kwant/graph/tests/test_scotch.py .                                       [ 25%]
kwant/linalg/__init__.py .                                               [ 25%]
kwant/linalg/cmumps.py .                                                 [ 25%]
kwant/linalg/decomp_ev.py .                                              [ 26%]
kwant/linalg/decomp_lu.py .                                              [ 26%]
kwant/linalg/decomp_schur.py .                                           [ 26%]
kwant/linalg/fortran_helpers.py .                                        [ 26%]
kwant/linalg/lll.py .                                                    [ 26%]
kwant/linalg/mumps.py .                                                  [ 26%]
kwant/linalg/tests/__init__.py .                                         [ 27%]
kwant/linalg/tests/_test_utils.py .                                      [ 27%]
kwant/linalg/tests/test_linalg.py ............                           [ 29%]
kwant/linalg/tests/test_lll.py ...                                       [ 30%]
kwant/linalg/tests/test_mumps.py .....                                   [ 30%]
kwant/physics/__init__.py .                                              [ 31%]
kwant/physics/dispersion.py .                                            [ 31%]
kwant/physics/gauge.py .                                                 [ 31%]
kwant/physics/leads.py .                                                 [ 31%]
kwant/physics/noise.py .                                                 [ 31%]
kwant/physics/symmetry.py .                                              [ 32%]
kwant/physics/tests/__init__.py .                                        [ 32%]
kwant/physics/tests/test_dispersion.py ........                          [ 33%]
kwant/physics/tests/test_gauge.py ...................................... [ 40%]
...............                                                          [ 43%]
kwant/physics/tests/test_leads.py .........................              [ 47%]
kwant/physics/tests/test_noise.py ...                                    [ 48%]
kwant/physics/tests/test_symmetry.py ......                              [ 49%]
kwant/solvers/__init__.py .                                              [ 49%]
kwant/solvers/common.py .                                                [ 49%]
kwant/solvers/default.py .                                               [ 50%]
kwant/solvers/mumps.py .                                                 [ 50%]
kwant/solvers/sparse.py .                                                [ 50%]
kwant/solvers/tests/__init__.py .                                        [ 50%]
kwant/solvers/tests/test_solvers.py .................................... [ 57%]
........................................................................ [ 70%]
.....                                                                    [ 71%]
kwant/tests/__init__.py .                                                [ 71%]
kwant/tests/test_builder.py .......................................F     [ 78%]
kwant/tests/test_comprehensive.py ..                                     [ 78%]
kwant/tests/test_kpm.py ...........................                      [ 83%]
kwant/tests/test_lattice.py ....................                         [ 87%]
kwant/tests/test_operator.py .................                           [ 90%]
kwant/tests/test_plotter.py ...................                          [ 94%]
kwant/tests/test_qsymm.py ............                                   [ 96%]
kwant/tests/test_rmt.py ....                                             [ 96%]
kwant/tests/test_system.py .....                                         [ 97%]
kwant/tests/test_wraparound.py ............                              [100%]

=================================== FAILURES ===================================
________________________________ pyflakes-check ________________________________
/builds/quaeritis/kwant/kwant/builder.py:1565: UndefinedName
undefined name 'args'
/builds/quaeritis/kwant/kwant/builder.py:1567: UndefinedName
undefined name 'args'
____________________________ test_add_peierls_phase ____________________________

self = <kwant.builder.InfiniteSystem object at 0x7fd33e7460d0>, i = 1, j = 0
params = {'phi': functools.partial(<function _finite_wrapper at 0x7fd3470c1790>, <kwant.builder.FiniteSystem object at 0x7fd33e...r.InfiniteSystem object at 0x7fd33ec10490>, {(1, 6): (1+0j), (2, 7): (1+0j), (3, 8): (1+0j), (4, 9): (1+0j)}), 't': -1}
args = <map object at 0x7fd33eacf490>
value = <function _add_peierls_phase.<locals>.const_hopping at 0x7fd33ec16af0>
param_names = ('phi_lead0',)

    def hamiltonian(self, i, j, *args, params=None):
        if args and params:
            raise TypeError("'args' and 'params' are mutually exclusive.")
        if i == j:
            value, param_names = self.onsites[i]
            if param_names is not None:  # 'value' is callable
                site = self.symmetry.to_fd(self.sites[i])
                if params:
                    # See body of _value_params_pair_cache().
                    if isinstance(param_names, Exception):
                        raise param_names
                    args = map(params.__getitem__, param_names)
                try:
                    value = value(site, *args)
                except Exception as exc:
                    if isinstance(exc, KeyError) and params:
                        missing = [p for p in param_names if p not in params]
                        if missing:
                            msg = ('System is missing required arguments: ',
                                   ', '.join(map('"{}"'.format, missing)))
                            raise TypeError(''.join(msg))
                    _raise_user_error(exc, value)
        else:
            edge_id = self.graph.first_edge_id(i, j)
            value, param_names = self.hoppings[edge_id]
            conj = value is Other
            if conj:
                i, j = j, i
                edge_id = self.graph.first_edge_id(i, j)
                value, param_names = self.hoppings[edge_id]
            if param_names is not None:  # 'value' is callable
                sites = self.sites
                site_i, site_j = self.symmetry.to_fd(sites[i], sites[j])
                if params:
                    # See body of _value_params_pair_cache().
                    if isinstance(param_names, Exception):
                        raise param_names
                    args = map(params.__getitem__, param_names)
                try:
>                   value = value(site_i, site_j, *args)

kwant/builder.py:1817: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = Site(kwant.lattice.Monatomic([[1.0, 0.0], [0.0, 1.0]], [0.0, 0.0], '', 1), array([0, 1]))
b = Site(kwant.lattice.Monatomic([[1.0, 0.0], [0.0, 1.0]], [0.0, 0.0], '', 1), array([0, 0]))
phi = functools.partial(<function _infinite_wrapper at 0x7fd3470c1820>, <kwant.builder.InfiniteSystem object at 0x7fd33e7460d0>, {(1, 6): (1+0j), (2, 7): (1+0j), (3, 8): (1+0j), (4, 9): (1+0j)})

    def const_hopping(a, b, phi):
        if signs is not None:
            return np.dot(hop(a, b, *args), phi_matrix(phi(a, b), signs))
        else:
>           return hop(a, b, *args) * phi(a, b)
E           NameError: name 'args' is not defined

kwant/builder.py:1567: NameError

The above exception was the direct cause of the following exception:

    def test_add_peierls_phase():
    
        lat = kwant.lattice.square(norbs=1)
        syst = kwant.Builder()
        syst[(lat(i, j) for i in range(5) for j in range(5))] = 4
        syst[lat.neighbors()] = lambda a, b, t: -t
    
        lead = kwant.Builder(kwant.TranslationalSymmetry((-1, 0)))
        lead[(lat(0, j) for j in range(5))] = 4
        lead[lat.neighbors()] = -1
    
        # System without leads
        syst_without_lead, phase_without_lead = builder.add_peierls_phase(syst)
    
        assert isinstance(syst_without_lead, builder.FiniteSystem)
    
        params_without_lead = phase_without_lead(1)
    
        assert all(p in params_without_lead for p in ('phi',))
    
        # System with leads
        syst.attach_lead(lead)
        syst.attach_lead(lead.reversed())
    
        syst, phase = builder.add_peierls_phase(syst)
    
        assert isinstance(syst, builder.FiniteSystem)
    
        params = phase(1, 0, 0)
    
        assert all(p in params for p in ('phi', 'phi_lead0', 'phi_lead1'))
    
>       kwant.smatrix(syst, energy=0.1, params=dict(t=-1, **params))

kwant/tests/test_builder.py:1776: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
kwant/_common.py:73: in inner
    return f(*args, **kwargs)
kwant/solvers/common.py:381: in smatrix
    linsys, lead_info = self._make_linear_sys(syst, in_leads, energy, args,
kwant/solvers/common.py:204: in _make_linear_sys
    prop, stab = lead.modes(energy, args, params=params)
kwant/_common.py:73: in inner
    return f(*args, **kwargs)
kwant/system.py:788: in modes
    ham = self.cell_hamiltonian(args, params=params)
kwant/_common.py:73: in inner
    return f(*args, **kwargs)
kwant/system.py:904: in cell_hamiltonian
    return self.hamiltonian_submatrix(args, cell_sites, cell_sites,
kwant/_common.py:73: in inner
    return f(*args, **kwargs)
kwant/_system.pyx:340: in kwant._system.hamiltonian_submatrix
    mat = func(ham, args, params, self.graph, diag, from_sites,
kwant/_system.pyx:190: in kwant._system.make_dense
    h = matrix(ham(ts, fs, *args, params=params), complex)
kwant/builder.py:2798: in hamiltonian
    return super().hamiltonian(i, j, *args, params=params)
kwant/builder.py:1825: in hamiltonian
    _raise_user_error(exc, value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

exc = NameError("name 'args' is not defined")
func = <function _add_peierls_phase.<locals>.const_hopping at 0x7fd33ec16af0>

    def _raise_user_error(exc, func):
        msg = ('Error occurred in user-supplied value function "{0}".\n'
               'See the upper part of the above backtrace for more information.')
>       raise UserCodeError(msg.format(func.__name__)) from exc
E       kwant._common.UserCodeError: Error occurred in user-supplied value function "const_hopping".
E       See the upper part of the above backtrace for more information.

kwant/builder.py:1721: UserCodeError
=============================== warnings summary ===============================
../../../usr/local/envs/kwant-latest/lib/python3.9/site-packages/setuptools/lib2to3_ex.py:13
  /usr/local/envs/kwant-latest/lib/python3.9/site-packages/setuptools/lib2to3_ex.py:13: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
    from lib2to3.refactor import RefactoringTool, get_fixers_from_package

-- Docs: https://docs.pytest.org/en/stable/warnings.html
------------ generated xml file: /builds/quaeritis/kwant/tests.xml -------------
============================= slowest 10 durations =============================
5.60s call     kwant/tests/test_qsymm.py::test_find_builder_discrete_symmetries
3.72s call     kwant/tests/test_plotter.py::test_density_interpolation
2.63s call     kwant/tests/test_plotter.py::test_current
2.55s call     kwant/tests/test_plotter.py::test_plotly_plot
2.21s call     kwant/tests/test_plotter.py::test_matplotlib_plot
2.00s call     kwant/tests/test_qsymm.py::test_inverse_transform
2.00s call     kwant/tests/test_plotter.py::test_current_interpolation
1.82s call     kwant/tests/test_plotter.py::test_spectrum[matplotlib]
1.66s call     kwant/physics/tests/test_gauge.py::test_minimal_cycle_basis[2-honeycomb-half-ring]
1.55s call     kwant/tests/test_kpm.py::test_check_convergence_decreasing_values
============= 2 failed, 548 passed, 1 warning in 81.57s (0:01:21) ==============
section_end:1611141661:build_script
section_start:1611141661:after_script
Running after_script
section_end:1611141663:after_script
section_start:1611141663:upload_artifacts_on_failure
Uploading artifacts for failed job
Authenticating with credentials from /root/.docker/config.json
Uploading artifacts...
tests.xml: found 1 matching files                  
Uploading artifacts to coordinator... ok            id=157905 responseStatus=201 Created token=K_uXrWRA
section_end:1611141666:upload_artifacts_on_failure
ERROR: Job failed: exit code 1