def test_bands(): syst = syst_2d().finalized().leads[0] with tempfile.TemporaryFile('w+b') as out: plotter.bands(syst, file=out) plotter.bands(syst, fig_size=(10, 10), file=out) plotter.bands(syst, momenta=np.linspace(0, 2 * np.pi), file=out) fig = pyplot.Figure() ax = fig.add_subplot(1, 1, 1) plotter.bands(syst, ax=ax, file=out)
def test_bands(engine): plotter.set_engine(engine) syst = syst_2d().finalized().leads[0] with tempfile.NamedTemporaryFile('w+b', suffix=plotter_file_suffix(engine)) as out: out_filename = out.name plotter.bands(syst, show=False, file=out_filename) plotter.bands(syst, show=False, momenta=np.linspace(0, 2 * np.pi), file=out_filename) if engine == 'matplotlib': plotter.bands(syst, show=False, fig_size=(10, 10), file=out_filename) fig = pyplot.Figure() ax = fig.add_subplot(1, 1, 1) plotter.bands(syst, show=False, ax=ax, file=out_filename)