Skip to content

Commit

Permalink
Merge pull request #403 from eimerej/fix_units_starting_with_dot
Browse files Browse the repository at this point in the history
fix issue when unit starts with dot
  • Loading branch information
kinverarity1 committed Mar 17, 2021
2 parents c94833b + ce88352 commit f714cc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lasio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,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 @@ -30,6 +30,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

0 comments on commit f714cc6

Please sign in to comment.