Commit ee04a2ce authored by Kelvin Loh's avatar Kelvin Loh

Test 5.

parent 63e23157
Pipeline #25626 failed with stages
in 7 minutes and 43 seconds
......@@ -136,7 +136,7 @@ def test_matplotlib_plot():
lambda site: (abs(site.tag[0] / 100),
abs(site.tag[1] / 100), 0)]
engine = plotter.get_engine()
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
for color in color_opts:
for syst in (syst2d, syst3d):
fig = plot(syst, site_color=color, cmap='binary', file=out)
......@@ -182,7 +182,7 @@ def test_plotly_plot():
lambda site: (abs(site.tag[0] / 100),
abs(site.tag[1] / 100), 0)]
engine = plotter.get_engine()
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
for color in color_opts:
for syst in (syst2d, syst3d):
plot(syst, site_color=color, cmap='binary', file=out, show=False)
......@@ -218,7 +218,7 @@ def test_plot_more_site_families_than_colors(engine):
syst[lat(i, 0)] = None
plotter.set_engine(engine)
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
print(out)
plotter.plot(syst, file=out, show=False)
......@@ -254,7 +254,7 @@ def test_map(engine):
plotter.set_engine(engine)
syst = syst_2d()
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
plotter.map(syst, lambda site: site.tag[0], pos_transform=good_transform,
file=out, method='linear', a=4, oversampling=4, cmap='flag', show=False)
pytest.raises(ValueError, plotter.map, syst,
......@@ -295,7 +295,7 @@ def test_bands(engine):
syst = syst_2d().finalized().leads[0]
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
plotter.bands(syst, show=False, file=out)
plotter.bands(syst, show=False, momenta=np.linspace(0, 2 * np.pi), file=out)
......@@ -328,7 +328,7 @@ def test_spectrum(engine):
vals = np.linspace(0, 1, 3)
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
for ham in (ham_1d, ham_2d, fsyst):
plotter.spectrum(ham, ('a', vals), params=dict(b=1, c=1), file=out, show=False)
......@@ -360,7 +360,7 @@ def test_spectrum(engine):
def mask(a, b):
return a > 0.5
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out:
with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)).name as out:
plotter.spectrum(ham, ('a', vals), ('b', 2 * vals), params=dict(c=1),
mask=mask, file=out, show=False)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment