Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
redur committed Apr 4, 2024
1 parent 3ce3f13 commit 4b2e86b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/stratigraphy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def start_pipeline(
"layers": layer_predictions,
"depths_materials_column_pairs": depths_materials_column_pairs,
}

if draw_lines:
logger.info("Drawing lines on pdf pages.")
draw_lines_on_page(filename, page, geometric_lines)
Expand Down
3 changes: 1 addition & 2 deletions src/stratigraphy/util/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ def draw_predictions(predictions: dict, directory: Path, out_directory: Path) ->
- Assignments of material description text blocks to depth intervals (if available)
Args:
predictions (dict): Content of the predictions.json file..
predictions (dict): Content of the predictions.json file.
directory (Path): Path to the directory containing the pdf files.
out_directory (Path): Path to the output directory where the images are saved.
"""
if directory.is_file(): # deal with the case when we pass a file instead of a directory
directory = directory.parent
for file in predictions:
logger.info(f"Evaluating {file}.")
with fitz.Document(directory / file) as doc:
for page_index, page in enumerate(doc):
page_number = page_index + 1
Expand Down

0 comments on commit 4b2e86b

Please sign in to comment.