OPM/opm-common

Some error about the opm python library

soulstealer-star opened this issue · 4 comments

When I following the OPM PYACTION AND UDQ/ACTIONX DOCUMENTATION and try to write the Python Script as follow:

**import os.path
import sys
from opm.io.parser import Parser

data_file = sys.argv[1]
#print(data_file)
print(f"Loading deck from {data_file}")
parser = Parser()
deck = parser.parse_file( data_file )**

And when I run this file with the command : python importdeck.py NORNE_ATW2013_1A_MSW.DATA in the terminal, it give me the error that:
deck = parser.parse_file( data_file )
AttributeError: 'opm.opmcommon_python.Parser' object has no attribute 'parse_file'

Can you tell me the actual name of parse_file?

deck = parser.parse_file( data_file )

Seems like this should be .... parser.parse(data_file) (judging from our tests. ). There might be a mistake in the documentation then. Sorry, and thanks for noticing.

Those tests might be quite helpful for experimenting.

@soulstealer-star Letian, please keep track of all outdated information/typos you find in the documentation so that can be used to update it. :)

@soulstealer-star Letian, please keep track of all outdated information/typos you find in the documentation so that can be used to update it. :)

Yes, I will do that

deck = parser.parse_file( data_file )

Seems like this should be .... parser.parse(data_file) (judging from our tests. ). There might be a mistake in the documentation then. Sorry, and thanks for noticing.

Those tests might be quite helpful for experimenting.

Thanks! It works. And I will check the test file