From 31c9df483f803d9484213a456c42c395f52b1db7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 23:02:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../multitiffmultipageimagingextractor.py | 4 +++- tests/test_multitiff_multipage_imaging_extractor.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/roiextractors/extractors/tiffimagingextractors/multitiffmultipageimagingextractor.py b/src/roiextractors/extractors/tiffimagingextractors/multitiffmultipageimagingextractor.py index 4a45ff1c..a8dec5b2 100644 --- a/src/roiextractors/extractors/tiffimagingextractors/multitiffmultipageimagingextractor.py +++ b/src/roiextractors/extractors/tiffimagingextractors/multitiffmultipageimagingextractor.py @@ -53,7 +53,9 @@ def __init__(self, folder_path: str, pattern: str, sampling_frequency: float): def get_video(self, start_frame: int = None, end_frame: int = None, channel: Optional[int] = 0) -> np.ndarray: frame_idxs = np.arange(start_frame or 0, end_frame or self._num_frames) - file_idxs = np.searchsorted(self.page_tracker, frame_idxs, side="right") - 1 # index of the file that contains the frame + file_idxs = ( + np.searchsorted(self.page_tracker, frame_idxs, side="right") - 1 + ) # index of the file that contains the frame print(f"{file_idxs=}") file_start_idxs = self.page_tracker[file_idxs] # index of the first frame in the file frame_offset_idxs = frame_idxs - file_start_idxs # index of the frame in the file diff --git a/tests/test_multitiff_multipage_imaging_extractor.py b/tests/test_multitiff_multipage_imaging_extractor.py index 940bcac0..73d84c72 100644 --- a/tests/test_multitiff_multipage_imaging_extractor.py +++ b/tests/test_multitiff_multipage_imaging_extractor.py @@ -5,8 +5,9 @@ def test_init_multitiff_multipage_imaging_extractor(): extractor = MultiTiffMultiPageImagingExtractor( - folder_path=OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "splits", pattern="split_{:d}.tif", - sampling_frequency=1.0 + folder_path=OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "splits", + pattern="split_{:d}.tif", + sampling_frequency=1.0, ) assert extractor.get_num_channels() == 1