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

Fix bug where header.name is not set #64

Closed
wants to merge 1 commit into from

Conversation

kinverarity1
Copy link
Contributor

If the LAS file has no entry for ~Well WELL. then header.name is never set and w.plot() fails with an error.

Example LAS file: https://gist.githubusercontent.com/kinverarity1/2d2ae81f41b0e8c9e0022e0fc990f832/raw/0a387ac27b0b45725e9ba6cfe156398f70e2a4fe/example.las

>>> import welly
>>> w = welly.Well.from_las(r"c:\users\kinverarity\Documents\scratch2016\welly_bug_depth\example.las")
>>> w._repr_html_()
'<table><tr><th style="text-align:center;" colspan="2"><br><small>unknown</small></th></tr><tr><td><strong>crs</strong></td><td>CRS({})</td></tr><tr><td><strong>td</strong></td><td>None</td></tr><tr><td><strong>data</strong></td><td>Cali, Dens, Gamm, Late, Neut, PntR, Spon</td></tr></table>'
>>> w.plot()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\Misc\kentcode\welly\welly\well.py", line 427, in plot
    fig.suptitle(self.header.name, size=16, zorder=100,
AttributeError: 'Header' object has no attribute 'name'
>>>

Fixed it by setting header.name = 'unknown' in the Header.__init__ method before the passed arguments are set.

If the LAS file has no entry for ~Well WELL. then header.name is never set and w.plot() fails with an error.
@kwinkunks
Copy link
Member

I have no excuses for this taking me so long to deal with. This was implemented in current dev (setting as empty string, instead of 'unknown'. Did the same for the UWI.

Thank you Kent!

@kwinkunks kwinkunks closed this Jan 4, 2019
@kinverarity1
Copy link
Contributor Author

All good, thanks!

@kinverarity1 kinverarity1 deleted the noname branch January 5, 2019 05:59
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

Successfully merging this pull request may close these issues.

None yet

2 participants