Skip to content

Commit

Permalink
undo accidental rename
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvermeeren-swisstopo committed May 22, 2024
1 parent 4b2cc38 commit c8a6a8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/stratigraphy/util/find_depth_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def depth_column_entries(all_words: list[TextWord], include_splits: bool) -> lis
entries.append(DepthColumnEntry(word.rect, value))
elif include_splits:
# support for e.g. "1.10-1.60m" extracted as a single word
layer_depth_column_entry = extract_layer_depth_interval_entries(input_string, word.rect)
layer_depth_column_entry = extract_layer_depth_interval(input_string, word.rect)
entries.extend(
[layer_depth_column_entry.start, layer_depth_column_entry.end] if layer_depth_column_entry else []
)
Expand All @@ -47,7 +47,7 @@ def value_as_float(string_value: str) -> float: # noqa: D103
return abs(float(parsed_text))


def extract_layer_depth_interval_entries(
def extract_layer_depth_interval(
text: str, rect: fitz.Rect, require_start_of_string: bool = True
) -> LayerDepthColumnEntry | None:
"""Extracts a LayerDepthColumnEntry from a string.
Expand Down
6 changes: 2 additions & 4 deletions src/stratigraphy/util/layer_identifier_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import fitz

from stratigraphy.util.depthcolumn import LayerDepthColumnEntry
from stratigraphy.util.find_depth_columns import extract_layer_depth_interval_entries
from stratigraphy.util.find_depth_columns import extract_layer_depth_interval
from stratigraphy.util.line import TextLine
from stratigraphy.util.textblock import TextBlock

Expand Down Expand Up @@ -132,9 +132,7 @@ def get_depth_interval(self, block: TextBlock) -> LayerDepthColumnEntry:
depth_entries = []
for line in block.lines:
try:
layer_depth_entry = extract_layer_depth_interval_entries(
line.text, line.rect, require_start_of_string=False
)
layer_depth_entry = extract_layer_depth_interval(line.text, line.rect, require_start_of_string=False)
# require_start_of_string = False because the depth interval may not always start at the beginning
# of the line e.g. "Remblais Heterogene: 0.00 - 0.5m"
if layer_depth_entry:
Expand Down

0 comments on commit c8a6a8b

Please sign in to comment.