Skip to content

Commit 51385c6

Browse files
committed
slight warning cleanup + sort + lint
1 parent 066ce68 commit 51385c6

File tree

8 files changed

+17
-20
lines changed

8 files changed

+17
-20
lines changed

napari_cellseg3d/log_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def print_and_log(self, text):
3434
self.lock.acquire()
3535
try:
3636
print(text)
37-
# causes issues if you clik on terminal (tied to CMD QuickEdit mode)
37+
# causes issue if you clik on terminal (tied to CMD QuickEdit mode)
3838
self.moveCursor(QTextCursor.End)
3939
self.insertPlainText(f"\n{text}")
4040
self.verticalScrollBar().setValue(

napari_cellseg3d/model_workers.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
from qtpy.QtCore import Signal
4040
from tifffile import imwrite
4141

42-
# local
43-
from napari_cellseg3d.model_instance_seg import (
44-
binary_watershed,
45-
binary_connected,
46-
)
4742
from napari_cellseg3d import utils
4843

44+
# local
45+
from napari_cellseg3d.model_instance_seg import binary_connected
46+
from napari_cellseg3d.model_instance_seg import binary_watershed
47+
4948
"""
5049
Writing something to log messages from outside the main thread is rather problematic (plenty of silent crashes...)
5150
so instead, following the instructions in the guides below to have a worker with custom signals, I implemented
@@ -490,7 +489,7 @@ def __init__(
490489
do_augmentation,
491490
deterministic,
492491
):
493-
"""Initializes a worker for inference with the arguments needed by the :py:func:`~train` function.
492+
"""Initializes a worker for inference with the arguments needed by the :py:func:`~train` function. Note: See :py:func:`~train`
494493
495494
Args:
496495
* device : device to train on, cuda or cpu
@@ -525,7 +524,7 @@ def __init__(
525524
526525
* deterministic : dict with "use deterministic" : bool, whether to use deterministic training, "seed": seed for RNG
527526
528-
Note: See :py:func:`~train`
527+
529528
"""
530529

531530
print("init")

napari_cellseg3d/plugin_convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22

3+
import napari
34
from tifffile import imwrite
45

56
import napari_cellseg3d.interface as ui
@@ -142,7 +143,7 @@ def build(self):
142143
ui.add_blank(layout=layout, widget=self)
143144
#############################################################
144145
small_group_w, small_group_l = ui.make_group(
145-
"Remove small objects", l, t, r, b,parent=None
146+
"Remove small objects", l, t, r, b, parent=None
146147
)
147148

148149
ui.add_widgets(

napari_cellseg3d/plugin_dock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from datetime import datetime
44
from pathlib import Path
55

6+
import napari
67
import pandas as pd
78

89
# Qt

napari_cellseg3d/plugin_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import napari
22

33
# Qt
4-
from qtpy.QtWidgets import QSizePolicy
54
from qtpy.QtWidgets import QVBoxLayout
65
from qtpy.QtWidgets import QWidget
76

napari_cellseg3d/plugin_metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import matplotlib.pyplot as plt
2+
import napari
23
import numpy as np
34
from matplotlib.backends.backend_qt5agg import (
45
FigureCanvasQTAgg as FigureCanvas,

napari_cellseg3d/plugin_model_inference.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ def __init__(self, viewer: "napari.viewer.Viewer"):
9898
###########################
9999
# interface
100100

101-
self.view_results_container, self.view_results_layout = ui.make_container(
102-
T=7, B=0, parent=self
103-
)
101+
(
102+
self.view_results_container,
103+
self.view_results_layout,
104+
) = ui.make_container(T=7, B=0, parent=self)
104105

105106
self.view_checkbox = ui.make_checkbox(
106107
"View results in napari", self.toggle_display_number
@@ -357,12 +358,7 @@ def build(self):
357358
# model group
358359

359360
model_group_w, model_group_l = ui.make_group(
360-
"Model choice",
361-
L,
362-
T,
363-
R,
364-
B,
365-
parent = self
361+
"Model choice", L, T, R, B, parent=self
366362
) # model choice
367363

368364
ui.add_widgets(

napari_cellseg3d/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def save_stack(images, out_path, filetype=".png", check_warnings=False):
465465
"""Saves the files in labels at location out_path as a stack of len(labels) .png files
466466
467467
Args:
468-
labels: array of label images
468+
images: array of label images
469469
out_path: path to the directory for saving
470470
"""
471471
num = images.shape[0]

0 commit comments

Comments
 (0)