diff --git a/tests/test_dynamic_delay_dask.py b/tests/test_dynamic_delay_dask.py index 0dace5533845365c29911496d89781148a72e84e..466a9e0aa6497510aba232a24300223478424b45 100644 --- a/tests/test_dynamic_delay_dask.py +++ b/tests/test_dynamic_delay_dask.py @@ -32,7 +32,7 @@ def test_dynamic_shift_linear_dask() -> None: ) op_np = numpyfy_dask_multi(op_da, chunks=19) - s_da = op_np(y, d) + s_da = op_np(y, -d) s_ex = g(np.maximum(t[0], t - d * dt)) assert s_ex == pytest.approx(s_da, abs=1e-15, rel=1e-14) @@ -63,7 +63,7 @@ def test_dynamic_shift_lagrange_dask() -> None: ) op_na = numpyfy_dask_multi(op_da, chunks=19) - s_da: np.ndarray = op_na(y, d) + s_da: np.ndarray = op_na(y, -d) s_ex = g(np.maximum(t[0], t - d * dt)) assert s_ex[op_da.margin_left :] == pytest.approx( @@ -74,7 +74,7 @@ def test_dynamic_shift_lagrange_dask() -> None: length, d.min(), d.max(), DynShiftBC.FLAT, DynShiftBC.EXCEPTION ) - s_np = op_np(y, d) + s_np = op_np(y, -d) assert np.all(s_np == s_da) diff --git a/tests/test_dynamic_delay_dsp.py b/tests/test_dynamic_delay_dsp.py index e1332cc605cea5c6679278f0a53d65ae5f13ac92..08eaec3803f06d402ba2171c93c4d378ca6cd08c 100644 --- a/tests/test_dynamic_delay_dsp.py +++ b/tests/test_dynamic_delay_dsp.py @@ -49,7 +49,7 @@ def test_dynamic_shift_dsp_dask() -> None: ) op_na = numpyfy_dask_multi(op_da, chunks=19) - s_da = op_na(y, d) + s_da = op_na(y, -d) s_ex = g(np.maximum(t[0], t - d * dt)) assert s_ex[op_da.margin_left :] == pytest.approx( @@ -60,7 +60,7 @@ def test_dynamic_shift_dsp_dask() -> None: order, d.min(), d.max(), DynShiftBC.FLAT, DynShiftBC.EXCEPTION ) - s_np = op_np(y, d) + s_np = op_np(y, -d) assert np.all(s_np == s_da) @@ -82,14 +82,14 @@ def test_dynamic_shift_dsp_dask_orders() -> None: ) op1_na = numpyfy_dask_multi(op1_da, chunks=19) - s1_na = op1_na(y, d) + s1_na = op1_na(y, -d) op2_da = make_dynamic_shift_lagrange_dask( length, d.min(), d.max(), DynShiftBC.FLAT, DynShiftBC.EXCEPTION ) op2_na = numpyfy_dask_multi(op2_da, chunks=19) - s2_na = op2_na(y, d) + s2_na = op2_na(y, -d) assert s1_na == pytest.approx(s2_na, abs=0, rel=5e-15) @@ -120,13 +120,13 @@ def test_fixed_shift_dsp_dask() -> None: ) op2_na = numpyfy_dask_multi(op2_da, chunks=113) - s1_na = op1_na(y, d) - s2_na = op2_na(y, d) + s1_na = op1_na(y, -d) + s2_na = op2_na(y, -d) assert s1_na == pytest.approx(s2_na, rel=1e-14, abs=0) with pytest.raises(RuntimeError): - op2_na(y, -d) + op2_na(y, d) op3_da = make_fixed_shift_lagrange_dask( DynShiftBC.EXCEPTION, DynShiftBC.FLAT, length @@ -138,10 +138,10 @@ def test_fixed_shift_dsp_dask() -> None: ) op4_na = numpyfy_dask_multi(op4_da, chunks=113) - s3_na = op3_na(y, -d) - s4_na = op4_na(y, -d) + s3_na = op3_na(y, d) + s4_na = op4_na(y, d) assert s3_na == pytest.approx(s4_na, rel=1e-14, abs=0) with pytest.raises(RuntimeError): - op4_na(y, d) + op4_na(y, -d) diff --git a/tests/test_fixed_shift_dask.py b/tests/test_fixed_shift_dask.py index 3bd8072eefb5640aee2d5946b55974742fc9f246..8ed02ab62da1ee1fbe34e77450e236bb60b980d0 100644 --- a/tests/test_fixed_shift_dask.py +++ b/tests/test_fixed_shift_dask.py @@ -48,8 +48,8 @@ def test_fixed_shift_lagrange_dask() -> None: ) op_na = numpyfy_dask_multi(op_da, chunks=113) - s_np = op_np(y, d) - s_na = op_na(y, d) + s_np = op_np(y, -d) + s_na = op_na(y, -d) s_ex = g(t - d * dt) margin_ex = -int(np.floor(-d)) + order // 2 @@ -58,7 +58,7 @@ def test_fixed_shift_lagrange_dask() -> None: assert s_ex[margin_ex:] == pytest.approx(s_na[margin_ex:], abs=1e-15, rel=5e-13) with pytest.raises(RuntimeError): - op_na(y, -d) + op_na(y, d) op2_np = make_fixed_shift_lagrange_numpy( DynShiftBC.EXCEPTION, DynShiftBC.FLAT, length @@ -68,8 +68,8 @@ def test_fixed_shift_lagrange_dask() -> None: ) op2_na = numpyfy_dask_multi(op2_da, chunks=113) - s2_np = op2_np(y, -d) - s2_na = op2_na(y, -d) + s2_np = op2_np(y, d) + s2_na = op2_na(y, d) s2_ex = g(t + d * dt) margin2_ex = int(np.floor(d)) + (length - 1 - order // 2) @@ -80,17 +80,17 @@ def test_fixed_shift_lagrange_dask() -> None: ) with pytest.raises(RuntimeError): - op2_na(y, d) + op2_na(y, -d) op3_da = make_fixed_shift_lagrange_dask( DynShiftBC.FLAT, DynShiftBC.FLAT, length ) op3_na = numpyfy_dask_multi(op3_da, chunks=113) - s3_na = op3_na(y, d) + s3_na = op3_na(y, -d) assert s3_na == pytest.approx(s_np, rel=1e-14, abs=0) - s4_na = op3_na(y, -d) + s4_na = op3_na(y, d) assert s4_na == pytest.approx(s2_np, rel=1e-14, abs=0) @@ -119,7 +119,7 @@ def test_shift_lagrange_dask_fixed_vs_dyn() -> None: ) op2_na = numpyfy_dask_multi(op2_da, chunks=113) - s1_np = op1_na(y, d1d) - s2_np = op2_na(y, d) + s1_np = op1_na(y, -d1d) + s2_np = op2_na(y, -d) assert s1_np == pytest.approx(s2_np, rel=1e-14, abs=0) diff --git a/tests/test_fixed_shift_numpy.py b/tests/test_fixed_shift_numpy.py index bfa90fc9acc154677b4e77e0378f27d9b65ae7dc..c7afb87ec50c1babcc39c8cd188a790947f415f2 100644 --- a/tests/test_fixed_shift_numpy.py +++ b/tests/test_fixed_shift_numpy.py @@ -30,7 +30,7 @@ def test_fixed_shift_lagrange_dask() -> None: DynShiftBC.FLAT, DynShiftBC.EXCEPTION, length ) - s_np = op_np(y, d) + s_np = op_np(y, -d) s_ex = g(t - d * dt) margin_ex = -int(np.floor(-d)) + order // 2 @@ -42,13 +42,13 @@ def test_fixed_shift_lagrange_dask() -> None: # ~ assert np.min(np.abs(s_ex[:margin_ex] - s_np[:margin_ex])) > np.max(np.abs(y[:margin_ex]))*1e-10 with pytest.raises(RuntimeError): - op_np(y, -d) + op_np(y, d) op2_np = make_fixed_shift_lagrange_numpy( DynShiftBC.EXCEPTION, DynShiftBC.FLAT, length ) - s2_np = op2_np(y, -d) + s2_np = op2_np(y, d) s2_ex = g(t + d * dt) margin2_ex = int(np.floor(d)) + (length - 1 - order // 2) @@ -59,4 +59,4 @@ def test_fixed_shift_lagrange_dask() -> None: # ~ assert np.min(np.abs(s2_ex[-margin2_ex:] - s2_np[-margin2_ex:])) > np.max(np.abs(y[-margin2_ex:]))*1e-10 with pytest.raises(RuntimeError): - op2_np(y, d) + op2_np(y, -d)