Skip to content

Commit b98f79e

Browse files
Comply with flake8 + testing debug
1 parent d5d1567 commit b98f79e

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/misc/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
x = df["feat_area_combined"]
1111
y = df["feat_eccentricity_combined"]
1212
plt.scatter(x, y, s=1, alpha=0.5)
13-
plt.savefig("test.png")
13+
plt.savefig("test.png")

src/scip/features/texture.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def _row(pixels, maximum_pixel_value, num_features):
6868
)
6969

7070
out = numpy.full(shape=(num_features,), fill_value=None, dtype=float)
71-
step = len(distances)*2
71+
step = len(distances) * 2
7272
for i, prop in enumerate(graycoprop_names):
7373
v = graycoprops(glcm, prop=prop)
74-
out[i*step:i*step+len(distances)] = v.mean(axis=1)
75-
out[i*step+len(distances):(i+1)*step] = v.std(axis=1)
74+
out[i * step:i * step + len(distances)] = v.mean(axis=1)
75+
out[i * step + len(distances):(i + 1) * step] = v.std(axis=1)
7676

7777
s = sobel(pixels)
7878
out[-4] = s.mean()

src/scip/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def channel_boundaries(quantiles, *, config, output):
130130
pandas.DataFrame(data=data, index=index).to_csv(str(output / "channel_boundaries.csv"))
131131

132132

133-
def main(
133+
def main( # noqa: C901
134134
*,
135135
paths,
136136
output,

src/scip/masking/threshold.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from skimage.morphology import (
2020
closing, disk, remove_small_holes, remove_small_objects, label)
2121
from skimage.filters import threshold_otsu, sobel, gaussian
22-
from skimage.segmentation import expand_labels
2322
from scipy.stats import normaltest
2423
from scip.utils.util import check
2524

@@ -35,9 +34,9 @@ def get_mask(el, main, main_channel, smooth):
3534
x = gaussian(x, sigma=smooth)
3635
x = sobel(x)
3736
x = closing(x, footprint=disk(2))
38-
x = gaussian(x, sigma=smooth*2)
37+
x = gaussian(x, sigma=smooth * 2)
3938
x = threshold_otsu(x) < x
40-
x = remove_small_holes(x, area_threshold=(x.shape[0]*x.shape[1])/4)
39+
x = remove_small_holes(x, area_threshold=(x.shape[0] * x.shape[1]) / 4)
4140
x = remove_small_objects(x, min_size=20)
4241
x = label(x)
4342
mask[main_channel], cc = x > 0, x.max()
@@ -56,9 +55,9 @@ def get_mask(el, main, main_channel, smooth):
5655
if (normaltest(x.ravel()).pvalue < 0.05):
5756
x = gaussian(x, sigma=smooth)
5857
x = sobel(x)
59-
x = gaussian(x, sigma=smooth*2)
58+
x = gaussian(x, sigma=smooth * 2)
6059
x = threshold_otsu(x) < x
61-
x = remove_small_holes(x, area_threshold=(x.shape[0]*x.shape[1])/4)
60+
x = remove_small_holes(x, area_threshold=(x.shape[0] * x.shape[1]) / 4)
6261
x = remove_small_objects(x, min_size=20)
6362
x = label(x)
6463
mask[dim], cc = x > 0, x.max()

src/scip/masking/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def _regions_touching(arr):
7878
else:
7979
return idx[counts > limit]
8080

81+
8182
@check
8283
def remove_regions_touching_border(p, bbox_channel_index):
8384
mask = numpy.empty_like(p["mask"])

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import pytest
2121
import numpy
22-
from dask.distributed import (Client, LocalCluster)
2322
import dask.bag
2423

24+
from dask.distributed import (Client, LocalCluster)
2525
from scip.utils import util
2626

2727

test/masking/test_bounding_box.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_bounding_box(images_folder, cluster):
2626
images_folder, channels=[0, 1, 2], partition_size=2)
2727
bag = watershed.create_masks_on_bag(bag, noisy_channels=[0])
2828
bag = bag.filter(partial(util.mask_predicate, bbox_channel_index=0))
29-
bag = bag.map_partitions(util.bounding_box_partition, bbox_channel_index=0)
29+
bag = bag.map_partitions(util.bounding_box_partition)
3030

3131
bag = bag.compute()
3232

0 commit comments

Comments
 (0)