Skip to content

Commit

Permalink
Fix bug launching plate viewer without ultrack (#24)
Browse files Browse the repository at this point in the history
* Refactor __init__ to skip `open_image_and_tracks` if ultrack is not installed

* Revert "Refactor __init__ to skip `open_image_and_tracks` if ultrack is not installed"

This reverts commit 6955b76.

* Move ultrack import into `open_image_and_tracks`

* add py312 to tox
  • Loading branch information
ieivanov authored Dec 25, 2024
1 parent 80b82f8 commit 29cd36b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/napari_iohub/_view_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from iohub.ngff import open_ome_zarr
from magicgui import magic_factory
from ultrack.reader.napari_reader import read_csv
from xarray import open_zarr

from napari_iohub._reader import fov_to_layers
Expand Down Expand Up @@ -84,6 +83,11 @@ def open_image_and_tracks(
List of layers to add to the viewer.
(image layers and one labels layer)
"""
try:
from ultrack.reader.napari_reader import read_csv
except ImportError:
raise ImportError("Please install napari-iohub[clustering]")

_logger.info(f"Loading images from {images_dataset}")
image_plate = open_ome_zarr(images_dataset)
image_fov = image_plate[fov_name]
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{310,311}-{linux,macos,windows}
envlist = py{310,311,312}-{linux,macos,windows}
isolated_build=true

[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
PLATFORM =
Expand Down

0 comments on commit 29cd36b

Please sign in to comment.