Skip to content

Commit

Permalink
aider: Fixed docstring of generate_dummy_segmentation_extractor to …
Browse files Browse the repository at this point in the history
…address issues with parameter documentation and formatting.

# Aider chat conversation:

ASSISTANT: The error message indicates that there are some issues with the docstring of the function `generate_dummy_segmentation_extractor` in the file `src/roiextractors/testing.py`.

The issues are as follows:

1. The parameter `rejected_list` is not documented.
2. There are unknown parameters `{'optional', 'rejected_list: list'}`.
3. The parameter "rejected_list" requires a space before the colon separating the parameter name and type.
4. The parameter "optional" has no type.
5. The return value description should finish with "."

To fix these issues, we need to modify the docstring of the function `generate_dummy_segmentation_extractor` in the file `src/roiextractors/testing.py`.

Here is the proposed change:

```python
src/roiextractors/testing.py
<<<<<<< HEAD
    rejected_list: Optional[list] = None,
) -> SegmentationExtractor:
    """
    Generate a dummy segmentation extractor for testing.

    The segmentation extractor is built by feeding random data into the
    `NumpySegmentationExtractor`.

    Parameters
    ----------
    num_rois : int, optional
        Number of regions of interest, by default 10.
    num_frames : int, optional
        Number of frames in the hypothetical video from which the data was extracted, by default 30.
    num_rows : int, optional
        Number of rows in the hypothetical video from which the data was extracted, by default 25.
    num_columns : int, optional
        Number of columns in the hypothetical video from which the data was extracted, by default 25.
    sampling_frequency : float, optional
        Sampling frequency of the hypothetical video from 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).
    has_raw_signal : bool, optional
        Whether a raw fluorescence 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.
    has_deconvolved_signal : bool, optional
        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: list, optional
        A list of rejected rois, None by default.

    Returns
    -------
    SegmentationExtractor
        A segmentation extractor with random data fed into `NumpySegmentationExtractor`

    Notes
    -----
    Note that this dummy example is meant to be a mock object with the right shape, structure and objects but does not
    contain meaningful content. That is, the image masks matrices are not plausible image mask for a roi, the raw signal
    is not a meaningful biological signal and is not related appropriately to the deconvolved signal , etc.
    """
=======
    rejected_list: Optional[list] = None,
) -> SegmentationExtractor:
    """
    Generate a dummy segmentation extractor for testing.

    The segmentation extractor is built by feeding random data into the
    `NumpySegmentationExtractor`.

    Parameters
    ----------
    num_rois : int, optional
        Number of regions of interest, by default 10.
    num_frames : int, optional
        Number of frames in the hypothetical video from which the data was extracted, by default 30.
    num_rows : int, optional
        Number of rows in the hypothetical video from which the data was extracted, by default 25.
    num_columns : int, optional
        Number of columns in the hypothetical video from which the data was extracted, by default 25.
    sampling_frequency : float, optional
        Sampling frequency of the hypothetical video from 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).
    has_raw_signal : bool, optional
        Whether a raw fluorescence 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.
    has_deconvolved_signal : bool, optional
        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 : list, optional
        A list of rejected rois, None by default.

    Returns
    -------
    SegmentationExtractor
        A segmentation extractor with random data fed into `NumpySegmentationExtractor`.

    Notes
    -----
    Note that this dummy example is meant to be a mock object with the right shape, structure and objects but does not
    contain meaningful content. That is, the image masks matrices are not plausible image mask for a roi, the raw signal
    is not a meaningful biological signal and is not related appropriately to the deconvolved signal , etc.
    """
>>>>>>> updated
```
  • Loading branch information
pauladkisson committed Oct 3, 2023
1 parent e308db6 commit c4aab3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/roiextractors/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def generate_dummy_segmentation_extractor(
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: list, optional
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

0 comments on commit c4aab3e

Please sign in to comment.