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