Skip to content

Commit e59536d

Browse files
committed
style: apply black formatting
1 parent ae51015 commit e59536d

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

packages/parser-core/src/bankstatements_core/extraction/boundary_detector.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import logging
1010
from dataclasses import dataclass
1111

12-
from bankstatements_core.extraction.row_classifiers import RowClassifier, create_row_classifier_chain
12+
from bankstatements_core.extraction.row_classifiers import (
13+
RowClassifier,
14+
create_row_classifier_chain,
15+
)
1316

1417
logger = logging.getLogger(__name__)
1518

@@ -66,7 +69,11 @@ def __init__(
6669
self.columns = columns
6770
self.fallback_bottom_y = fallback_bottom_y
6871
self.table_top_y = table_top_y
69-
self._row_classifier = row_classifier if row_classifier is not None else create_row_classifier_chain()
72+
self._row_classifier = (
73+
row_classifier
74+
if row_classifier is not None
75+
else create_row_classifier_chain()
76+
)
7077

7178
# Configuration parameters
7279
self.min_gap_threshold = min_section_gap

packages/parser-core/src/bankstatements_core/extraction/pdf_extractor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ def _determine_boundaries_and_extract(
248248
)
249249

250250
dynamic_bottom_y = detect_table_end_boundary_smart(
251-
all_words, table_top_y, self.columns, table_bottom_y, row_classifier=self._row_classifier
251+
all_words,
252+
table_top_y,
253+
self.columns,
254+
table_bottom_y,
255+
row_classifier=self._row_classifier,
252256
)
253257

254258
# Safety check: Cap dynamic boundary at static boundary to prevent over-extraction

packages/parser-core/tests/extraction/test_boundary_detector.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ def test_injected_classifier_is_used(self):
387387

388388
mock_chain = Mock(spec=RowClassifier)
389389
mock_chain.classify.return_value = "metadata"
390-
detector = TableBoundaryDetector(columns=TEST_COLUMNS, row_classifier=mock_chain)
390+
detector = TableBoundaryDetector(
391+
columns=TEST_COLUMNS, row_classifier=mock_chain
392+
)
391393
words = [{"text": "Footer", "x0": 60, "top": 350}]
392394
detector.detect_boundary(words)
393395
mock_chain.classify.assert_called()

0 commit comments

Comments
 (0)