Skip to content

Commit

Permalink
Fix fortio examples
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Aug 7, 2024
1 parent df677fc commit 9a7d855
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/resdata/resfile/fortio.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ def __init__(
all the pressure keywords to another file:
import sys
from resdata.ecl import FortIO, ResdataFile
from resdata.resfile import FortIO, ResdataFile
rst_file = ResdataFile(sys.argv[1])
fortio = FortIO("PRESSURE", mode=FortIO.WRITE_MODE)
for kw in rst_file:
if kw.name() == "PRESSURE":
kw.write(fortio)
kw.fwrite(fortio)
fortio.close()
Expand Down Expand Up @@ -184,13 +184,13 @@ def openFortIO(
the situation where you need to ensure resource cleanup.
import sys
from resdata.ecl import FortIO, ResdataFile
from resdata.resfile import FortIO, openFortIO, ResdataFile
rst_file = ResdataFile(sys.argv[1])
with openFortIO("PRESSURE", mode=FortIO.WRITE_MODE) as fortio:
for kw in rst_file:
if kw.name() == "PRESSURE":
kw.write(fortio)
kw.fwrite(fortio)
"""
return FortIOContextManager(
Expand Down

0 comments on commit 9a7d855

Please sign in to comment.