Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • kwant kwant
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 142
    • Issues 142
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • kwant
  • kwantkwant
  • Issues
  • #359
Closed
Open
Created Mar 16, 2020 by Joseph Weston@jbwestonOwner

Kwant tests fail on Python 3.8

Environment

  • WSL2, Ubuntu 18.04
  • Conda 4.8.2

What version was the error seen on?

v1.4.1, stable and master

Steps to reproduce

place conda-env.patch in the root of the Kwant repo, then:

git checkout stable
git apply conda-env.patch
conda env create -n kwant-latest -f docker/kwant-latest.yml
python setup.py build_ext --inplace
pytest kwant

prodcuces an error in test_builder.py:test_finalization:

kwant/tests/test_builder.py:388:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fsyst = <kwant.builder.FiniteSystem object at 0x7f5ef126f850>
sites = {(0, 0): -0.17555375909487236, (0, 5): 0.0431815434225844, (0, 6): -0.4635004019048141, (0, 8): 0.4275265013095295, ...}
subset = False, check_values = True

    def check_onsite(fsyst, sites, subset=False, check_values=True):
        freq = {}
        for node in range(fsyst.graph.num_nodes):
            site = fsyst.sites[node].tag
            freq[site] = freq.get(site, 0) + 1
            if check_values and site in sites:
                assert fsyst.onsites[node][0] is sites[site]
        if not subset:
            # Check that all sites of `fsyst` are in `sites`.
            for site in freq.keys():
>               assert site in sites
E               assert array([0, 0]) in {(0, 0): -0.17555375909487236, (0, 5): 0.0431815434225844, (0, 6): -0.4635004019048141, (0, 8): 0.4275265013095295, ...}   
kwant/tests/test_builder.py:302: AssertionError
Edited Mar 16, 2020 by Joseph Weston
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking