Moved files and reformatted some
This commit is contained in:
@ -8,7 +8,7 @@ from mdevaluate import utils
|
||||
@pytest.fixture
|
||||
def logdata(request):
|
||||
xdata = np.logspace(-1, 3, 50)
|
||||
ydata = np.exp(- (xdata)**0.7)
|
||||
ydata = np.exp(-((xdata) ** 0.7))
|
||||
return xdata, ydata
|
||||
|
||||
|
||||
@ -18,18 +18,18 @@ def test_filon_fourier_transformation(logdata):
|
||||
xdata_zero = copy(xdata)
|
||||
xdata_zero[0] = 0
|
||||
_, filon = utils.filon_fourier_transformation(xdata_zero, ydata)
|
||||
assert not np.isnan(filon).any(), 'There are NaN values in the filon result!'
|
||||
assert not np.isnan(filon).any(), "There are NaN values in the filon result!"
|
||||
|
||||
freqs = np.logspace(-4, 1)
|
||||
filon_freqs, filon_imag = utils.filon_fourier_transformation(
|
||||
xdata, xdata, frequencies=freqs, derivative='linear', imag=True
|
||||
)
|
||||
xdata, xdata, frequencies=freqs, derivative="linear", imag=True
|
||||
)
|
||||
|
||||
assert (freqs == filon_freqs).all()
|
||||
|
||||
freqs, filon_real = utils.filon_fourier_transformation(
|
||||
xdata, xdata, frequencies=freqs, derivative='linear', imag=False
|
||||
)
|
||||
xdata, xdata, frequencies=freqs, derivative="linear", imag=False
|
||||
)
|
||||
assert np.isclose(filon_imag.real, filon_real).all()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user