Skip to content
Snippets Groups Projects

More cleanup of `general_` functions

Merged Peter Bell requested to merge general_cleanup into cleanup2
1 file
+ 11
2
Compare changes
  • Side-by-side
  • Inline
+ 11
2
@@ -58,9 +58,18 @@ def irfft_scipy(a, axis, inorm=0, out=None, nthreads=1):
tol = {np.float32: 6e-7, np.float64: 1.5e-15, np.longfloat: 1e-18}
ctype = {np.float32: np.complex64, np.float64: np.complex128, np.longfloat: np.longcomplex}
import platform
on_wsl = "microsoft" in platform.uname()[3].lower()
true_long_double = (np.longfloat != np.float64 and not on_wsl)
dtypes = [np.float32, np.float64,
pytest.param(np.longfloat, marks=pytest.mark.xfail(
not true_long_double,
reason="Long double doesn't offer more precision"))]
@pmp("len", len1D)
@pmp("inorm", [0, 1, 2])
@pmp("dtype", [np.float32, np.float64, np.longfloat])
@pmp("dtype", dtypes)
def test1D(len, inorm, dtype):
a = np.random.rand(len)-0.5 + 1j*np.random.rand(len)-0.5j
a = a.astype(ctype[dtype])
@@ -199,7 +208,7 @@ def test_genuine_hartley_2D(shp, axes):
@pmp("len", len1D)
@pmp("inorm", [0, 1]) # inorm==2 not needed, tested via inverse
@pmp("type", [1, 2, 3, 4])
@pmp("dtype", [np.float32, np.float64, np.longfloat])
@pmp("dtype", dtypes)
def testdcst1D(len, inorm, type, dtype):
a = (np.random.rand(len)-0.5).astype(dtype)
eps = tol[dtype]
Loading