Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some error about the opm python library #3608

Open
soulstealer-star opened this issue Jul 26, 2023 · 4 comments
Open

Some error about the opm python library #3608

soulstealer-star opened this issue Jul 26, 2023 · 4 comments

Comments

@soulstealer-star
Copy link

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
Copy link
Member

blattms commented Jul 26, 2023

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
Copy link
Contributor

@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
Copy link
Author

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants