chore: satisfy ruff format and SIM201 lint
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 1m3s
CI / test (3.11) (pull_request) Successful in 1m29s
CI / test (3.12) (pull_request) Successful in 1m28s
CI / test (3.13) (pull_request) Successful in 1m27s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m30s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m43s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m41s
CI / test-with-coverage (pull_request) Successful in 2m6s
CI / coverage-analysis (pull_request) Failing after 3s

ruff format collapsed lines the Beamline setup rename and other edits
left splittable; SIM201 wanted != over 'not ... ==' in the prediction
subscriber's JSON sniff.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 committed 2026-08-14 07:23:20 +02:00
1 parent 58bde9379b
commit b4896105ab
5 files changed
+5 -15

No files matched your search

+1 -3
View File
@@ -15,9 +15,7 @@ class MonochromatorPanel(QWidget):
grid_layout = QGridLayout(self)
grid_layout.addWidget(
TitleLabel(
"Beamline setup", self, collapsible=True, default_collapsed=False
),
TitleLabel("Beamline setup", self, collapsible=True, default_collapsed=False),
0,
0,
1,
+1 -3
View File
@@ -111,9 +111,7 @@ class SmargonPanel(QWidget):
@Slot(dict)
def _move_axes(self, targets: dict):
# only the staged axes move — absent keys stay None (no motion)
self.smargon.emit(
SmargonCoordinate(chi_deg=targets.get("chi"), phi_deg=targets.get("phi"))
)
self.smargon.emit(SmargonCoordinate(chi_deg=targets.get("chi"), phi_deg=targets.get("phi")))
@Slot(DAQStatusModel)
def update_daq_status(self, s: DAQStatusModel):
@@ -89,7 +89,7 @@ class PredictionSubscriber(QThread):
def _try_parse_json(self, part: bytes) -> dict | None:
# Binary frames (JPEG starts with 0xff) are not JSON; decoding them as
# utf-8 raises UnicodeDecodeError on every frame. Cheap sniff instead.
if not part.lstrip()[:1] == b"{":
if part.lstrip()[:1] != b"{":
return None
try:
decoded = json.loads(part.decode("utf-8"))
+1 -4
View File
@@ -101,10 +101,7 @@ def draw_busy_badge(
def draw_busy_status_text(
painter: QPainter,
viewport_width: int,
viewport_height: int,
style: BusyOverlayStyle,
painter: QPainter, viewport_width: int, viewport_height: int, style: BusyOverlayStyle
) -> None:
"""Non-clickable busy status for the passive Axis views: solid colored
text with a 1px shadow, no badge box — the pill read as a button (same
+1 -4
View File
@@ -1166,10 +1166,7 @@ class SampleCameraImageLabel(QGraphicsView):
painter.setPen(QPen(qcolor(LEGEND_TEXT), 1))
painter.drawText(QPointF(bg_rect.left() + padding, y + fm.ascent()), more_text)
self._help_more_rect = QRectF(
bg_rect.left() + padding,
y,
fm.horizontalAdvance(more_text),
line_height,
bg_rect.left() + padding, y, fm.horizontalAdvance(more_text), line_height
)
painter.restore()