diff --git a/sumpy/toys.py b/sumpy/toys.py index c71f6107eafb8916228dd30451515a493d8d223f..41117eedb609621a79f65db40dab3d501e66a29f 100644 --- a/sumpy/toys.py +++ b/sumpy/toys.py @@ -389,9 +389,10 @@ def _m2l(psource, to_center, to_rscale, to_order, e2e, expn_class, expn_kwargs, src_rscale=np.float64(psource.rscale), **toy_ctx.extra_kernel_kwargs) + from sumpy.tools import (run_opencl_fft, get_opencl_fft_app, + get_native_event) + if toy_ctx.use_fft: - from sumpy.tools import (run_opencl_fft, get_opencl_fft_app, - get_native_event) fft_app = get_opencl_fft_app(queue, (expn_size,), dtype=preprocessed_src_expansions.dtype, inverse=False) ifft_app = get_opencl_fft_app(queue, (expn_size,), diff --git a/test/test_cse.py b/test/test_cse.py index 68352c9059e8587cd8c2da63a32075ef100841cc..e84548c7c48a5eef731ef077192c16b3c06b4021 100644 --- a/test/test_cse.py +++ b/test/test_cse.py @@ -142,8 +142,8 @@ def test_cse_not_possible(): assert substs == [] assert reduced == [x + y] # issue 6329 - eq = (meijerg((1, 2), (y, 4), (5,), [], x) - + meijerg((1, 3), (y, 4), (5,), [], x)) + eq = (meijerg((1, 2), (y, 4), (5,), [], x) # pylint: disable=possibly-used-before-assignment # noqa: E501 + + meijerg((1, 3), (y, 4), (5,), [], x)) # pylint: disable=possibly-used-before-assignment # noqa: E501 assert cse(eq) == ([], [eq]) # }}} @@ -168,7 +168,7 @@ def test_subtraction_opt(): # Make sure subtraction is optimized. e = (x - y)*(z - y) + sym.exp((x - y)*(z - y)) substs, reduced = cse( - [e], optimizations=[(cse_opts.sub_pre, cse_opts.sub_post)]) + [e], optimizations=[(cse_opts.sub_pre, cse_opts.sub_post)]) # pylint: disable=possibly-used-before-assignment # noqa: E501 assert substs == [(x0, (x - y)*(y - z))] assert reduced == [-x0 + sym.exp(-x0)] e = -(x - y)*(z - y) + sym.exp(-(x - y)*(z - y)) @@ -179,8 +179,9 @@ def test_subtraction_opt(): # issue 4077 n = -1 + 1/x e = n/x/(-n)**2 - 1/n/x - assert cse(e, optimizations=[(cse_opts.sub_pre, cse_opts.sub_post)]) == \ - ([], [0]) + assert cse(e, optimizations=[ + (cse_opts.sub_pre, cse_opts.sub_post)] # pylint: disable=possibly-used-before-assignment # noqa: E501 + ) == ([], [0]) # }}} @@ -331,7 +332,7 @@ def test_issue_6169(): assert cse(r) == ([], [r]) # and a check that the right thing is done with the new # mechanism - assert sub_post(sub_pre((-x - y)*z - x - y)) == -z*(x + y) - x - y + assert sub_post(sub_pre((-x - y)*z - x - y)) == -z*(x + y) - x - y # pylint: disable=possibly-used-before-assignment # noqa: E501 # }}}