def test_invalid_suffix(tmp_path): from pylbo.exceptions import InvalidLegolasFile parfile = tmp_path / "parfile.par" parfile.write_text("content") with pytest.raises(InvalidLegolasFile): pylbo.load(parfile)
def ds_test(setup): if setup["test_needs_run"]: parfile = pylbo.generate_parfiles( parfile_dict=setup["config"], basename=setup["datfile"].stem, output_dir=setup["config"]["output_folder"], ) pylbo.run_legolas(parfile, remove_parfiles=True) setup["test_needs_run"] = False return pylbo.load(setup["datfile"])
def _main(): parser = ArgumentParser() parser.add_argument('-i', '--datfile', dest='datfile') args = parser.parse_args() datfile = args.datfile if datfile is None: datfile = Path('output/datfile.dat').resolve() if not datfile.is_file(): raise FileNotFoundError(datfile) ds = pylbo.load(datfile) p2 = pylbo.plot_equilibrium(ds) p = pylbo.plot_spectrum(ds) p.add_continua() p.add_eigenfunctions() p.showall()
def ds_answer(setup): return pylbo.load(setup["answer_datfile"])
def test_load_invalid(datfile_v0, datfile_v1): with pytest.raises(ValueError): pylbo.load([datfile_v0, datfile_v1])
def test_invalid_file(): with pytest.raises(FileNotFoundError): pylbo.load("unknown_file")
def datfile_v1(): return pylbo.load(utils / "v1_datfile_matrices.dat")
def datfile_v09(): return pylbo.load(utils / "v0.9.0_datfile.dat")
def datfile_v0(): return pylbo.load(utils / "v0_datfile_efs.dat")