Apply suggestions from code review of branch live-scan-details

Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
This commit is contained in:
Julian Stirling 2026-07-04 21:52:31 +00:00
parent d25ebabc77
commit 543433f31e
2 changed files with 5 additions and 3 deletions

View file

@ -291,7 +291,7 @@ class SmartScanThing(OFMThing):
@lt.property
def latest_scan_live_details(self) -> Optional[LiveScanDetails]:
"""The details of any ongoing scan, or the previous scan if no san ongoing."""
"""The details of any ongoing scan, or the previous scan if no scan ongoing."""
if self._latest_scan_live_details is None:
return None
# Update image count and stitch timestamp if scan is ongoing.
@ -350,7 +350,7 @@ class SmartScanThing(OFMThing):
raise e
finally:
# Save some final details but not set to the base model until after
# resetting valued and unlocking just in case somehow pydantic errors.
# resetting values and unlocking in case of Pydantic errors.
final_image_count = (
self._scan_data.image_count if self._scan_data is not None else None
@ -499,7 +499,7 @@ class SmartScanThing(OFMThing):
self.logger.info("Stopping scan because it was cancelled.")
self._save_final_scan_data(scan_result="cancelled by user")
if self.scan_data.image_count < MIN_IMAGES_TO_STITCH:
# If too few images to stitch then, return to the centre and report
# If too few images to stitch then, return to the start and report
# cancelled
self._return_to_starting_position()
raise e