Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 7, 2023
1 parent bb7495c commit 16a606c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def get_streams(cls, folder_path: PathType) -> dict:
return streams

def __init__(
self,
folder_path: PathType,
stream_name: Optional[str] = None,
self,
folder_path: PathType,
stream_name: Optional[str] = None,
):
"""
The imaging extractor for the Bruker TIF image format.
Expand All @@ -118,8 +118,10 @@ def __init__(
tif_file_paths = list(folder_path.glob("*.ome.tif"))
assert tif_file_paths, f"The TIF image files are missing from '{folder_path}'."

assert _determine_imaging_is_volumetric(folder_path=folder_path), f"{self.extractor_name}Extractor is for volumetric imaging. " \
"For single imaging plane data use BrukerTiffSinglePlaneImagingExtractor."
assert _determine_imaging_is_volumetric(folder_path=folder_path), (
f"{self.extractor_name}Extractor is for volumetric imaging. "
"For single imaging plane data use BrukerTiffSinglePlaneImagingExtractor."
)

streams = self.get_streams(folder_path=folder_path)
if stream_name is None:
Expand Down
12 changes: 9 additions & 3 deletions tests/test_brukertiffimagingextactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def tearDownClass(cls):
shutil.rmtree(cls.test_dir)

def test_stream_names(self):
self.assertEqual(BrukerTiffSinglePlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams)
self.assertEqual(
BrukerTiffSinglePlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams
)

def test_incorrect_stream_name_raises(self):
exc_msg = f"The selected stream 'Ch1' is not in the available channel_streams '['Ch2']'!"
Expand Down Expand Up @@ -131,7 +133,9 @@ def setUpClass(cls):
cls.test_video[..., 1] = second_plane_video

def test_stream_names(self):
self.assertEqual(BrukerTiffMultiPlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams)
self.assertEqual(
BrukerTiffMultiPlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams
)

def test_brukertiffextractor_image_size(self):
self.assertEqual(self.extractor.get_image_size(), (512, 512, 2))
Expand Down Expand Up @@ -191,7 +195,9 @@ def test_not_selecting_stream_raises(self):
BrukerTiffSinglePlaneImagingExtractor(folder_path=self.folder_path)

def test_stream_names(self):
assert_array_equal(BrukerTiffSinglePlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams)
assert_array_equal(
BrukerTiffSinglePlaneImagingExtractor.get_streams(folder_path=self.folder_path), self.available_streams
)

def test_brukertiffextractor_image_size(self):
self.assertEqual(self.extractor.get_image_size(), (512, 512))
Expand Down

0 comments on commit 16a606c

Please sign in to comment.