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 issue when unit starts with dot #403

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lasio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ def configure_metadata_patterns(line, section_name):
if ".." in line and section_name == "Curves":
name_re = name_with_dots_re
else:
if ".." in line and section_name == "Curves":
if re.search(r'[^ ]\.\.', line) and section_name == "Curves":
double_dot = line.find("..")
desc_colon = line.rfind(":")

Expand Down
4 changes: 4 additions & 0 deletions tests/test_read_header_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def test_cyrillic_depth_unit():
result = read_header_line(line, section_name="Curves")
assert result["unit"] == u"метер"

def test_unit_stat_with_dot():
line = u" TDEP ..1IN : 0.1-in"
result = read_header_line(line, section_name="Curves")
assert result["unit"] == u".1IN"

def test_value_field_with_num_colon():
line = "RUN . 01: RUN NUMBER"
Expand Down