Skip to content

Commit

Permalink
improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvermeeren-swisstopo committed Jun 5, 2024
1 parent 43338f5 commit c490723
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/stratigraphy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def start_pipeline(
)
mlflow.log_image(img, f"pages/{filename}_page_{page.number + 1}_lines.png")

logger.info("Writing predictions to JSON file %s", predictions_path)
with open(predictions_path, "w") as file:
file.write(json.dumps(predictions))

Expand Down
1 change: 1 addition & 0 deletions src/stratigraphy/util/coordinate_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def extract_coordinates(self) -> Coordinate | None:
if coordinate.is_valid():
return coordinate

if len(coordinate_values):
logger.warning(f"Could not extract valid coordinates from {coordinate_values}")

logger.info("No coordinates found in this borehole profile.")
1 change: 1 addition & 0 deletions src/stratigraphy/util/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def draw_predictions(predictions: list[FilePredictions], directory: Path, out_di
if directory.is_file(): # deal with the case when we pass a file instead of a directory
directory = directory.parent
for file_name, file_prediction in predictions.items():
logger.info("Drawing predictions for file %s", file_name)
with fitz.Document(directory / file_name) as doc:
for page_index, page in enumerate(doc):
page_number = page_index + 1
Expand Down

0 comments on commit c490723

Please sign in to comment.