Skip to content

Commit

Permalink
Update prehooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Oct 21, 2024
1 parent 9d40d10 commit 0c0a9bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ repos:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
- id: poetry-install
- id: poetry-install
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
12 changes: 4 additions & 8 deletions pydevtips/fftconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ def __init__(self, filt, length) -> None:
Length of the signal to convolve with.
"""

assert isinstance(filt,
np.ndarray)
assert isinstance(filt, np.ndarray)
self.filter = filt
self.signal_length = length
self.pad_length = len(filt
) + length - 1
self.pad_length = len(filt) + length - 1
self.filter_frequency_response = self._compute_filter_frequency_response()

@abstractmethod
Expand All @@ -43,17 +41,15 @@ def _compute_filter_frequency_response(self) -> np.ndarray:
raise NotImplementedError

@abstractmethod
def __call__(self,
signal) -> np.ndarray:
def __call__(self, signal) -> np.ndarray:
"""Apply the filter to the signal, in the frequency domain."""
pass


class RFFTConvolve(FFTConvolveBase):
"""Real FFT convolve."""

def __init__(self, filt,
length) -> None:
def __init__(self, filt, length) -> None:
"""
Create convolver that uses a real-valued filter.
Expand Down

0 comments on commit 0c0a9bc

Please sign in to comment.