Esempio n. 1
0
def test_process_file_outfile(infile, outfile):
    df = read.process_file(infile, wave_number=2.90, outfile=outfile)
    assert df is None

    with pandas.HDFStore(outfile) as src:
        for key in ["molecular_relaxations", "dynamics"]:
            df = src.get(key)
            assert df["temperature"].dtype == np.dtype("float64")
            assert df["pressure"].dtype == np.dtype("float64")
Esempio n. 2
0
def test_linear_steps_stopiter(infile, num_steps):
    df = read.process_file(infile=infile,
                           wave_number=2.9,
                           linear_steps=None,
                           steps_max=num_steps)
    assert df["time"].max() == num_steps
Esempio n. 3
0
def test_stopiter_handling(num_steps, infile):
    df = read.process_file(infile, wave_number=2.9, steps_max=num_steps)
    assert np.all(df["time"] == list(GenerateStepSeries(num_steps)))
Esempio n. 4
0
def test_process_file(infile):
    df = read.process_file(infile, wave_number=2.90)
    assert df is not None
    assert isinstance(df, pandas.DataFrame)
Esempio n. 5
0
def dynamics_file(infile_gsd, obj):
    """A temporary file for which the dynamics quantities have been calculated."""
    with TemporaryDirectory() as tmp:
        outfile = Path(tmp) / "test.h5"
        read.process_file(infile_gsd, outfile=outfile, **obj)
        yield outfile