Skip to content

Commit

Permalink
Merge branch 'main' into config-2d-table
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Nov 17, 2024
2 parents 39afe83 + 1cda2b7 commit fa2ec62
Show file tree
Hide file tree
Showing 116 changed files with 3,875 additions and 1,246 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,25 @@ jobs:
fail-fast: false
matrix:
platform: [macos-13, windows-latest]
python-version: ["3.8", "3.11"]
backend: [pyside2, pyqt5]
include:
- platform: macos-13
python-version: "3.10"
backend: pyside6
- platform: macos-13
python-version: "3.11"
backend: pyqt6
python-version: ["3.10", "3.12"]
backend: [pyside6, pyqt6]
exclude:
- platform: windows-latest
python-version: "3.10"
backend: pyside6
- platform: windows-latest
python-version: "3.11"
backend: pyqt6
- platform: windows-latest
include:
- platform: macos-13
python-version: "3.9"
backend: pyside2
- platform: windows-latest
python-version: "3.9"
backend: pyqt5
exclude:
- python-version: "3.11"
backend: pyside2
- platform: windows-latest
python-version: "3.11"
backend: pyqt5
# - platform: windows-latest
# python-version: "3.13"
# backend: pyqt6

steps:
- uses: actions/checkout@v4
Expand All @@ -63,6 +58,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ name: --pre Test

on:
schedule:
- cron: '0 */12 * * *' # every 12 hours
- cron: "0 */12 * * *" # every 12 hours
workflow_dispatch:

jobs:

test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ["3.11"]
platform: [macos-13, windows-latest]
backend: [pyside2, pyqt5]

Expand Down Expand Up @@ -55,7 +54,7 @@ jobs:
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python }}
RUN_ID: ${{ github.run_id }}
TITLE: '[test-bot] pip install --pre is failing'
TITLE: "[test-bot] pip install --pre is failing"
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ ci:

repos:
- repo: https://github.com/crate-ci/typos
rev: v1.22.9
rev: v1.27.0
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.7.2
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
- id: ruff-format

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
rev: v0.22
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.13.0
hooks:
- id: mypy
files: "^src/"
additional_dependencies:
- pymmcore-plus >=0.11.0
- useq-schema >=0.4.7
- useq-schema >=0.5.0
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Changelog

## [v0.8.0](https://github.com/pymmcore-plus/pymmcore-widgets/tree/v0.8.0) (2024-10-04)

[Full Changelog](https://github.com/pymmcore-plus/pymmcore-widgets/compare/v0.7.2...v0.8.0)

**Implemented enhancements:**

- feat: add HCSWizard to MDAWIdget [\#362](https://github.com/pymmcore-plus/pymmcore-widgets/pull/362) ([fdrgsp](https://github.com/fdrgsp))
- feat: add High Content Screening wizard [\#360](https://github.com/pymmcore-plus/pymmcore-widgets/pull/360) ([fdrgsp](https://github.com/fdrgsp))
- feat: reload prior config file on HCW rejection [\#359](https://github.com/pymmcore-plus/pymmcore-widgets/pull/359) ([gselzer](https://github.com/gselzer))
- feat: plate navigator for HCS calibration testing [\#356](https://github.com/pymmcore-plus/pymmcore-widgets/pull/356) ([fdrgsp](https://github.com/fdrgsp))
- feat: plate calibration widget [\#355](https://github.com/pymmcore-plus/pymmcore-widgets/pull/355) ([tlambert03](https://github.com/tlambert03))
- feat: reusable single-well calibration widget for plate calibration widget [\#353](https://github.com/pymmcore-plus/pymmcore-widgets/pull/353) ([fdrgsp](https://github.com/fdrgsp))
- feat: Refactor GridPlanWidget [\#351](https://github.com/pymmcore-plus/pymmcore-widgets/pull/351) ([gselzer](https://github.com/gselzer))
- feat: add restrict well area [\#319](https://github.com/pymmcore-plus/pymmcore-widgets/pull/319) ([fdrgsp](https://github.com/fdrgsp))
- feat: add useq.WellPlanPlan widget with well selection [\#318](https://github.com/pymmcore-plus/pymmcore-widgets/pull/318) ([tlambert03](https://github.com/tlambert03))
- feat: add overlap checkbox [\#317](https://github.com/pymmcore-plus/pymmcore-widgets/pull/317) ([fdrgsp](https://github.com/fdrgsp))
- feat: add minimal Points plan view [\#316](https://github.com/pymmcore-plus/pymmcore-widgets/pull/316) ([tlambert03](https://github.com/tlambert03))
- feat: Points plan selector [\#315](https://github.com/pymmcore-plus/pymmcore-widgets/pull/315) ([tlambert03](https://github.com/tlambert03))
- feat: multi point plan useq widgets [\#314](https://github.com/pymmcore-plus/pymmcore-widgets/pull/314) ([tlambert03](https://github.com/tlambert03))
- feat: add select all for hub devices [\#310](https://github.com/pymmcore-plus/pymmcore-widgets/pull/310) ([tlambert03](https://github.com/tlambert03))

**Fixed bugs:**

- fix: fix splitting logic and deduplicate code in Groups Presets Widgets [\#365](https://github.com/pymmcore-plus/pymmcore-widgets/pull/365) ([tlambert03](https://github.com/tlambert03))
- fix: disable Autofocus checkbox when using HCSWizard [\#364](https://github.com/pymmcore-plus/pymmcore-widgets/pull/364) ([fdrgsp](https://github.com/fdrgsp))
- fix: enable ct axis order [\#361](https://github.com/pymmcore-plus/pymmcore-widgets/pull/361) ([fdrgsp](https://github.com/fdrgsp))
- fix: fix valueChanged signals on PropertyWidget [\#352](https://github.com/pymmcore-plus/pymmcore-widgets/pull/352) ([tlambert03](https://github.com/tlambert03))
- fix: Only allow YAML save/load when YAML available [\#347](https://github.com/pymmcore-plus/pymmcore-widgets/pull/347) ([gselzer](https://github.com/gselzer))
- fix: Align spin boxes and labels in GridPlan [\#345](https://github.com/pymmcore-plus/pymmcore-widgets/pull/345) ([gselzer](https://github.com/gselzer))
- fix: update the GroupPresetTableWidget policy [\#330](https://github.com/pymmcore-plus/pymmcore-widgets/pull/330) ([fdrgsp](https://github.com/fdrgsp))
- fix: make name editable EditGroupWidget [\#328](https://github.com/pymmcore-plus/pymmcore-widgets/pull/328) ([fdrgsp](https://github.com/fdrgsp))
- fix: WellPlateWidget initial drawing [\#327](https://github.com/pymmcore-plus/pymmcore-widgets/pull/327) ([fdrgsp](https://github.com/fdrgsp))
- fix: fix bug in config wizard where core state bleeds into model [\#309](https://github.com/pymmcore-plus/pymmcore-widgets/pull/309) ([tlambert03](https://github.com/tlambert03))

**Merged pull requests:**

- build: pin useq-schema to 0.5.0 [\#367](https://github.com/pymmcore-plus/pymmcore-widgets/pull/367) ([tlambert03](https://github.com/tlambert03))
- refactor: full repo reorganization [\#366](https://github.com/pymmcore-plus/pymmcore-widgets/pull/366) ([tlambert03](https://github.com/tlambert03))
- ci\(pre-commit.ci\): autoupdate [\#358](https://github.com/pymmcore-plus/pymmcore-widgets/pull/358) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
- ci\(pre-commit.ci\): autoupdate [\#357](https://github.com/pymmcore-plus/pymmcore-widgets/pull/357) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
- refactor: more grid plan cleanup [\#354](https://github.com/pymmcore-plus/pymmcore-widgets/pull/354) ([tlambert03](https://github.com/tlambert03))
- refactor: split run mda in mda widget [\#350](https://github.com/pymmcore-plus/pymmcore-widgets/pull/350) ([wl-stepp](https://github.com/wl-stepp))
- style: clarify save/load buttons in MDAWidget [\#346](https://github.com/pymmcore-plus/pymmcore-widgets/pull/346) ([gselzer](https://github.com/gselzer))
- style: unfill radio buttions in GridPlanWidget [\#344](https://github.com/pymmcore-plus/pymmcore-widgets/pull/344) ([gselzer](https://github.com/gselzer))
- style: Manually compute sizeHint\(\) [\#343](https://github.com/pymmcore-plus/pymmcore-widgets/pull/343) ([gselzer](https://github.com/gselzer))
- style: fix pixel affine table [\#341](https://github.com/pymmcore-plus/pymmcore-widgets/pull/341) ([tlambert03](https://github.com/tlambert03))
- refactor: refactor stage widget [\#334](https://github.com/pymmcore-plus/pymmcore-widgets/pull/334) ([tlambert03](https://github.com/tlambert03))
- refactor: remove old MDA widget [\#313](https://github.com/pymmcore-plus/pymmcore-widgets/pull/313) ([tlambert03](https://github.com/tlambert03))
- refactor: pydantic2 syntax [\#311](https://github.com/pymmcore-plus/pymmcore-widgets/pull/311) ([tlambert03](https://github.com/tlambert03))
- ci\(pre-commit.ci\): autoupdate [\#306](https://github.com/pymmcore-plus/pymmcore-widgets/pull/306) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))

## [v0.7.2](https://github.com/pymmcore-plus/pymmcore-widgets/tree/v0.7.2) (2024-06-13)

[Full Changelog](https://github.com/pymmcore-plus/pymmcore-widgets/compare/v0.7.1...v0.7.2)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ It forms the basis of [`napari-micromanager`](https://github.com/pymmcore-plus/n

See complete list of available widgets in the [documentation](https://pymmcore-plus.github.io/pymmcore-widgets/#widgets)


## Installation

```sh
Expand All @@ -28,5 +27,5 @@ pip install pymmcore-widgets
# you must install one yourself, for example:
pip install PyQt5

# package is tested against PyQt5, PyQt6, PySide2, and PySide6
# package is tested against PyQt5, PyQt6, PySide2, and PySide6(==6.7)
```
20 changes: 15 additions & 5 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ pip install pymmcore-widgets

### Installing PyQt or PySide

Since [pymmcore-widgets](./index.md) relies on either the [PyQt](https://riverbankcomputing.com/software/pyqt/) or [PySide](https://www.qt.io/qt-for-python) libraries, you also **need** to install one of these packages. You can use any of the available versions of these libraries: [PyQt5](https://pypi.org/project/PyQt5/), [PyQt6](https://pypi.org/project/PyQt6/), [PySide2](https://pypi.org/project/PySide2/) or [PySide6](https://pypi.org/project/PySide6/). For example, to install [PyQt6](https://riverbankcomputing.com/software/pyqt/download), you can use:
Since [pymmcore-widgets](./index.md) relies on either the
[PyQt](https://riverbankcomputing.com/software/pyqt/) or
[PySide](https://www.qt.io/qt-for-python) libraries, you also **need** to
install one of these packages. You can use any of the available versions of
these libraries: [PyQt5](https://pypi.org/project/PyQt5/),
[PyQt6](https://pypi.org/project/PyQt6/),
[PySide2](https://pypi.org/project/PySide2/) or
[PySide6](https://pypi.org/project/PySide6/). We strongly recommend using PyQt6
if possible. If you must use a specific backend version and run into problems,
please open an issue

For example, to install [PyQt6](https://riverbankcomputing.com/software/pyqt/download), you can use:

```sh
pip install PyQt6
Expand All @@ -21,10 +32,9 @@ pip install PyQt6
!!! Note
Widgets are tested on:

* `macOS & Windows`
* `Python 3.8, 3.9 3.10 & 3.11`
* `PyQt5 & PyQt6`
* `PySide2 & PySide6`
* macOS & Windows
* Python 3.9 and above
* PyQt5, PyQt6, PySide2 & PySide6(==6.7)

### Installing Micro-Manager

Expand Down
1 change: 1 addition & 0 deletions examples/grid_plan_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
mmc.loadSystemConfiguration()

grid_wdg = GridPlanWidget()
grid_wdg.valueChanged.connect(print)
grid_wdg.show()

app.exec_()
32 changes: 32 additions & 0 deletions examples/hcs_wizard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from contextlib import suppress

import useq
from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import StageWidget

with suppress(ImportError):
from rich import print

from pymmcore_widgets.hcs import HCSWizard

app = QApplication([])
mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()
w = HCSWizard()
w.show()
w.accepted.connect(lambda: print(w.value()))
s = StageWidget("XY", mmcore=mmc)
s.show()


plan = useq.WellPlatePlan(
plate=useq.WellPlate.from_str("96-well"),
a1_center_xy=(1000, 1500),
rotation=0.3,
selected_wells=slice(0, 8, 2),
)
w.setValue(plan)

app.exec()
5 changes: 5 additions & 0 deletions examples/mda_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
It is fully connected to the CMMCorePlus object, and has a "run" button.
"""

from contextlib import suppress

import useq
from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import MDAWidget

with suppress(ImportError):
from rich import print

app = QApplication([])

CMMCorePlus.instance().loadSystemConfiguration()
Expand Down
31 changes: 13 additions & 18 deletions examples/stage_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,18 @@
mmc.loadSystemConfiguration()

wdg = QWidget()
wdg.setLayout(QHBoxLayout())

stage_dev_list = list(mmc.getLoadedDevicesOfType(DeviceType.XYStage))
stage_dev_list.extend(iter(mmc.getLoadedDevicesOfType(DeviceType.Stage)))

for stage_dev in stage_dev_list:
if mmc.getDeviceType(stage_dev) is DeviceType.XYStage:
bx = QGroupBox("XY Control")
bx.setLayout(QHBoxLayout())
bx.layout().addWidget(StageWidget(device=stage_dev))
wdg.layout().addWidget(bx)
if mmc.getDeviceType(stage_dev) is DeviceType.Stage:
bx = QGroupBox("Z Control")
bx.setLayout(QHBoxLayout())
bx.layout().addWidget(StageWidget(device=stage_dev))
wdg.layout().addWidget(bx)
wdg_layout = QHBoxLayout(wdg)

stages = list(mmc.getLoadedDevicesOfType(DeviceType.XYStage))
stages.extend(mmc.getLoadedDevicesOfType(DeviceType.Stage))
for stage in stages:
lbl = "Z" if mmc.getDeviceType(stage) == DeviceType.Stage else "XY"
bx = QGroupBox(f"{lbl} Control")
bx_layout = QHBoxLayout(bx)
bx_layout.setContentsMargins(0, 0, 0, 0)
bx_layout.addWidget(StageWidget(device=stage, position_label_below=True))
wdg_layout.addWidget(bx)

wdg.show()

app.exec_()
wdg.show()
app.exec()
26 changes: 26 additions & 0 deletions examples/temp/plate_calibration_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import useq
from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import StageWidget
from pymmcore_widgets.hcs._plate_calibration_widget import PlateCalibrationWidget

mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()

app = QApplication([])

s = StageWidget("XY")
s.show()

plan = useq.WellPlatePlan(
plate=useq.WellPlate.from_str("96-well"),
a1_center_xy=(1000, 1500),
rotation=0.3,
)

wdg = PlateCalibrationWidget(mmcore=mmc)
wdg.setValue(plan)
wdg.show()

app.exec()
26 changes: 26 additions & 0 deletions examples/temp/well_calibration_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import StageWidget
from pymmcore_widgets.hcs._well_calibration_widget import WellCalibrationWidget

mmc = CMMCorePlus.instance()
mmc.loadSystemConfiguration()

app = QApplication([])

s = StageWidget("XY")
s.show()
c = WellCalibrationWidget(mmcore=mmc)


@c.calibrationChanged.connect
def _on_calibration_changed(calibrated: bool) -> None:
if calibrated:
print("Calibration changed! New center:", c.wellCenter())


c.setCircularWell(True)
c.show()

app.exec()
Loading

0 comments on commit fa2ec62

Please sign in to comment.