Skip to content

Commit

Permalink
Add EQLNUM to equil dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Mar 16, 2020
1 parent 654b0e2 commit 59b3ab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ecl2df/equil.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def deck2df(deck, ntequl=None):
if "IGNORE" in col:
del dataframe[col]

# EQLNUM is inferred from the order
dataframe["EQLNUM"] = dataframe.index + 1

return dataframe


Expand Down
5 changes: 3 additions & 2 deletions tests/test_equil.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_decks():
assert df["OWC"].values == 2200
assert len(df) == 1
assert "IGNORE1" not in df

assert df["EQLNUM"].unique()[0] == 1
deckstr = """
OIL
WATER
Expand Down Expand Up @@ -99,7 +99,8 @@ def test_ntequl():
df = equil.deck2df(deckstr)
assert set(df["GOC"].values) == set([2100, 2100])
assert len(df) == 2

assert df["EQLNUM"].min() == 1
assert df["EQLNUM"].max() == 2
# Supply correct NTEQUL instead of estimating
df = equil.deck2df(deckstr, 2)
assert len(df) == 2
Expand Down

0 comments on commit 59b3ab7

Please sign in to comment.