Moved files and reformatted some

This commit is contained in:
2023-12-18 14:47:22 +01:00
parent b4486ff265
commit 62705da6f3
23 changed files with 50 additions and 47 deletions

View File

@ -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()