Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add useq.WellPlanPlan widget with well selection #318

Merged
merged 16 commits into from
Jul 12, 2024
22 changes: 22 additions & 0 deletions examples/well_plate_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from contextlib import suppress

import useq
from qtpy.QtWidgets import QApplication

from pymmcore_widgets.useq_widgets import WellPlateWidget

with suppress(ImportError):
from rich import print


app = QApplication([])

plan = useq.WellPlatePlan(
plate="24-well", a1_center_xy=(0, 0), selected_wells=slice(0, 8, 2)
)

ps = WellPlateWidget(plan)
ps.valueChanged.connect(print)
ps.show()

app.exec()
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, scene: QGraphicsScene, parent: QWidget | None = None) -> None
super().__init__(scene, parent)
self.padding = 0.05 # fraction of the bounding rect

def resizeEvent(self, event: QResizeEvent) -> None:
def resizeEvent(self, event: QResizeEvent | None) -> None:
if not (scene := self.scene()):
return
rect = scene.itemsBoundingRect()
Expand Down
2 changes: 2 additions & 0 deletions src/pymmcore_widgets/useq_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ._mda_sequence import PYMMCW_METADATA_KEY, MDASequenceWidget
from ._positions import PositionTable
from ._time import TimePlanWidget
from ._well_plate_widget import WellPlateWidget
from ._z import ZPlanWidget
from .points_plans import PointsPlanWidget

Expand All @@ -33,5 +34,6 @@
"TextColumn",
"TimeDeltaColumn",
"TimePlanWidget",
"WellPlateWidget",
"ZPlanWidget",
]
Loading
Loading