Repository: SpikeInterface/spikeinterface
Pull request #2956 (2024-06-01 11:42:06)

Remove upper bound in scipy dependency for full install
This is something that @samuelgarcia asked me to do here https://github.com/SpikeInterface/spikeinterface/pull/2665#discussion_r1552037196 but got lost.


Hopefully the tests pass.


Patch:
diff --git a/pyproject.toml b/pyproject.toml
index d040a4a36..a3551d045 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -91,7 +91,7 @@ full = [
     "h5py",
     "pandas",
     "xarray",
-    "scipy<1.13",
+    "scipy",
     "scikit-learn",
     "networkx",
     "distinctipy",
diff --git a/src/spikeinterface/preprocessing/zero_channel_pad.py b/src/spikeinterface/preprocessing/zero_channel_pad.py
index cf4ba6a4a..a75bebbb8 100644
--- a/src/spikeinterface/preprocessing/zero_channel_pad.py
+++ b/src/spikeinterface/preprocessing/zero_channel_pad.py
@@ -17,7 +17,7 @@ class TracePaddedRecording(BasePreprocessor):
 
     Parameters
     ----------
-    recording_segment : BaseRecording
+    parent_recording_segment : BaseRecording
         The parent recording segment from which the traces are to be retrieved.
     padding_start : int, default: 0
         The amount of padding to add to the left of the traces. It has to be non-negative.
@@ -29,17 +29,19 @@ class TracePaddedRecording(BasePreprocessor):
         The value to pad with
     """
 
-    def __init__(self, recording: BaseRecording, padding_start: int = 0, padding_end: int = 0, fill_value: float = 0.0):
+    def __init__(
+        self, parent_recording: BaseRecording, padding_start: int = 0, padding_end: int = 0, fill_value: float = 0.0
+    ):
         assert padding_end >= 0 and padding_start >= 0, "Paddings must be >= 0"
-        super().__init__(recording=recording)
+        super().__init__(recording=parent_recording)
 
         self.padding_start = padding_start
         self.padding_end = padding_end
         self.fill_value = fill_value
-        for segment in recording._recording_segments:
+        for segment in parent_recording._recording_segments:
             recording_segment = TracePaddedRecordingSegment(
                 segment,
-                recording.get_num_channels(),
+                parent_recording.get_num_channels(),
                 self.dtype,
                 self.padding_start,
                 self.padding_end,
@@ -48,7 +50,7 @@ class TracePaddedRecording(BasePreprocessor):
             self.add_recording_segment(recording_segment)
 
         self._kwargs = dict(
-            parent_recording=recording,
+            parent_recording=parent_recording,
             padding_start=padding_start,
             padding_end=padding_end,
             fill_value=fill_value,
@@ -58,21 +60,21 @@ class TracePaddedRecording(BasePreprocessor):
 class TracePaddedRecordingSegment(BasePreprocessorSegment):
     def __init__(
         self,
-        recording_segment: BaseRecordingSegment,
+        parent_recording_segment: BaseRecordingSegment,
         num_channels,
         dtype,
-        padding_left,
+        paddign_left,
         padding_end,
         fill_value,
     ):
-        self.padding_start = padding_left
+        self.padding_start = paddign_left
         self.padding_end = padding_end
         self.fill_value = fill_value
         self.num_channels = num_channels
-        self.num_samples_in_original_segment = recording_segment.get_num_samples()
+        self.num_samples_in_original_segment = parent_recording_segment.get_num_samples()
         self.dtype = dtype
 
-        super().__init__(parent_recording_segment=recording_segment)
+        super().__init__(parent_recording_segment=parent_recording_segment)
 
     def get_traces(self, start_frame, end_frame, channel_indices):
         if start_frame is None:
@@ -144,12 +146,12 @@ class ZeroChannelPaddedRecording(BaseRecording):
     name = "zero_channel_pad"
     installed = True
 
-    def __init__(self, recording: BaseRecording, num_channels: int, channel_mapping: Union[list, None] = None):
+    def __init__(self, parent_recording: BaseRecording, num_channels: int, channel_mapping: Union[list, None] = None):
         """Pads a recording with channels that contain only zero.
 
         Parameters
         ----------
-        recording : BaseRecording
+        parent_recording : BaseRecording
             recording to zero-pad
         num_channels : int
             Total number of channels in the zero-channel-padded recording
@@ -158,44 +160,51 @@ class ZeroChannelPaddedRecording(BaseRecording):
             If None, sorts the channel indices in ascending y channel location and puts them at the
             beginning of the zero-channel-padded recording.
         """
-        BaseRecording.__init__(self, recording.get_sampling_frequency(), np.arange(num_channels), recording.get_dtype())
+        BaseRecording.__init__(
+            self, parent_recording.get_sampling_frequency(), np.arange(num_channels), parent_recording.get_dtype()
+        )
 
         if channel_mapping is not None:
             assert (
-                len(channel_mapping) == recording.get_num_channels()
+                len(channel_mapping) == parent_recording.get_num_channels()
             ), "The new mapping must be specified for all channels."
             assert max(channel_mapping) < num_channels, (
                 "The new mapping cannot exceed total number of channels " "in the zero-chanenl-padded recording."
             )
         else:
-            if "locations" in recording.get_property_keys() or "contact_vector" in recording.get_property_keys():
-                self.channel_mapping = np.argsort(recording.get_channel_locations()[:, 1])
+            if (
+                "locations" in parent_recording.get_property_keys()
+                or "contact_vector" in parent_recording.get_property_keys()
+            ):
+                self.channel_mapping = np.argsort(parent_recording.get_channel_locations()[:, 1])
             else:
-                self.channel_mapping = np.arange(recording.get_num_channels())
+                self.channel_mapping = np.arange(parent_recording.get_num_channels())
 
-        self.parent_recording = recording
+        self.parent_recording = parent_recording
         self.num_channels = num_channels
-        for segment in recording._recording_segments:
+        for segment in parent_recording._recording_segments:
             recording_segment = ZeroChannelPaddedRecordingSegment(segment, self.num_channels, self.channel_mapping)
             self.add_recording_segment(recording_segment)
 
         # only copy relevant metadata and properties
-        recording.copy_metadata(self, only_main=True)
-        self._parent = recording
-        prop_keys = recording.get_property_keys()
+        parent_recording.copy_metadata(self, only_main=True)
+        self._parent = parent_recording
+        prop_keys = parent_recording.get_property_keys()
 
         for k in prop_keys:
             values = self.get_property(k)
             if values is not None:
                 self.set_property(k, values, ids=self.channel_ids[self.channel_mapping])
 
-        self._kwargs = dict(parent_recording=recording, num_channels=num_channels, channel_mapping=channel_mapping)
+        self._kwargs = dict(
+            parent_recording=parent_recording, num_channels=num_channels, channel_mapping=channel_mapping
+        )
 
 
 class ZeroChannelPaddedRecordingSegment(BasePreprocessorSegment):
-    def __init__(self, recording_segment: BaseRecordingSegment, num_channels: int, channel_mapping: list):
-        BasePreprocessorSegment.__init__(self, recording_segment)
-        self.parent_recording_segment = recording_segment
+    def __init__(self, parent_recording_segment: BaseRecordingSegment, num_channels: int, channel_mapping: list):
+        BasePreprocessorSegment.__init__(self, parent_recording_segment)
+        self.parent_recording_segment = parent_recording_segment
         self.num_channels = num_channels
         self.channel_mapping = channel_mapping
 
diff --git a/src/spikeinterface/qualitymetrics/misc_metrics.py b/src/spikeinterface/qualitymetrics/misc_metrics.py
index 4db0eb147..b68c1b868 100644
--- a/src/spikeinterface/qualitymetrics/misc_metrics.py
+++ b/src/spikeinterface/qualitymetrics/misc_metrics.py
@@ -37,13 +37,12 @@ _default_params = dict()
 
 
 def compute_num_spikes(sorting_analyzer, unit_ids=None, **kwargs):
-    """
-    Compute the number of spike across segments.
+    """Compute the number of spike across segments.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     unit_ids : list or None
         The list of unit ids to compute the number of spikes. If None, all units are used.
 
@@ -70,13 +69,12 @@ def compute_num_spikes(sorting_analyzer, unit_ids=None, **kwargs):
 
 
 def compute_firing_rates(sorting_analyzer, unit_ids=None, **kwargs):
-    """
-    Compute the firing rate across segments.
+    """Compute the firing rate across segments.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     unit_ids : list or None
         The list of unit ids to compute the firing rate. If None, all units are used.
 
@@ -99,18 +97,17 @@ def compute_firing_rates(sorting_analyzer, unit_ids=None, **kwargs):
 
 
 def compute_presence_ratios(sorting_analyzer, bin_duration_s=60.0, mean_fr_ratio_thresh=0.0, unit_ids=None, **kwargs):
-    """
-    Calculate the presence ratio, the fraction of time the unit is firing above a certain threshold.
+    """Calculate the presence ratio, the fraction of time the unit is firing above a certain threshold.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     bin_duration_s : float, default: 60
         The duration of each bin in seconds. If the duration is less than this value,
-        presence_ratio is set to NaN.
-    mean_fr_ratio_thresh : float, default: 0
-        The unit is considered active in a bin if its firing rate during that bin.
+        presence_ratio is set to NaN
+    mean_fr_ratio_thresh: float, default: 0
+        The unit is considered active in a bin if its firing rate during that bin
         is strictly above `mean_fr_ratio_thresh` times its mean firing rate throughout the recording.
     unit_ids : list or None
         The list of unit ids to compute the presence ratio. If None, all units are used.
@@ -185,19 +182,18 @@ def compute_snrs(
     peak_mode: str = "extremum",
     unit_ids=None,
 ):
-    """
-    Compute signal to noise ratio.
+    """Compute signal to noise ratio.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     peak_sign : "neg" | "pos" | "both", default: "neg"
         The sign of the template to compute best channels.
-    peak_mode : "extremum" | "at_index", default: "extremum"
+    peak_mode: "extremum" | "at_index", default: "extremum"
         How to compute the amplitude.
         Extremum takes the maxima/minima
-        At_index takes the value at t=sorting_analyzer.nbefore.
+        At_index takes the value at t=sorting_analyzer.nbefore
     unit_ids : list or None
         The list of unit ids to compute the SNR. If None, all units are used.
 
@@ -236,8 +232,7 @@ _default_params["snr"] = dict(peak_sign="neg", peak_mode="extremum")
 
 
 def compute_isi_violations(sorting_analyzer, isi_threshold_ms=1.5, min_isi_ms=0, unit_ids=None):
-    """
-    Calculate Inter-Spike Interval (ISI) violations.
+    """Calculate Inter-Spike Interval (ISI) violations.
 
     It computes several metrics related to isi violations:
         * isi_violations_ratio: the relative firing rate of the hypothetical neurons that are
@@ -247,13 +242,13 @@ def compute_isi_violations(sorting_analyzer, isi_threshold_ms=1.5, min_isi_ms=0,
     Parameters
     ----------
     sorting_analyzer : SortingAnalyzer
-        The SortingAnalyzer object.
+        The SortingAnalyzer object
     isi_threshold_ms : float, default: 1.5
         Threshold for classifying adjacent spikes as an ISI violation, in ms.
-        This is the biophysical refractory period.
+        This is the biophysical refractory period
     min_isi_ms : float, default: 0
         Minimum possible inter-spike interval, in ms.
-        This is the artificial refractory period enforced.
+        This is the artificial refractory period enforced
         by the data acquisition system or post-processing algorithms.
     unit_ids : list or None
         List of unit ids to compute the ISI violations. If None, all units are used.
@@ -320,8 +315,7 @@ _default_params["isi_violation"] = dict(isi_threshold_ms=1.5, min_isi_ms=0)
 def compute_refrac_period_violations(
     sorting_analyzer, refractory_period_ms: float = 1.0, censored_period_ms: float = 0.0, unit_ids=None
 ):
-    """
-    Calculate the number of refractory period violations.
+    """Calculates the number of refractory period violations.
 
     This is similar (but slightly different) to the ISI violations.
     The key difference being that the violations are not only computed on consecutive spikes.
@@ -331,7 +325,7 @@ def compute_refrac_period_violations(
     Parameters
     ----------
     sorting_analyzer : SortingAnalyzer
-        The SortingAnalyzer object.
+        The SortingAnalyzer object
     refractory_period_ms : float, default: 1.0
         The period (in ms) where no 2 good spikes can occur.
     censored_period_ms : float, default: 0.0
@@ -354,6 +348,7 @@ def compute_refrac_period_violations(
     References
     ----------
     Based on metrics described in [Llobet]_
+
     """
     res = namedtuple("rp_violations", ["rp_contamination", "rp_violations"])
 
@@ -416,35 +411,34 @@ def compute_sliding_rp_violations(
     contamination_values=None,
     unit_ids=None,
 ):
-    """
-    Compute sliding refractory period violations, a metric developed by IBL which computes
+    """Compute sliding refractory period violations, a metric developed by IBL which computes
     contamination by using a sliding refractory period.
     This metric computes the minimum contamination with at least 90% confidence.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     min_spikes : int, default: 0
         Contamination  is set to np.nan if the unit has less than this many
         spikes across all segments.
     bin_size_ms : float, default: 0.25
-        The size of binning for the autocorrelogram in ms.
+        The size of binning for the autocorrelogram in ms
     window_size_s : float, default: 1
-        Window in seconds to compute correlogram.
+        Window in seconds to compute correlogram
     exclude_ref_period_below_ms : float, default: 0.5
-        Refractory periods below this value are excluded.
+        Refractory periods below this value are excluded
     max_ref_period_ms : float, default: 10
-        Maximum refractory period to test in ms.
+        Maximum refractory period to test in ms
     contamination_values : 1d array or None, default: None
-        The contamination values to test, If None, it is set to np.arange(0.5, 35, 0.5).
+        The contamination values to test, If None, it is set to np.arange(0.5, 35, 0.5)
     unit_ids : list or None
         List of unit ids to compute the sliding RP violations. If None, all units are used.
 
     Returns
     -------
     contamination : dict of floats
-        The minimum contamination at 90% confidence.
+        The minimum contamination at 90% confidence
 
     References
     ----------
@@ -503,8 +497,7 @@ _default_params["sliding_rp_violation"] = dict(
 
 
 def get_synchrony_counts(spikes, synchrony_sizes, all_unit_ids):
-    """
-    Compute synchrony counts, the number of simultaneous spikes with sizes `synchrony_sizes`.
+    """Compute synchrony counts, the number of simultaneous spikes with sizes `synchrony_sizes`
 
     Parameters
     ----------
@@ -512,7 +505,7 @@ def get_synchrony_counts(spikes, synchrony_sizes, all_unit_ids):
         Structured numpy array with fields ("sample_index", "unit_index", "segment_index").
     synchrony_sizes : numpy array
         The synchrony sizes to compute. Should be pre-sorted.
-    all_unit_ids : list or None, default: None
+    unit_ids : list or None, default: None
         List of unit ids to compute the synchrony metrics. Expecting all units.
 
     Returns
@@ -548,14 +541,13 @@ def get_synchrony_counts(spikes, synchrony_sizes, all_unit_ids):
 
 
 def compute_synchrony_metrics(sorting_analyzer, synchrony_sizes=(2, 4, 8), unit_ids=None):
-    """
-    Compute synchrony metrics. Synchrony metrics represent the rate of occurrences of
+    """Compute synchrony metrics. Synchrony metrics represent the rate of occurrences of
     "synchrony_size" spikes at the exact same sample index.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     synchrony_sizes : list or tuple, default: (2, 4, 8)
         The synchrony sizes to compute.
     unit_ids : list or None, default: None
@@ -612,13 +604,12 @@ _default_params["synchrony"] = dict(synchrony_sizes=(2, 4, 8))
 
 
 def compute_firing_ranges(sorting_analyzer, bin_size_s=5, percentiles=(5, 95), unit_ids=None, **kwargs):
-    """
-    Calculate firing range, the range between the 5th and 95th percentiles of the firing rates distribution
+    """Calculate firing range, the range between the 5th and 95th percentiles of the firing rates distribution
     computed in non-overlapping time bins.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
+    sorting_analyzer: SortingAnalyzer
         A SortingAnalyzer object
     bin_size_s : float, default: 5
         The size of the bin in seconds.
@@ -684,21 +675,18 @@ def compute_amplitude_cv_metrics(
     amplitude_extension="spike_amplitudes",
     unit_ids=None,
 ):
-    """
-    Calculate coefficient of variation of spike amplitudes within defined temporal bins.
+    """Calculate coefficient of variation of spike amplitudes within defined temporal bins.
     From the distribution of coefficient of variations, both the median and the "range" (the distance between the
     percentiles defined by `percentiles` parameter) are returned.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     average_num_spikes_per_bin : int, default: 50
         The average number of spikes per bin. This is used to estimate a temporal bin size using the firing rate
         of each unit. For example, if a unit has a firing rate of 10 Hz, amd the average number of spikes per bin is
         100, then the temporal bin size will be 100/10 Hz = 10 s.
-    percentiles : tuple, default: (5, 95)
-        The percentile values from which to calculate the range.
     min_num_bins : int, default: 10
         The minimum number of bins to compute the median and range. If the number of bins is less than this then
         the median and range are set to NaN.
@@ -822,13 +810,12 @@ def compute_amplitude_cutoffs(
     amplitudes_bins_min_ratio=5,
     unit_ids=None,
 ):
-    """
-    Calculate approximate fraction of spikes missing from a distribution of amplitudes.
+    """Calculate approximate fraction of spikes missing from a distribution of amplitudes.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     peak_sign : "neg" | "pos" | "both", default: "neg"
         The sign of the peaks.
     num_histogram_bins : int, default: 100
@@ -906,13 +893,12 @@ _default_params["amplitude_cutoff"] = dict(
 
 
 def compute_amplitude_medians(sorting_analyzer, peak_sign="neg", unit_ids=None):
-    """
-    Compute median of the amplitude distributions (in absolute value).
+    """Compute median of the amplitude distributions (in absolute value).
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     peak_sign : "neg" | "pos" | "both", default: "neg"
         The sign of the peaks.
     unit_ids : list or None
@@ -959,8 +945,7 @@ def compute_drift_metrics(
     return_positions=False,
     unit_ids=None,
 ):
-    """
-    Compute drifts metrics using estimated spike locations.
+    """Compute drifts metrics using estimated spike locations.
     Over the duration of the recording, the drift signal for each unit is calculated as the median
     position in an interval with respect to the overall median positions over the entire duration
     (reference position).
@@ -975,36 +960,36 @@ def compute_drift_metrics(
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     interval_s : int, default: 60
-        Interval length is seconds for computing spike depth.
+        Interval length is seconds for computing spike depth
     min_spikes_per_interval : int, default: 100
-        Minimum number of spikes for computing depth in an interval.
+        Minimum number of spikes for computing depth in an interval
     direction : "x" | "y" | "z", default: "y"
-        The direction along which drift metrics are estimated.
+        The direction along which drift metrics are estimated
     min_fraction_valid_intervals : float, default: 0.5
         The fraction of valid (not NaN) position estimates to estimate drifts.
         E.g., if 0.5 at least 50% of estimated positions in the intervals need to be valid,
-        otherwise drift metrics are set to None.
+        otherwise drift metrics are set to None
     min_num_bins : int, default: 2
         Minimum number of bins required to return a valid metric value. In case there are
         less bins, the metric values are set to NaN.
     return_positions : bool, default: False
-        If True, median positions are returned (for debugging).
+        If True, median positions are returned (for debugging)
     unit_ids : list or None, default: None
-        List of unit ids to compute the drift metrics. If None, all units are used.
+        List of unit ids to compute the drift metrics. If None, all units are used
 
     Returns
     -------
     drift_ptp : dict
-        The drift signal peak-to-peak in um.
+        The drift signal peak-to-peak in um
     drift_std : dict
-        The drift signal standard deviation in um.
+        The drift signal standard deviation in um
     drift_mad : dict
-        The drift signal median absolute deviation in um.
+        The drift signal median absolute deviation in um
     median_positions : np.array (optional)
-        The median positions of each unit over time (only returned if return_positions=True).
+        The median positions of each unit over time (only returned if return_positions=True)
 
     Notes
     -----
@@ -1127,27 +1112,26 @@ _default_params["drift"] = dict(interval_s=60, min_spikes_per_interval=100, dire
 
 ### LOW-LEVEL FUNCTIONS ###
 def presence_ratio(spike_train, total_length, bin_edges=None, num_bin_edges=None, bin_n_spikes_thres=0):
-    """
-    Calculate the presence ratio for a single unit.
+    """Calculate the presence ratio for a single unit
 
     Parameters
     ----------
     spike_train : np.ndarray
-        Spike times for this unit, in samples.
+        Spike times for this unit, in samples
     total_length : int
-        Total length of the recording in samples.
-    bin_edges : np.array, optional
+        Total length of the recording in samples
+    bin_edges : np.array
         Pre-computed bin edges (mutually exclusive with num_bin_edges).
-    num_bin_edges : int, optional
+    num_bin_edges : int, default: 101
         The number of bins edges to use to compute the presence ratio.
         (mutually exclusive with bin_edges).
-    bin_n_spikes_thres : int, default: 0
-        Minimum number of spikes within a bin to consider the unit active.
+    bin_n_spikes_thres: int, default: 0
+        Minimum number of spikes within a bin to consider the unit active
 
     Returns
     -------
     presence_ratio : float
-        The presence ratio for one unit.
+        The presence ratio for one unit
 
     """
     assert bin_edges is not None or num_bin_edges is not None, "Use either bin_edges or num_bin_edges"
@@ -1163,20 +1147,19 @@ def presence_ratio(spike_train, total_length, bin_edges=None, num_bin_edges=None
 
 
 def isi_violations(spike_trains, total_duration_s, isi_threshold_s=0.0015, min_isi_s=0):
-    """
-    Calculate Inter-Spike Interval (ISI) violations.
+    """Calculate Inter-Spike Interval (ISI) violations.
 
     See compute_isi_violations for additional documentation
 
     Parameters
     ----------
     spike_trains : list of np.ndarrays
-        The spike times for each recording segment for one unit, in seconds.
+        The spike times for each recording segment for one unit, in seconds
     total_duration_s : float
-        The total duration of the recording (in seconds).
+        The total duration of the recording (in seconds)
     isi_threshold_s : float, default: 0.0015
         Threshold for classifying adjacent spikes as an ISI violation, in seconds.
-        This is the biophysical refractory period.
+        This is the biophysical refractory period
     min_isi_s : float, default: 0
         Minimum possible inter-spike interval, in seconds.
         This is the artificial refractory period enforced
@@ -1185,12 +1168,12 @@ def isi_violations(spike_trains, total_duration_s, isi_threshold_s=0.0015, min_i
     Returns
     -------
     isi_violations_ratio : float
-        The isi violation ratio described in [1].
+        The isi violation ratio described in [1]
     isi_violations_rate : float
         Rate of contaminating spikes as a fraction of overall rate.
         Higher values indicate more contamination.
     isi_violation_count : int
-        Number of violations.
+        Number of violations
     """
 
     num_violations = 0
@@ -1218,8 +1201,8 @@ def isi_violations(spike_trains, total_duration_s, isi_threshold_s=0.0015, min_i
 
 
 def amplitude_cutoff(amplitudes, num_histogram_bins=500, histogram_smoothing_value=3, amplitudes_bins_min_ratio=5):
-    """
-    Calculate approximate fraction of spikes missing from a distribution of amplitudes.
+    """Calculate approximate fraction of spikes missing from a distribution of amplitudes.
+
 
     See compute_amplitude_cutoffs for additional documentation
 
@@ -1227,6 +1210,8 @@ def amplitude_cutoff(amplitudes, num_histogram_bins=500, histogram_smoothing_val
     ----------
     amplitudes : ndarray_like
         The amplitudes (in uV) of the spikes for one unit.
+    peak_sign : "neg" | "pos" | "both", default: "neg"
+        The sign of the template to compute best channels.
     num_histogram_bins : int, default: 500
         The number of bins to use to compute the amplitude histogram.
     histogram_smoothing_value : int, default: 3
@@ -1290,21 +1275,21 @@ def slidingRP_violations(
     Parameters
     ----------
     spike_samples : ndarray_like or list (for multi-segment)
-        The spike times in samples.
+        The spike times in samples
     sample_rate : float
-        The acquisition sampling rate.
+        The acquisition sampling rate
     bin_size_ms : float
         The size (in ms) of binning for the autocorrelogram.
     window_size_s : float, default: 1
-        Window in seconds to compute correlogram.
+        Window in seconds to compute correlogram
     exclude_ref_period_below_ms : float, default: 0.5
         Refractory periods below this value are excluded
     max_ref_period_ms : float, default: 10
-        Maximum refractory period to test in ms.
+        Maximum refractory period to test in ms
     contamination_values : 1d array or None, default: None
-        The contamination values to test, if None it is set to np.arange(0.5, 35, 0.5) / 100.
+        The contamination values to test, if None it is set to np.arange(0.5, 35, 0.5) / 100
     return_conf_matrix : bool, default: False
-        If True, the confidence matrix (n_contaminations, n_ref_periods) is returned.
+        If True, the confidence matrix (n_contaminations, n_ref_periods) is returned
 
     Code adapted from:
     https://github.com/SteinmetzLab/slidingRefractory/blob/master/python/slidingRP/metrics.py#L166
@@ -1312,7 +1297,7 @@ def slidingRP_violations(
     Returns
     -------
     min_cont_with_90_confidence : dict of floats
-        The minimum contamination with confidence > 90%.
+        The minimum contamination with confidence > 90%
     """
     if contamination_values is None:
         contamination_values = np.arange(0.5, 35, 0.5) / 100  # vector of contamination values to test
@@ -1427,13 +1412,13 @@ def compute_sd_ratio(
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     censored_period_ms : float, default: 4.0
         The censored period in milliseconds. This is to remove any potential bursts that could affect the SD.
-    correct_for_drift : bool, default: True
+    correct_for_drift: bool, default: True
         If True, will subtract the amplitudes sequentiially to significantly reduce the impact of drift.
-    correct_for_template_itself : bool, default:  True
+    correct_for_template_itself: bool, default:  True
         If true, will take into account that the template itself impacts the standard deviation of the noise,
         and will make a rough estimation of what that impact is (and remove it).
     unit_ids : list or None, default: None
diff --git a/src/spikeinterface/qualitymetrics/pca_metrics.py b/src/spikeinterface/qualitymetrics/pca_metrics.py
index bfeb514ac..ac8e486b1 100644
--- a/src/spikeinterface/qualitymetrics/pca_metrics.py
+++ b/src/spikeinterface/qualitymetrics/pca_metrics.py
@@ -57,22 +57,15 @@ def get_quality_pca_metric_list():
     return deepcopy(_possible_pc_metric_names)
 
 
-def compute_pc_metrics(
-    sorting_analyzer,
-    metric_names=None,
-    qm_params=None,
-    unit_ids=None,
-    seed=None,
-    n_jobs=1,
-    progress_bar=False,
+def calculate_pc_metrics(
+    sorting_analyzer, metric_names=None, qm_params=None, unit_ids=None, seed=None, n_jobs=1, progress_bar=False
 ):
-    """
-    Calculate principal component derived metrics.
+    """Calculate principal component derived metrics.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     metric_names : list of str, default: None
         The list of PC metrics to compute.
         If not provided, defaults to all PC metrics.
@@ -187,35 +180,12 @@ def compute_pc_metrics(
     return pc_metrics
 
 
-def calculate_pc_metrics(
-    sorting_analyzer, metric_names=None, qm_params=None, unit_ids=None, seed=None, n_jobs=1, progress_bar=False
-):
-    warnings.warn(
-        "The `calculate_pc_metrics` function is deprecated and will be removed in 0.103.0. Please use compute_pc_metrics instead",
-        category=DeprecationWarning,
-        stacklevel=2,
-    )
-
-    pc_metrics = compute_pc_metrics(
-        sorting_analyzer,
-        metric_names=metric_names,
-        qm_params=qm_params,
-        unit_ids=unit_ids,
-        seed=seed,
-        n_jobs=n_jobs,
-        progress_bar=progress_bar,
-    )
-
-    return pc_metrics
-
-
 #################################################################
 # Code from spikemetrics
 
 
 def mahalanobis_metrics(all_pcs, all_labels, this_unit_id):
-    """
-    Calculate isolation distance and L-ratio (metrics computed from Mahalanobis distance).
+    """Calculates isolation distance and L-ratio (metrics computed from Mahalanobis distance)
 
     Parameters
     ----------
@@ -270,8 +240,7 @@ def mahalanobis_metrics(all_pcs, all_labels, this_unit_id):
 
 
 def lda_metrics(all_pcs, all_labels, this_unit_id):
-    """
-    Calculate d-prime based on Linear Discriminant Analysis.
+    """Calculates d-prime based on Linear Discriminant Analysis.
 
     Parameters
     ----------
@@ -313,7 +282,7 @@ def lda_metrics(all_pcs, all_labels, this_unit_id):
 
 def nearest_neighbors_metrics(all_pcs, all_labels, this_unit_id, max_spikes, n_neighbors):
     """
-    Calculate unit contamination based on NearestNeighbors search in PCA space.
+    Calculates unit contamination based on NearestNeighbors search in PCA space.
 
     Parameters
     ----------
@@ -396,19 +365,18 @@ def nearest_neighbors_isolation(
     min_spatial_overlap: float = 0.5,
     seed=None,
 ):
-    """
-    Calculate unit isolation based on NearestNeighbors search in PCA space.
+    """Calculates unit isolation based on NearestNeighbors search in PCA space.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     this_unit_id : int | str
         The ID for the unit to calculate these metrics for.
-    n_spikes_all_units : dict, default: None
+    n_spikes_all_units: dict, default: None
         Dictionary of the form ``{<unit_id>: <n_spikes>}`` for the waveform extractor.
         Recomputed if None.
-    fr_all_units : dict, default: None
+    fr_all_units: dict, default: None
         Dictionary of the form ``{<unit_id>: <firing_rate>}`` for the waveform extractor.
         Recomputed if None.
     max_spikes : int, default: 1000
@@ -427,12 +395,12 @@ def nearest_neighbors_isolation(
         The number of PC components to use to project the snippets to.
     radius_um : float, default: 100
         The radius, in um, that channels need to be within the peak channel to be included.
-    peak_sign : "neg" | "pos" | "both", default: "neg"
+    peak_sign: "neg" | "pos" | "both", default: "neg"
         The peak_sign used to compute sparsity and neighbor units. Used if sorting_analyzer
         is not sparse already.
     min_spatial_overlap : float, default: 100
         In case sorting_analyzer is sparse, other units are selected if they share at least
-        `min_spatial_overlap` times `n_target_unit_channels` with the target unit.
+        `min_spatial_overlap` times `n_target_unit_channels` with the target unit
     seed : int, default: None
         Seed for random subsampling of spikes.
 
@@ -442,7 +410,7 @@ def nearest_neighbors_isolation(
         The calculation nearest neighbor isolation metric for `this_unit_id`.
         If the unit has fewer than `min_spikes`, returns numpy.NaN instead.
     nn_unit_id : np.int16
-        Id of the "nearest neighbor" unit (unit with lowest isolation score from `this_unit_id`).
+        Id of the "nearest neighbor" unit (unit with lowest isolation score from `this_unit_id`)
 
     Notes
     -----
@@ -610,19 +578,18 @@ def nearest_neighbors_noise_overlap(
     peak_sign: str = "neg",
     seed=None,
 ):
-    """
-    Calculate unit noise overlap based on NearestNeighbors search in PCA space.
+    """Calculates unit noise overlap based on NearestNeighbors search in PCA space.
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     this_unit_id : int | str
         The ID of the unit to calculate this metric on.
-    n_spikes_all_units : dict, default: None
+    n_spikes_all_units: dict, default: None
         Dictionary of the form ``{<unit_id>: <n_spikes>}`` for the waveform extractor.
         Recomputed if None.
-    fr_all_units : dict, default: None
+    fr_all_units: dict, default: None
         Dictionary of the form ``{<unit_id>: <firing_rate>}`` for the waveform extractor.
         Recomputed if None.
     max_spikes : int, default: 1000
@@ -639,7 +606,7 @@ def nearest_neighbors_noise_overlap(
         The number of PC components to use to project the snippets to.
     radius_um : float, default: 100
         The radius, in um, that channels need to be within the peak channel to be included.
-    peak_sign : "neg" | "pos" | "both", default: "neg"
+    peak_sign: "neg" | "pos" | "both", default: "neg"
         The peak_sign used to compute sparsity and neighbor units. Used if sorting_analyzer
         is not sparse already.
     seed : int, default: 0
@@ -773,8 +740,7 @@ def nearest_neighbors_noise_overlap(
 
 
 def simplified_silhouette_score(all_pcs, all_labels, this_unit_id):
-    """
-    Calculate the simplified silhouette score for each cluster. The value ranges
+    """Calculates the simplified silhouette score for each cluster. The value ranges
     from -1 (bad clustering) to 1 (good clustering). The simplified silhoutte score
     utilizes the centroids for distance calculations rather than pairwise calculations.
 
@@ -790,7 +756,7 @@ def simplified_silhouette_score(all_pcs, all_labels, this_unit_id):
     Returns
     -------
     unit_silhouette_score : float
-        Simplified Silhouette Score for this unit.
+        Simplified Silhouette Score for this unit
 
     References
     ----------
@@ -823,8 +789,7 @@ def simplified_silhouette_score(all_pcs, all_labels, this_unit_id):
 
 
 def silhouette_score(all_pcs, all_labels, this_unit_id):
-    """
-    Calculate the silhouette score which is a marker of cluster quality ranging from
+    """Calculates the silhouette score which is a marker of cluster quality ranging from
     -1 (bad clustering) to 1 (good clustering). Distances are all calculated as pairwise
     comparisons of all data points.
 
@@ -840,7 +805,7 @@ def silhouette_score(all_pcs, all_labels, this_unit_id):
     Returns
     -------
     unit_silhouette_score : float
-        Silhouette Score for this unit.
+        Silhouette Score for this unit
 
     References
     ----------
@@ -880,7 +845,7 @@ def _subtract_clip_component(clip1, component):
 
 def _compute_isolation(pcs_target_unit, pcs_other_unit, n_neighbors: int):
     """
-    Compute the isolation score used for nn_isolation and nn_noise_overlap.
+    Computes the isolation score used for nn_isolation and nn_noise_overlap
 
     Parameters
     ----------
diff --git a/src/spikeinterface/qualitymetrics/quality_metric_calculator.py b/src/spikeinterface/qualitymetrics/quality_metric_calculator.py
index 5a9191a25..1dab1c602 100644
--- a/src/spikeinterface/qualitymetrics/quality_metric_calculator.py
+++ b/src/spikeinterface/qualitymetrics/quality_metric_calculator.py
@@ -12,7 +12,7 @@ from spikeinterface.core.job_tools import fix_job_kwargs
 from spikeinterface.core.sortinganalyzer import register_result_extension, AnalyzerExtension
 
 
-from .quality_metric_list import compute_pc_metrics, _misc_metric_name_to_func, _possible_pc_metric_names
+from .quality_metric_list import calculate_pc_metrics, _misc_metric_name_to_func, _possible_pc_metric_names
 from .misc_metrics import _default_params as misc_metrics_params
 from .pca_metrics import _default_params as pca_metrics_params
 
@@ -23,8 +23,8 @@ class ComputeQualityMetrics(AnalyzerExtension):
 
     Parameters
     ----------
-    sorting_analyzer : SortingAnalyzer
-        A SortingAnalyzer object.
+    sorting_analyzer: SortingAnalyzer
+        A SortingAnalyzer object
     metric_names : list or None
         List of quality metrics to compute.
     qm_params : dict or None
@@ -36,7 +36,7 @@ class ComputeQualityMetrics(AnalyzerExtension):
     Returns
     -------
     metrics: pandas.DataFrame
-        Data frame with the computed metrics.
+        Data frame with the computed metrics
 
     Notes
     -----
@@ -143,7 +143,7 @@ class ComputeQualityMetrics(AnalyzerExtension):
         if len(pc_metric_names) > 0 and not self.params["skip_pc_metrics"]:
             if not self.sorting_analyzer.has_extension("principal_components"):
                 raise ValueError("waveform_principal_component must be provied")
-            pc_metrics = compute_pc_metrics(
+            pc_metrics = calculate_pc_metrics(
                 self.sorting_analyzer,
                 unit_ids=non_empty_unit_ids,
                 metric_names=pc_metric_names,
@@ -171,16 +171,13 @@ compute_quality_metrics = ComputeQualityMetrics.function_factory()
 
 
 def get_quality_metric_list():
-    """
-    Return a list of the available quality metrics.
-    """
+    """Get a list of the available quality metrics."""
 
     return deepcopy(list(_misc_metric_name_to_func.keys()))
 
 
 def get_default_qm_params():
-    """
-    Return default dictionary of quality metrics parameters.
+    """Return default dictionary of quality metrics parameters.
 
     Returns
     -------
diff --git a/src/spikeinterface/qualitymetrics/quality_metric_list.py b/src/spikeinterface/qualitymetrics/quality_metric_list.py
index 140ad87a8..a9d58d2a6 100644
--- a/src/spikeinterface/qualitymetrics/quality_metric_list.py
+++ b/src/spikeinterface/qualitymetrics/quality_metric_list.py
@@ -21,8 +21,7 @@ from .misc_metrics import (
 )
 
 from .pca_metrics import (
-    compute_pc_metrics,
-    calculate_pc_metrics,  # remove after 0.103.0
+    calculate_pc_metrics,
     mahalanobis_metrics,
     lda_metrics,
     nearest_neighbors_metrics,
diff --git a/src/spikeinterface/qualitymetrics/utils.py b/src/spikeinterface/qualitymetrics/utils.py
index 844a7da7f..0a267125b 100644
--- a/src/spikeinterface/qualitymetrics/utils.py
+++ b/src/spikeinterface/qualitymetrics/utils.py
@@ -4,23 +4,22 @@ import numpy as np
 
 
 def create_ground_truth_pc_distributions(center_locations, total_points):
-    """
-    Simulate PCs as multivariate Gaussians, for testing PC-based quality metrics
-    Values are created for only one channel and vary along one dimension.
+    """Simulate PCs as multivariate Gaussians, for testing PC-based quality metrics
+    Values are created for only one channel and vary along one dimension
 
     Parameters
     ----------
     center_locations : array-like (units, ) or (channels, units)
-        Mean of the multivariate gaussian at each channel for each unit.
+        Mean of the multivariate gaussian at each channel for each unit
     total_points : array-like
-        Number of points in each unit distribution.
+        Number of points in each unit distribution
 
     Returns
     -------
-    all_pcs : numpy.ndarray
-        PC scores for each point.
-    all_labels : numpy.array
-        Labels for each point.
+    numpy.ndarray
+        PC scores for each point
+    numpy.array
+        Labels for each point
     """
     from scipy.stats import multivariate_normal
 


Test patch:
diff --git a/src/spikeinterface/preprocessing/tests/test_zero_padding.py b/src/spikeinterface/preprocessing/tests/test_zero_padding.py
index 3ece8a0e0..954f5ed7e 100644
--- a/src/spikeinterface/preprocessing/tests/test_zero_padding.py
+++ b/src/spikeinterface/preprocessing/tests/test_zero_padding.py
@@ -53,7 +53,7 @@ def test_trace_padded_recording_full_trace(recording, padding_start, padding_end
     num_samples = recording.get_num_samples()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -81,7 +81,7 @@ def test_trace_padded_recording_full_trace_with_channel_indices(recording, paddi
     num_samples = recording.get_num_samples()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -110,7 +110,7 @@ def test_trace_padded_recording_retrieve_original_trace(recording, padding_start
     num_samples = recording.get_num_samples()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -129,7 +129,7 @@ def test_trace_padded_recording_retrieve_partial_original_trace(recording, paddi
     num_samples = recording.get_num_samples()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -156,7 +156,7 @@ def test_trace_padded_recording_retrieve_start_padding_and_partial_original_trac
     num_channels = recording.get_num_channels()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -188,7 +188,7 @@ def test_trace_padded_recording_retrieve_end_padding_and_partial_original_trace(
     num_channels = recording.get_num_channels()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -222,7 +222,7 @@ def test_trace_padded_recording_retrieve_traces_with_partial_padding(recording,
     num_channels = recording.get_num_channels()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -264,7 +264,7 @@ def test_trace_padded_recording_retrieve_only_start_padding(recording, padding_s
     num_channels = recording.get_num_channels()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -281,7 +281,7 @@ def test_trace_padded_recording_retrieve_only_end_padding(recording, padding_sta
     num_channels = recording.get_num_channels()
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
@@ -314,7 +314,7 @@ def test_trace_padded_recording_retrieve_only_end_padding_with_preprocessing(
         recording = phase_shift(recording)
 
     padded_recording = TracePaddedRecording(
-        recording=recording,
+        parent_recording=recording,
         padding_start=padding_start,
         padding_end=padding_end,
     )
diff --git a/src/spikeinterface/qualitymetrics/tests/test_pca_metrics.py b/src/spikeinterface/qualitymetrics/tests/test_pca_metrics.py
index 4e5a4858b..415166a54 100644
--- a/src/spikeinterface/qualitymetrics/tests/test_pca_metrics.py
+++ b/src/spikeinterface/qualitymetrics/tests/test_pca_metrics.py
@@ -8,7 +8,7 @@ from spikeinterface.core import (
 
 
 from spikeinterface.qualitymetrics import (
-    compute_pc_metrics,
+    calculate_pc_metrics,
     nearest_neighbors_isolation,
     nearest_neighbors_noise_overlap,
 )
@@ -51,10 +51,10 @@ def test_calculate_pc_metrics(sorting_analyzer_simple):
     import pandas as pd
 
     sorting_analyzer = sorting_analyzer_simple
-    res1 = compute_pc_metrics(sorting_analyzer, n_jobs=1, progress_bar=True)
+    res1 = calculate_pc_metrics(sorting_analyzer, n_jobs=1, progress_bar=True)
     res1 = pd.DataFrame(res1)
 
-    res2 = compute_pc_metrics(sorting_analyzer, n_jobs=2, progress_bar=True)
+    res2 = calculate_pc_metrics(sorting_analyzer, n_jobs=2, progress_bar=True)
     res2 = pd.DataFrame(res2)
 
     for k in res1.columns: