-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
electricpy.math.rfft() calls filter.dnsample(...), but the module does not import or define filter, so the function raises a NameError whenever resample is truthy or numeric.
This is visible directly in the module code where filter.dnsample is referenced without any filter import/definition.
https://electricpy.readthedocs.io/en/latest/_modules/electricpy/math.html
Reproduction Code
# Setup
import numpy as np
import electricpy as ep
# Code which causes failure
x = np.sin(2*np.pi*5*np.linspace(0, 1, 1000, endpoint=False))
ep.math.rfft(x, dt=0.001, resample=True) # triggers filter.dnsample(...)Expected behavior
Return the FFT array (optionally downsampled) without raising a NameError.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. Linux]
- Python Version: 3.11.6
- Version: 0.4.0
Additional context
The error occurs because filter is never imported/defined in electricpy.math even though it’s used inside rfft.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working