Skip to content

Crash if formation depth is not present #2

@frisoI3GEO

Description

@frisoI3GEO

I used some snippets of your code to pull tops. When I encountered some well entries with a formation name, but no associated top depth I got a crash as eval('') leads to an error. I suspect, but do not know for sure if your code would do the same. I solved it by changing:
depth = eval(cols[1].split('')[1].split('')[0])

to:
depth = cols[1].split('')[1].split('')[0]
if len(depth)>0: depth = eval(depth)

For me this is fine, but it leads to string character being retained, so maybe a better alternative is:
depth = cols[1].split('')[1].split('')[0]
if len(depth)>0: formations[formation] = eval(depth)
which only write if there is a depth value found.

Many thanks for sharing the code and the webinars you and colleagues are providing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions