FRI-Energy-Analytics / 2020_summer_fellows

A repository for FRI Energy Analytics fellows
MIT License
5 stars 6 forks source link

KeyError #195

Closed jessepisel closed 4 years ago

jessepisel commented 4 years ago

@dingdonged Reading in a random .LAS file results in an error from lasio. Here is code to reproduce the error

from aliaser.keyword_tree import Alias
a = Alias()
a.parse(PATH_TO_LAS_FILE+"/533095C.las"
which returns the following error:
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\jrp4932\AppData\Local\Continuum\anaconda3\envs\aliaser\lib\site-packages\aliaser-0.0-py3.7.egg\aliaser\keyword_tree.py", line 220, in parse
    df = self.make_df(path)
  File "C:\Users\jrp4932\AppData\Local\Continuum\anaconda3\envs\aliaser\lib\site-packages\aliaser-0.0-py3.7.egg\aliaser\keyword_tree.py", line 306, in make_df
    description.append(str(las.curves[i].descr).lower())
  File "C:\Users\jrp4932\AppData\Local\Continuum\anaconda3\envs\aliaser\lib\site-packages\lasio\las_items.py", line 292, in __getitem__
    raise KeyError('%s not in %s' % (key, self.keys()))
KeyError: "qn not in ['DEPT', 'GR', 'TEMP', 'DTMP']"
It looks like this is originating in `lasio` when `make_df` calls the curve names. Opening the .LAS file with `lasio` everything appears to behave normally. This means it must be an issue in the `make_df` method. I will look into this a bit, can you help by seeing if you can trace down the bug?
jessepisel commented 4 years ago

It gets even weirder. If I run this in a notebook it is fine. If I run this in a console that is when the error shows up

jessepisel commented 4 years ago

I haven't been able to reproduce this error since installing the package locally. I am going to close this issue. I think it was related to importing the package and modules without the install.