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

LAS 2.1 reading error #490

Closed
senovr opened this issue Sep 24, 2021 · 3 comments
Closed

LAS 2.1 reading error #490

senovr opened this issue Sep 24, 2021 · 3 comments
Labels

Comments

@senovr
Copy link

senovr commented Sep 24, 2021

Describe the bug
Hi, I still getting an error while trying to open las file with las version 2.1
Traceback is the following:
las = lasio.read(path_to_las)

<ipython-input-8-31b3ef18c15d> in <module>
----> 1 las = lasio.read(path_to_las)

~/dss/code-envs/python/tsfresh_sparkhonyuk/lib/python3.6/site-packages/lasio/__init__.py in read(file_ref, **kwargs)
     39 
     40     """
---> 41     return LASFile(file_ref, **kwargs)

~/dss/code-envs/python/tsfresh_sparkhonyuk/lib/python3.6/site-packages/lasio/las.py in __init__(self, file_ref, **read_kwargs)
     76 
     77         if not (file_ref is None):
---> 78             self.read(file_ref, **read_kwargs)
     79 
     80     def read(

~/dss/code-envs/python/tsfresh_sparkhonyuk/lib/python3.6/site-packages/lasio/las.py in read(self, file_ref, ignore_data, read_policy, null_policy, ignore_header_errors, ignore_comments, mnemonic_case, index_unit, remove_data_line_filter, **kwargs)
    177                         ignore_header_errors=ignore_header_errors,
    178                         mnemonic_case=mnemonic_case,
--> 179                         ignore_comments=ignore_comments,
    180                     )
    181 

~/dss/code-envs/python/tsfresh_sparkhonyuk/lib/python3.6/site-packages/lasio/reader.py in parse_header_items_section(file_obj, line_nos, version, ignore_header_errors, mnemonic_case, ignore_comments)
    561     logger.debug("Line {}: Section title parsed as '{}'".format(line_no + 1, title))
    562 
--> 563     parser = SectionParser(title, version=version)
    564 
    565     section = SectionItems()

~/dss/code-envs/python/tsfresh_sparkhonyuk/lib/python3.6/site-packages/lasio/reader.py in __init__(self, title, version)
    662         defs = defaults.ORDER_DEFINITIONS
    663 
--> 664         if self.section_name2 in defs[self.version]:
    665             section_orders = defs[self.version][self.section_name2]
    666             self.default_order = section_orders[0]  #

KeyError: 2.1

I am aware of a similar bug, that was supposed to be addressed earlier- #29 (comment) , but still getting such error.

@senovr senovr added the bug label Sep 24, 2021
@kinverarity1
Copy link
Owner

Hi! What version of lasio are you using? lasio.__version__

@dcslagel
Copy link
Collaborator

@senovr ,

#491 'Add LAS version 2.1 to defaults plus test', just merged to the https://github.com/kinverarity1/lasio master branch and should fix this issue. Would you able to pull the latest, give it a try with the 2.1 Las file, and let us know if it resolved the issue?

Thank you,
DC

@senovr
Copy link
Author

senovr commented Sep 27, 2021

@dcslagel,
I can confirm that the issue is fixed now.
Thank you so much for the help!

@senovr senovr closed this as completed Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants