Skip to content

Commit c039878

Browse files
Lee NewbergLeengit
authored andcommitted
STYLE: Make flake8 happier
1 parent dccbe21 commit c039878

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

histomics_stream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
execution graph.
2727
2828
"""
29-
from . import configure, codecs
29+
from . import configure, codecs # noqa: F401,E402

histomics_stream/codecs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
"""Whole-slide image streamer for machine learning frameworks.
2020
21-
The histomics_stream.codecs module supplies codecs that are useful for Zarr file storage with jpeg or
22-
jpeg2k compression.
21+
The histomics_stream.codecs module supplies codecs that are useful for Zarr file storage
22+
with jpeg or jpeg2k compression.
2323
2424
"""
2525

@@ -39,10 +39,10 @@ class jpeg(Codec):
3939
4040
Notes
4141
-----
42-
For the code that uses Zarr data storage for jpeg images, we need to supply codecs. Note that we
43-
use this codec instead of that available from the zarr_jpeg package. The latter collapses
44-
dimensions by default, can require us to transpose dimensions, and can miss optimizations based upon
45-
RGB data.
42+
For the code that uses Zarr data storage for jpeg images, we need to supply codecs.
43+
Note that we use this codec instead of that available from the zarr_jpeg package.
44+
The latter collapses dimensions by default, can require us to transpose dimensions,
45+
and can miss optimizations based upon RGB data.
4646
4747
"""
4848

histomics_stream/pytorch.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
"""Whole-slide image streamer for machine learning frameworks."""
2020

21+
import numpy as np
22+
import torch
23+
from . import configure
24+
2125
"""
2226
See: How to load a list of numpy arrays to pytorch dataset loader?
2327
https://stackoverflow.com/questions/44429199/how-to-load-a-list-of-numpy-arrays-to-pytorch-dataset-loader
@@ -33,14 +37,8 @@
3337
"""
3438
See: A Comprehensive Guide to the DataLoader Class and Abstractions in PyTorch
3539
https://blog.paperspace.com/dataloaders-abstractions-pytorch/
36-
3740
"""
3841

39-
import numpy as np
40-
import torch
41-
42-
from . import configure
43-
4442

4543
class CreateTorchDataloader(configure.ChunkLocations):
4644
class MyDataset(torch.utils.data.IterableDataset, configure._TilesByCommon):

test/test_create_study.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ def test_create_study():
3636

3737
# Add a slide to the study, including slide-wide information with it.
3838
my_slide0 = my_slides["Slide_0"] = {}
39-
my_slide0[
40-
"filename"
41-
] = "/tf/notebooks/histomics_stream/example/TCGA-BH-A0BZ-01Z-00-DX1.45EB3E93-A871-49C6-9EAE-90D98AE01913.svs"
39+
my_slide0["filename"] = (
40+
"/tf/notebooks/histomics_stream/example/"
41+
"TCGA-BH-A0BZ-01Z-00-DX1.45EB3E93-A871-49C6-9EAE-90D98AE01913.svs"
42+
)
4243
my_slide0["slide_name"] = "TCGA-BH-A0BZ-01Z-00-DX1"
4344
my_slide0["slide_group"] = "TCGA-BH-A0BZ"
4445
my_slide0["chunk_height"] = 2048
@@ -81,7 +82,8 @@ def test_create_study():
8182
my_study_by_grid_and_mask,
8283
overlap_height=0,
8384
overlap_width=0,
84-
mask_filename="/tf/notebooks/histomics_stream/example/TCGA-BH-A0BZ-01Z-00-DX1.45EB3E93-A871-49C6-9EAE-90D98AE01913-mask.png",
85+
mask_filename="/tf/notebooks/histomics_stream/example/"
86+
"TCGA-BH-A0BZ-01Z-00-DX1.45EB3E93-A871-49C6-9EAE-90D98AE01913-mask.png",
8587
randomly_select=100,
8688
)
8789
# We could apply this to a subset of the slides, but we will apply it to all

test/test_find_imports.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
def test_imports_can_be_found():
2323
"""Purpose: Test to check that each import can be found"""
2424

25-
# Import succeeds
26-
import imagecodecs
27-
import itk
28-
import numcodecs
29-
import numpy
30-
import scipy.interpolate
31-
import tensorflow
32-
import torch
33-
import zarr
25+
import imagecodecs # noqa: F401
26+
import itk # noqa: F401
27+
import numcodecs # noqa: F401
28+
import numpy # noqa: F401
29+
import scipy.interpolate # noqa: F401
30+
import tensorflow # noqa: F401
31+
import torch # noqa: F401
32+
import zarr # noqa: F401
3433

3534

3635
if __name__ == "__main__":

0 commit comments

Comments
 (0)