Skip to content

Commit f5168ce

Browse files
committed
reduce lines
1 parent 9703a86 commit f5168ce

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

src/pymmcore_widgets/hcs/_plate_calibration_widget.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -451,20 +451,17 @@ def _update_info(self) -> None:
451451
spacing = self._well_spacing or (0, 0)
452452
txt = "<strong>Plate calibrated.</strong>"
453453
ico = QIconifyIcon(CALIBRATED_ICON, color=GREEN)
454-
if (plate := self._current_plate) is not None:
455-
plate_sp = plate.well_spacing[0]
456-
if plate_sp > 0:
457-
spacing_diff = abs(spacing[0] - plate_sp)
458-
# if spacing is more than 5% different from plate spacing
459-
if spacing_diff > 0.05 * plate_sp:
460-
txt += (
461-
"<font color='red'> Expected well spacing"
462-
f" of {plate_sp:.2f} mm, "
463-
f"calibrated at {spacing[0]:.2f}</font>"
464-
)
465-
ico = style.standardIcon(
466-
QStyle.StandardPixmap.SP_MessageBoxWarning
467-
)
454+
if self._current_plate is not None:
455+
plate_sp = self._current_plate.well_spacing[0]
456+
spacing_diff = abs(spacing[0] - plate_sp)
457+
# if spacing is more than 5% different from the plate spacing...
458+
if plate_sp > 0 and spacing_diff > 0.05 * plate_sp:
459+
txt += (
460+
"<font color='red'> Expected well spacing of "
461+
f"{plate_sp:.2f} mm, "
462+
f"calibrated at {spacing[0]:.2f}</font>"
463+
)
464+
ico = style.standardIcon(QStyle.StandardPixmap.SP_MessageBoxWarning)
468465
txt += "<br>"
469466
x0, y0 = self._a1_center_xy
470467
txt += f"\nA1 Center [mm]: ({x0 / 1000:.2f}, {y0 / 1000:.2f}), "

0 commit comments

Comments
 (0)