From acd2b2dc0e545f0253f3320c76e31d9d3a4a3b53 Mon Sep 17 00:00:00 2001 From: Matt Wala <wala1@illinois.edu> Date: Sat, 26 Jan 2019 18:10:12 -0600 Subject: [PATCH] More Pylint changes --- pyopencl/array.py | 2 ++ pyopencl/cache.py | 2 +- pyopencl/clmath.py | 3 +++ test/test_array.py | 4 ++-- test/test_wrapper.py | 5 ++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pyopencl/array.py b/pyopencl/array.py index 9d1b66b9..1bfdc137 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -1,5 +1,7 @@ """CL device arrays.""" +# pylint:disable=unexpected-keyword-arg # for @elwise_kernel_runner + from __future__ import division, absolute_import __copyright__ = "Copyright (C) 2009 Andreas Kloeckner" diff --git a/pyopencl/cache.py b/pyopencl/cache.py index 3e4bc65d..fd46dc5c 100644 --- a/pyopencl/cache.py +++ b/pyopencl/cache.py @@ -482,7 +482,7 @@ def create_built_program_from_source_cached(ctx, src, options_bytes, devices=Non except Exception as e: from pyopencl import Error if (isinstance(e, Error) - and e.code == _cl.status_code.BUILD_PROGRAM_FAILURE): + and e.code == _cl.status_code.BUILD_PROGRAM_FAILURE): # noqa pylint:disable=no-member # no need to try again raise diff --git a/pyopencl/clmath.py b/pyopencl/clmath.py index 6d45fe44..2ae8bfbf 100644 --- a/pyopencl/clmath.py +++ b/pyopencl/clmath.py @@ -1,4 +1,7 @@ from __future__ import absolute_import + +# pylint:disable=unexpected-keyword-arg # for @elwise_kernel_runner + __copyright__ = "Copyright (C) 2009 Andreas Kloeckner" __license__ = """ diff --git a/test/test_array.py b/test/test_array.py index d7274c68..811969a6 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -571,7 +571,7 @@ def test_bitwise(ctx_factory): # Test unary ~ res_dev = ~a_dev - res = ~a + res = ~a # pylint:disable=invalid-unary-operand-type assert (res_dev.get() == res).all() # }}} @@ -1072,7 +1072,7 @@ def test_skip_slicing(ctx_factory): a = cl_array.to_device(queue, a_host) b = a[::3] assert b.shape == b_host.shape - assert np.array_equal(b[1].get(), b_host[1]) + assert np.array_equal(b[1].get(), b_host[1]) # pylint:disable=unsubscriptable-object def test_transpose(ctx_factory): diff --git a/test/test_wrapper.py b/test/test_wrapper.py index fba8ceb9..ee3219e9 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -120,8 +120,7 @@ def test_get_info(ctx_factory): def do_test(cl_obj, info_cls, func=None, try_attr_form=True): if func is None: - def func(info): - cl_obj.get_info(info) + func = cl_obj.get_info for info_name in dir(info_cls): if not info_name.startswith("_") and info_name != "to_string": @@ -1030,7 +1029,7 @@ def test_fine_grain_svm(ctx_factory): @pytest.mark.parametrize("dtype", [ np.uint, - cl.cltypes.uint2, + cltypes.uint2, ]) def test_map_dtype(ctx_factory, dtype): if cl._PYPY: -- GitLab