How to use the ecl2df.pvt.df function in ecl2df

To help you get started, we’ve selected a few ecl2df examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github equinor / ecl2df / tests / test_pvt.py View on Github external
600 3 0.012
1000 1.3 0.15 /
200 8 0.013
300 4 0.014
8000 1.8 0.16 /
"""
    dframe = pvt.pvdo_fromdeck(string)
    assert len(dframe) == 6
    assert "PVTNUM" in dframe
    assert len(dframe["PVTNUM"].unique()) == 2
    assert "PRESSURE" in dframe
    assert "VOLUMEFACTOR" in dframe
    assert "VISCOSITY" in dframe

    # Test emtpy data:
    inc = pvt.df2ecl_pvdo(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
/
    """
    dframe = pvt.pvto_fromdeck(pvto_deck)
    assert len(dframe) == 6
    assert "PVTNUM" in dframe
    assert set(dframe["PVTNUM"].astype(int).unique()) == {1, 2}
    assert len(dframe["RS"].unique()) == 4
    assert len(dframe["PRESSURE"].unique()) == 6
    assert len(dframe["VOLUMEFACTOR"].unique()) == 3
    dframe_via_string = pvt.pvto_fromdeck(pvt.df2ecl_pvto(dframe))
    pd.testing.assert_frame_equal(dframe_via_string, dframe)

    # Test emtpy data:
    inc = pvt.df2ecl_pvto(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
assert os.path.exists(tmpcsvfile)
    disk_df = pd.read_csv(tmpcsvfile)
    assert "PVTNUM" in disk_df
    assert "KEYWORD" in disk_df
    assert not disk_df.empty

    # Write back to include file:
    incfile = str(tmpdir.join("pvt.inc"))
    sys.argv = ["csv2ecl", "pvt", "-v", str(tmpcsvfile), "-o", incfile]
    csv2ecl.main()

    # Reparse the include file on disk back to dataframe
    # and check dataframe equality
    assert os.path.exists(incfile)
    disk_inc_df = pvt.df(open(incfile).read())
    pd.testing.assert_frame_equal(disk_df, disk_inc_df)
github equinor / ecl2df / tests / test_pvt.py View on Github external
"""
    pvtg_df = pvt.pvtg_fromdeck(string)
    assert "PRESSURE" in pvtg_df
    assert "OGR" in pvtg_df
    assert "PVTNUM" in pvtg_df
    assert "VOLUMEFACTOR" in pvtg_df
    assert "VISCOSITY" in pvtg_df
    assert len(pvtg_df["PVTNUM"].unique()) == 2
    assert len(pvtg_df["PRESSURE"].unique()) == 14
    assert max(pvtg_df["VOLUMEFACTOR"]) == 0.0523
    assert max(pvtg_df["VISCOSITY"]) == 0.0393

    # Test emtpy data:
    inc = pvt.df2ecl_pvtg(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
"""
    density_df = pvt.density_fromdeck(EclFiles.str2deck(two_pvtnum_deck))
    # (a warning will be printed that we cannot guess)
    assert len(density_df) == 1
    density_df = pvt.density_fromdeck(two_pvtnum_deck)
    assert "PVTNUM" in density_df
    assert density_df["PVTNUM"].max() == 2
    assert density_df["PVTNUM"].min() == 1
    assert "OILDENSITY" in density_df
    dframe_via_string = pvt.density_fromdeck(pvt.df2ecl_density(density_df))
    pd.testing.assert_frame_equal(dframe_via_string, density_df)

    # Test emtpy data:
    inc = pvt.df2ecl_density(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
333 1.000  1.001 /
    19    30 1.14  0.59 /
    /
    """
    dframe = pvt.pvto_fromdeck(pvto_deck)
    assert len(dframe) == 6
    assert "PVTNUM" in dframe
    assert set(dframe["PVTNUM"].astype(int).unique()) == {1, 2}
    assert len(dframe["RS"].unique()) == 4
    assert len(dframe["PRESSURE"].unique()) == 6
    assert len(dframe["VOLUMEFACTOR"].unique()) == 3
    dframe_via_string = pvt.pvto_fromdeck(pvt.df2ecl_pvto(dframe))
    pd.testing.assert_frame_equal(dframe_via_string, dframe)

    # Test emtpy data:
    inc = pvt.df2ecl_pvto(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
800      950     1.05
        /
        """
    density_df = pvt.density_fromdeck(EclFiles.str2deck(two_pvtnum_deck))
    # (a warning will be printed that we cannot guess)
    assert len(density_df) == 1
    density_df = pvt.density_fromdeck(two_pvtnum_deck)
    assert "PVTNUM" in density_df
    assert density_df["PVTNUM"].max() == 2
    assert density_df["PVTNUM"].min() == 1
    assert "OILDENSITY" in density_df
    dframe_via_string = pvt.density_fromdeck(pvt.df2ecl_density(density_df))
    pd.testing.assert_frame_equal(dframe_via_string, density_df)

    # Test emtpy data:
    inc = pvt.df2ecl_density(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
def test_df():
    """Test that aggregate dataframes are produced"""
    eclfiles = EclFiles(DATAFILE)  # Reek dataset
    pvtdf = pvt.df(eclfiles)

    assert not pvtdf.empty
    assert set(pvtdf["KEYWORD"]) == {"PVTO", "PVDG", "DENSITY", "ROCK", "PVTW"}
    assert "PVTNUM" in pvtdf
    assert "PRESSURE" in pvtdf
    assert "RS" in pvtdf
    assert "COMPRESSIBILITY" in pvtdf
    assert "VISCOSITY" in pvtdf
    assert len(pvtdf["PVTNUM"].unique()) == 1
github equinor / ecl2df / tests / test_pvt.py View on Github external
0         0.00360 0.0359 / undersaturated data for Pg=560
/ null record to terminate table 2
"""
    pvtg_df = pvt.pvtg_fromdeck(string)
    assert "PRESSURE" in pvtg_df
    assert "OGR" in pvtg_df
    assert "PVTNUM" in pvtg_df
    assert "VOLUMEFACTOR" in pvtg_df
    assert "VISCOSITY" in pvtg_df
    assert len(pvtg_df["PVTNUM"].unique()) == 2
    assert len(pvtg_df["PRESSURE"].unique()) == 14
    assert max(pvtg_df["VOLUMEFACTOR"]) == 0.0523
    assert max(pvtg_df["VISCOSITY"]) == 0.0393

    # Test emtpy data:
    inc = pvt.df2ecl_pvtg(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty
github equinor / ecl2df / tests / test_pvt.py View on Github external
200 8 0.013
300 4 0.014
8000 1.8 0.16 /
"""
    dframe = pvt.pvdo_fromdeck(string)
    assert len(dframe) == 6
    assert "PVTNUM" in dframe
    assert len(dframe["PVTNUM"].unique()) == 2
    assert "PRESSURE" in dframe
    assert "VOLUMEFACTOR" in dframe
    assert "VISCOSITY" in dframe

    # Test emtpy data:
    inc = pvt.df2ecl_pvdo(pvt.df(""))
    assert "No data" in inc
    assert pvt.df(inc).empty