From 82b584cd1c73cfcab92a4d5931ebe97b1db3078a Mon Sep 17 00:00:00 2001 From: Joseph Weston <joseph.weston08@gmail.com> Date: Wed, 14 Jun 2017 14:06:38 +0200 Subject: [PATCH] remove erroneous lead from test system The lead does not have connected unit cells and serves no purpose. We also remove the check for the number of 'collections' in the resulting plots, as now both 'syst_2d' and 'syst_3d' produce systems with 2 leads. --- kwant/tests/test_plotter.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kwant/tests/test_plotter.py b/kwant/tests/test_plotter.py index 84a3a5c6..11266b4e 100644 --- a/kwant/tests/test_plotter.py +++ b/kwant/tests/test_plotter.py @@ -71,13 +71,10 @@ def syst_2d(W=3, r1=3, r2=8): syst[lat.neighbors()] = -t sym_lead0 = kwant.TranslationalSymmetry(lat.vec((-1, 0))) lead0 = kwant.Builder(sym_lead0) - lead2 = kwant.Builder(sym_lead0) lead_shape = lambda pos: (-W / 2 < pos[1] < W / 2) lead0[lat.shape(lead_shape, (0, 0))] = 4 * t - lead2[lat.shape(lead_shape, (0, 0))] = 4 * t - syst.attach_lead(lead2) lead0[lat.neighbors()] = - t lead1 = lead0.reversed() syst.attach_lead(lead0) @@ -123,8 +120,7 @@ def test_plot(): if (color != 'k' and isinstance(color(next(iter(syst2d.sites()))), float)): assert fig.axes[0].collections[0].get_array() is not None - assert len(fig.axes[0].collections) == (8 if syst is syst2d else - 6) + assert len(fig.axes[0].collections) == 6 color_opts = ['k', (lambda site, site2: site.tag[0]), lambda site, site2: (abs(site.tag[0] / 100), abs(site.tag[1] / 100), 0)] -- GitLab