From 20ebf823d38df99b9c1889c41ceea4523a66ca61 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 2 Oct 2023 15:30:59 +0200 Subject: [PATCH] undo aider commits --- src/roiextractors/testing.py | 55 +++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/src/roiextractors/testing.py b/src/roiextractors/testing.py index 590613ec..d1720898 100644 --- a/src/roiextractors/testing.py +++ b/src/roiextractors/testing.py @@ -17,7 +17,7 @@ inttype = (int, np.integer) -def generate_dummy_video(size: Tuple[int], dtype: DtypeType = "uint16") -> np.ndarray: +def generate_dummy_video(size: Tuple[int], dtype: DtypeType = "uint16"): """Generate a dummy video of a given size and dtype. Parameters @@ -29,7 +29,7 @@ def generate_dummy_video(size: Tuple[int], dtype: DtypeType = "uint16") -> np.nd Returns ------- - np.ndarray + video : np.ndarray A dummy video of the given size and dtype. """ dtype = np.dtype(dtype) @@ -53,7 +53,7 @@ def generate_dummy_imaging_extractor( num_channels: int = 1, sampling_frequency: float = 30, dtype: DtypeType = "uint16", -) -> ImagingExtractor: +): """Generate a dummy imaging extractor for testing. The imaging extractor is built by feeding random data into the `NumpyImagingExtractor`. @@ -61,17 +61,17 @@ def generate_dummy_imaging_extractor( Parameters ---------- num_frames : int, optional - Number of frames in the video, by default 30. + number of frames in the video, by default 30. num_rows : int, optional - Number of rows in the video, by default 10. + number of rows in the video, by default 10. num_columns : int, optional - Number of columns in the video, by default 10. + number of columns in the video, by default 10. num_channels : int, optional - Number of channels in the video, by default 1. + number of channels in the video, by default 1. sampling_frequency : float, optional - Sampling frequency of the video, by default 30. + sampling frequency of the video, by default 30. dtype : DtypeType, optional - Dtype of the video, by default "uint16". + dtype of the video, by default "uint16". Returns ------- @@ -111,32 +111,32 @@ def generate_dummy_segmentation_extractor( Parameters ---------- num_rois : int, optional - Number of regions of interest, by default 10. + number of regions of interest, by default 10. num_frames : int, optional - Number of frames in the video, by default 30. - num_rows : int, optional - Number of rows in the video, by default 25. + _description_, by default 30 + num_rows : number of frames used in the hypotethical video from which the data was extracted, optional + number of rows in the hypotethical video from which the data was extracted, by default 25. num_columns : int, optional - Number of columns in the video, by default 25. + numbe rof columns in the hypotethical video from which the data was extracted, by default 25. sampling_frequency : float, optional - Sampling frequency of the video, by default 30.0. + sampling frequency of the hypotethical video form which the data was extracted, by default 30.0. has_summary_images : bool, optional - Whether the dummy segmentation extractor has summary images or not (mean and correlation). + whether the dummy segmentation extractor has summary images or not (mean and correlation) has_raw_signal : bool, optional - Whether a raw fluorescence signal is desired in the object, by default True. + whether a raw fluoresence signal is desired in the object, by default True. has_dff_signal : bool, optional - Whether a relative (df/f) fluorescence signal is desired in the object, by default True. + whether a relative (df/f) fluoresence signal is desired in the object, by default True. has_deconvolved_signal : bool, optional - Whether a deconvolved signal is desired in the object, by default True. + whether a deconvolved signal is desired in the object, by default True. has_neuropil_signal : bool, optional - Whether a neuropil signal is desired in the object, by default True. - rejected_list: Optional[list], optional + whether a neuropil signal is desiredi n the object, by default True. + rejected_list: list, optional A list of rejected rois, None by default. Returns ------- SegmentationExtractor - A segmentation extractor with random data fed into `NumpySegmentationExtractor`. + A segmentation extractor with random data fed into `NumpySegmentationExtractor` Notes ----- @@ -181,7 +181,7 @@ def generate_dummy_segmentation_extractor( correlation_image=correlation_image, roi_ids=roi_ids, roi_locations=roi_locations, - accepted_list=accepeted_list, + accepted_lst=accepeted_list, rejected_list=rejected_list, movie_dims=movie_dims, channel_names=["channel_num_0"], @@ -416,3 +416,12 @@ def check_imaging_return_types(img_ex: ImagingExtractor): shape_max=(img_ex.get_num_channels(),), ) _assert_iterable_complete(iterable=img_ex.get_image_size(), dtypes=Iterable, element_dtypes=inttype, shape=(2,)) + + # This needs a method for getting frame shape not image size. It only works for n_channel==1 + # two_first_frames = img_ex.get_frames(frame_idxs=[0, 1]) + # _assert_iterable_complete( + # iterable=two_first_frames, + # dtypes=(np.ndarray,), + # element_dtypes=inttype + floattype, + # shape=(2, *img_ex.get_image_size()), + # )