From c8a6a8b1e255b9a27db308b99a99add4d94cbe52 Mon Sep 17 00:00:00 2001 From: Stijn Vermeeren Date: Wed, 22 May 2024 17:11:37 +0200 Subject: [PATCH] undo accidental rename --- src/stratigraphy/util/find_depth_columns.py | 4 ++-- src/stratigraphy/util/layer_identifier_column.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/stratigraphy/util/find_depth_columns.py b/src/stratigraphy/util/find_depth_columns.py index 75a3c2b4..5ba730a0 100644 --- a/src/stratigraphy/util/find_depth_columns.py +++ b/src/stratigraphy/util/find_depth_columns.py @@ -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 [] ) @@ -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. diff --git a/src/stratigraphy/util/layer_identifier_column.py b/src/stratigraphy/util/layer_identifier_column.py index dba9b258..17a56a86 100644 --- a/src/stratigraphy/util/layer_identifier_column.py +++ b/src/stratigraphy/util/layer_identifier_column.py @@ -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 @@ -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: