Skip to content

Commit

Permalink
undo aider commits
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Oct 2, 2023
1 parent 8f4785a commit 20ebf82
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions src/roiextractors/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -53,25 +53,25 @@ 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`.
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
-------
Expand Down Expand Up @@ -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
-----
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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()),
# )

0 comments on commit 20ebf82

Please sign in to comment.