Skip to content

Commit 55d0f5b

Browse files
Update test config and fix minor issues
1 parent b1c8a41 commit 55d0f5b

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
23-
python-version: ["3.11", "3.12"]
23+
# 3.12 currently not supported due to issues with nifty.
24+
# python-version: ["3.11", "3.12"]
25+
python-version: ["3.11"]
2426

2527
steps:
2628
- name: Checkout

environment_cpu.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ channels:
44
- conda-forge
55
dependencies:
66
- cpuonly
7-
# - nifty =1.2.1=*_4
8-
- nifty
7+
# This pin is necessary because later nifty versions have import errors on windows.
8+
- nifty =1.2.1=*_4
99
- imagecodecs
1010
- magicgui
1111
- napari

environment_gpu.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
- conda-forge
66
dependencies:
77
- imagecodecs
8+
# This pin is necessary because later nifty versions have import errors on windows.
89
- nifty =1.2.1=*_4
910
- magicgui
1011
- napari

micro_sam/multi_dimensional_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def merge_instance_segmentation_3d(
325325
uv_ids = np.array([[edge["source"], edge["target"]] for edge in edges])
326326
overlaps = np.array([edge["score"] for edge in edges])
327327

328-
n_nodes = int(slice_segmentation[-1].max() + 1)
328+
n_nodes = int(slice_segmentation.max() + 1)
329329
graph = nifty.graph.undirectedGraph(n_nodes)
330330
graph.insertEdges(uv_ids)
331331

micro_sam/sam_annotator/_widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _add_path_param(self, name, value, select_type, title=None, placeholder=None
174174
layout.addWidget(label)
175175

176176
path_textbox = QtWidgets.QLineEdit()
177-
path_textbox.setText(value)
177+
path_textbox.setText(str(value))
178178
if placeholder is not None:
179179
path_textbox.setPlaceholderText(placeholder)
180180
path_textbox.textChanged.connect(lambda val: setattr(self, name, val))
@@ -210,7 +210,7 @@ def _get_directory_path(self, name, textbox, tooltip=None):
210210
if tooltip:
211211
directory.setToolTip(tooltip)
212212
if directory and Path(directory).is_dir():
213-
textbox.setText(directory)
213+
textbox.setText(str(directory))
214214
else:
215215
# Handle the case where the selected path is not a directory
216216
print("Invalid directory selected. Please try again.")
@@ -222,7 +222,7 @@ def _get_file_path(self, name, textbox, tooltip=None):
222222
if tooltip:
223223
file_path.setToolTip(tooltip)
224224
if file_path and Path(file_path).is_file():
225-
textbox.setText(file_path)
225+
textbox.setText(str(file_path))
226226
else:
227227
# Handle the case where the selected path is not a file
228228
print("Invalid file selected. Please try again.")

micro_sam/sam_annotator/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,10 @@ def _sync_embedding_widget(widget, model_type, save_path, checkpoint_path, devic
684684
widget.model_dropdown.setCurrentIndex(index)
685685

686686
if save_path is not None:
687-
widget.embeddings_save_path_param.setText(save_path)
687+
widget.embeddings_save_path_param.setText(str(save_path))
688688

689689
if checkpoint_path is not None:
690-
widget.custom_weights_param.setText(checkpoint_path)
690+
widget.custom_weights_param.setText(str(checkpoint_path))
691691

692692
if device is not None:
693693
widget.device = device

0 commit comments

Comments
 (0)