How to use the ecl2df.trans.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_trans.py View on Github external
# Try including some vectors:
    trans_df = trans.df(eclfiles, vectors="FIPNUM")
    assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
    assert len(transnnc_df) > trans_full_length

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"], boundaryfilter=True)
    assert trans_df.empty

    trans_df = trans.df(eclfiles, vectors="FIPNUM", boundaryfilter=True)
    assert len(trans_df) < trans_full_length

    trans_df = trans.df(eclfiles, coords=True)
    assert "X" in trans_df
    assert "Y" in trans_df
github equinor / ecl2df / tests / test_userapi.py View on Github external
"""
    eclfiles = ecl2df.EclFiles(DATAFILE)

    compdatdf = ecl2df.compdat.df(eclfiles)
    equil = ecl2df.equil.df(eclfiles)
    faults = ecl2df.faults.df(eclfiles)
    fipreports = ecl2df.fipreports.df(eclfiles)
    grid_df = ecl2df.grid.df(eclfiles)
    grst_df = ecl2df.grid.df(eclfiles, rstdates="last")
    gruptree = ecl2df.gruptree.df(eclfiles)
    nnc = ecl2df.nnc.df(eclfiles)
    pillars = ecl2df.pillars.df(eclfiles)
    rft = ecl2df.rft.df(eclfiles)
    satfund = ecl2df.satfunc.df(eclfiles)
    smry = ecl2df.summary.df(eclfiles)
    trans = ecl2df.trans.df(eclfiles)
    wcon = ecl2df.wcon.df(eclfiles)

    assert "PORV" in grid_df
    assert "SOIL" not in grid_df
    assert "SOIL" in grst_df
    assert "PORV" in grst_df

    # Make some HCPV calculations
    grst_df["OILPV"] = grst_df["SOIL"] * grst_df["PORV"]
    grst_df["HCPV"] = (1 - grst_df["SWAT"]) * grst_df["PORV"]

    hcpv_table = grst_df.groupby("FIPNUM").sum()[["OILPV", "HCPV"]]
    assert not hcpv_table.empty

    # Print the HCPV table by FIPNUM:
    print()
github equinor / ecl2df / tests / test_trans.py View on Github external
# Try including some vectors:
    trans_df = trans.df(eclfiles, vectors="FIPNUM")
    assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
    assert len(transnnc_df) > trans_full_length

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"], boundaryfilter=True)
    assert trans_df.empty

    trans_df = trans.df(eclfiles, vectors="FIPNUM", boundaryfilter=True)
    assert len(trans_df) < trans_full_length

    trans_df = trans.df(eclfiles, coords=True)
    assert "X" in trans_df
    assert "Y" in trans_df
github equinor / ecl2df / tests / test_trans.py View on Github external
def test_grouptrans():
    """Test grouping of transmissibilities"""
    eclfiles = EclFiles(DATAFILE)
    trans_df = trans.df(eclfiles, vectors="FIPNUM", group=True, coords=True)
    assert "FIPNUMPAIR" in trans_df
    assert "FIPNUM1" in trans_df
    assert "FIPNUM2" in trans_df
    assert (trans_df["FIPNUM1"] < trans_df["FIPNUM2"]).all()
    assert len(trans_df) == 7
    assert "X" in trans_df  # (average X coord for that FIPNUM interface)
github equinor / ecl2df / tests / test_trans.py View on Github external
assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
    assert len(transnnc_df) > trans_full_length

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"], boundaryfilter=True)
    assert trans_df.empty

    trans_df = trans.df(eclfiles, vectors="FIPNUM", boundaryfilter=True)
    assert len(trans_df) < trans_full_length

    trans_df = trans.df(eclfiles, coords=True)
    assert "X" in trans_df
    assert "Y" in trans_df
github equinor / ecl2df / tests / test_trans.py View on Github external
def test_trans():
    """Test that we can build a dataframe of transmissibilities"""
    eclfiles = EclFiles(DATAFILE)
    trans_df = trans.df(eclfiles)
    assert "TRAN" in trans_df
    assert "DIR" in trans_df
    assert set(trans_df["DIR"].unique()) == set(["I", "J", "K"])
    assert trans_df["TRAN"].sum() > 0

    trans_full_length = len(trans_df)

    # Try including some vectors:
    trans_df = trans.df(eclfiles, vectors="FIPNUM")
    assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
github equinor / ecl2df / tests / test_trans.py View on Github external
assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
    assert len(transnnc_df) > trans_full_length

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"], boundaryfilter=True)
    assert trans_df.empty

    trans_df = trans.df(eclfiles, vectors="FIPNUM", boundaryfilter=True)
    assert len(trans_df) < trans_full_length

    trans_df = trans.df(eclfiles, coords=True)
    assert "X" in trans_df
    assert "Y" in trans_df
github equinor / ecl2df / tests / test_trans.py View on Github external
def test_trans():
    """Test that we can build a dataframe of transmissibilities"""
    eclfiles = EclFiles(DATAFILE)
    trans_df = trans.df(eclfiles)
    assert "TRAN" in trans_df
    assert "DIR" in trans_df
    assert set(trans_df["DIR"].unique()) == set(["I", "J", "K"])
    assert trans_df["TRAN"].sum() > 0

    trans_full_length = len(trans_df)

    # Try including some vectors:
    trans_df = trans.df(eclfiles, vectors="FIPNUM")
    assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df
github equinor / ecl2df / tests / test_trans.py View on Github external
assert set(trans_df["DIR"].unique()) == set(["I", "J", "K"])
    assert trans_df["TRAN"].sum() > 0

    trans_full_length = len(trans_df)

    # Try including some vectors:
    trans_df = trans.df(eclfiles, vectors="FIPNUM")
    assert "FIPNUM" not in trans_df
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" not in trans_df

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"])
    assert "FIPNUM1" in trans_df
    assert "EQLNUM2" in trans_df

    trans_df = trans.df(eclfiles, vectors="BOGUS")
    assert "BOGUS1" not in trans_df
    assert "TRAN" in trans_df  # (we should have gotten a warning only)

    assert "K" not in trans.df(eclfiles, onlyijdir=True)["DIR"]
    assert "I" not in trans.df(eclfiles, onlykdir=True)["DIR"]

    transnnc_df = trans.df(eclfiles, addnnc=True)
    assert len(transnnc_df) > trans_full_length

    trans_df = trans.df(eclfiles, vectors=["FIPNUM", "EQLNUM"], boundaryfilter=True)
    assert trans_df.empty

    trans_df = trans.df(eclfiles, vectors="FIPNUM", boundaryfilter=True)
    assert len(trans_df) < trans_full_length

    trans_df = trans.df(eclfiles, coords=True)