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

welly.to_las in welly 0.5.2 throwing error #235

Open
mohsenminaei opened this issue Oct 17, 2023 · 1 comment
Open

welly.to_las in welly 0.5.2 throwing error #235

mohsenminaei opened this issue Oct 17, 2023 · 1 comment

Comments

@mohsenminaei
Copy link

I am using welly 0.5.2.

I just ran this code:

import welly
wells = welly.read_las(r"\samples\*.las")
wells[0].to_las('test.las')

And received the following error:

AttributeError                            Traceback (most recent call last)
[\lib\site-packages\welly\las.py](file:///lib/site-packages/welly/las.py) in to_lasio(well, keys, alias, basis, null_value, mnemonic_case)
    422         try:
--> 423             l.add_curve('DEPT', df_merged.index.values)
    424         except:

AttributeError: 'LASFile' object has no attribute 'add_curve'

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
[~\AppData\Local\Temp\ipykernel_51576\944315332.py] in <module>
----> 1 wells[0].to_las('test.las')

[\lib\site-packages\welly\well.py](file:///lib/site-packages/welly/well.py) in to_las(self, fname, keys, basis, null_value, mnemonic_case, **kwargs)
    538         """
    539         with open(fname, 'w') as f:
--> 540             las = self.to_lasio(keys=keys, basis=basis, null_value=null_value, mnemonic_case=mnemonic_case)
    541             las.write(f, **kwargs)
    542 

[\lib\site-packages\welly\well.py](file:///lib/site-packages/welly/well.py) in to_lasio(self, keys, alias, basis, null_value, mnemonic_case)
    507             las (lasio.LASFile). The lasio object representation of a LAS file.
    508         """
...
--> 425             raise Exception("Please provide an index.")
    426 
    427         # Add meta from basis.

Exception: Please provide an index.

Then I went into the file welly/las.py and changed three instances of "add_curve" to "append_curve". The code started working. I may be wrong, but it seems that lasio has changed their function from add_cruve to append_curve.

@gavargas22
Copy link

I have fixed this issue on #237 temporarily I have a custom version whl that I can send your way @mohsenminaei

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

2 participants