From 6d507e189838e5657535851852461bc497c71933 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Fri, 6 Sep 2024 16:09:58 -0500 Subject: [PATCH] ruff --- arraycontext/__init__.py | 2 +- arraycontext/impl/cupy/fake_numpy.py | 4 ++-- arraycontext/pytest.py | 2 +- test/test_arraycontext.py | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arraycontext/__init__.py b/arraycontext/__init__.py index 22b6dd0d..fb13b2d1 100644 --- a/arraycontext/__init__.py +++ b/arraycontext/__init__.py @@ -105,8 +105,8 @@ "ArrayOrContainerOrScalarT", "ArrayOrContainerT", "ArrayT", - "CupyArrayContext", "CommonSubexpressionTag", + "CupyArrayContext", "EagerJAXArrayContext", "ElementwiseMapKernelTag", "NotAnArrayContainerError", diff --git a/arraycontext/impl/cupy/fake_numpy.py b/arraycontext/impl/cupy/fake_numpy.py index 87aa9a21..6bf40a00 100644 --- a/arraycontext/impl/cupy/fake_numpy.py +++ b/arraycontext/impl/cupy/fake_numpy.py @@ -160,13 +160,13 @@ def linspace(self, *args, **kwargs): def zeros_like(self, ary): if isinstance(ary, (int, float, complex)): # Cupy does not support zeros_like with scalar arguments - ary=cp.array(ary) + ary = cp.array(ary) return rec_map_array_container(cp.zeros_like, ary) def ones_like(self, ary): if isinstance(ary, (int, float, complex)): # Cupy does not support ones_like with scalar arguments - ary=cp.array(ary) + ary = cp.array(ary) return rec_map_array_container(cp.ones_like, ary) def reshape(self, a, newshape, order="C"): diff --git a/arraycontext/pytest.py b/arraycontext/pytest.py index e4552250..38ce8d2f 100644 --- a/arraycontext/pytest.py +++ b/arraycontext/pytest.py @@ -243,7 +243,7 @@ def __str__(self): name = d["name"].decode("utf-8") return f" on {cupy.cuda.Device()}:{name}" - + # {{{ _PytestArrayContextFactory class _NumpyArrayContextForTests(NumpyArrayContext): diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index 16571372..b462a33c 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -1298,7 +1298,6 @@ def test_actx_compile_kwargs(actx_factory): rng = np.random.default_rng() - compiled_rhs = actx.compile(scale_and_orthogonalize) v_x = rng.uniform(size=10)