OPM / opm-common

Common components for OPM, in particular build system (cmake).
http://www.opm-project.org
GNU General Public License v3.0
33 stars 111 forks source link

Some error about the opm python library #3608

Open soulstealer-star opened 1 year ago

soulstealer-star commented 1 year ago

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?

blattms commented 1 year ago

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.

goncalvesmachadoc commented 1 year ago

@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 commented 1 year ago

@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

soulstealer-star commented 1 year ago

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