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 Sep 14, 2023
1 parent 47e9903 commit 03fbc1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ def __init__(
self._roi_response_deconvolved = self._load_npy(file_name="spks.npy", mmap_mode="r").T
self.iscell = self._load_npy("iscell.npy", mmap_mode="r")

channel_name = (
"OpticalChannel"
if len(streams["channel_streams"]) == 1
else channel_stream_name.capitalize()
)
channel_name = "OpticalChannel" if len(streams["channel_streams"]) == 1 else channel_stream_name.capitalize()
self._channel_names = [channel_name]

self._image_correlation = self._correlation_image_read()
Expand Down
12 changes: 5 additions & 7 deletions tests/test_suite2psegmentationextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def setUpClass(cls):
folder_path = str(OPHYS_DATA_PATH / "segmentation_datasets" / "suite2p")
cls.available_streams = dict(
channel_streams=["chan1", "chan2"],
plane_streams=dict(chan1=["chan1_plane0", "chan1_plane1", "chan1_combined"], chan2=["chan2_plane0", "chan2_plane1"])
plane_streams=dict(
chan1=["chan1_plane0", "chan1_plane1", "chan1_combined"], chan2=["chan2_plane0", "chan2_plane1"]
),
)

cls.folder_path = folder_path
Expand All @@ -31,15 +33,11 @@ def test_multi_stream_warns(self):
Suite2pSegmentationExtractor(folder_path=self.folder_path)

def test_invalid_stream_raises(self):
exc_msg = (
"The selected stream 'plane0' is not a valid stream name. To see what streams are available, call `Suite2pSegmentationExtractor.get_streams(folder_path=...)`."
)
exc_msg = "The selected stream 'plane0' is not a valid stream name. To see what streams are available, call `Suite2pSegmentationExtractor.get_streams(folder_path=...)`."
with self.assertRaisesWith(exc_type=ValueError, exc_msg=exc_msg):
Suite2pSegmentationExtractor(folder_path=self.folder_path, stream_name="plane0")

def test_incorrect_stream_raises(self):
exc_msg = (
"The selected stream 'chan1_plane2' is not in the available plane_streams '['chan1_plane0', 'chan1_plane1', 'chan1_combined']'!"
)
exc_msg = "The selected stream 'chan1_plane2' is not in the available plane_streams '['chan1_plane0', 'chan1_plane1', 'chan1_combined']'!"
with self.assertRaisesWith(exc_type=ValueError, exc_msg=exc_msg):
Suite2pSegmentationExtractor(folder_path=self.folder_path, stream_name="chan1_plane2")

0 comments on commit 03fbc1e

Please sign in to comment.