Skip to content

Commit 4934fde

Browse files
committed
Switch to ruff:ignore
1 parent 646ca07 commit 4934fde

15 files changed

Lines changed: 56 additions & 56 deletions

examples/cai_cupy_arrays.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import cupy as cp
66

7-
import pycuda.autoinit # noqa
7+
import pycuda.autoinit # ruff:ignore[unused-import]
88
from pycuda.compiler import SourceModule
99

1010

examples/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import numpy
55

6-
import pycuda.autoinit # noqa
6+
import pycuda.autoinit # ruff:ignore[unused-import]
77
import pycuda.driver as cuda
88
from pycuda.compiler import SourceModule
99

pycuda/_mymako.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
try:
5-
import mako.template # noqa: F401
5+
import mako.template # ruff:ignore[unused-import]
66
except ImportError:
77
raise ImportError(
88
"Some of PyCUDA's facilities require the Mako templating engine.\n"
@@ -16,4 +16,4 @@
1616
)
1717

1818

19-
from mako import * # noqa: F403
19+
from mako import * # ruff:ignore[undefined-local-with-import-star]

pycuda/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def compile_plain(source, options, keep, nvcc, cache_dir, target="cubin"):
130130
)
131131

132132
try:
133-
result_f = open(join(file_dir, file_root + "." + target), "rb") # noqa: SIM115
133+
result_f = open(join(file_dir, file_root + "." + target), "rb") # ruff:ignore[open-file-with-context-handler]
134134
except OSError:
135135
no_output = True
136136
else:

pycuda/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
sys.argv = args
2828

2929
with open(mainpyfile) as mainpy:
30-
exec(compile(mainpy.read(), mainpyfile, "exec")) # noqa: S102
30+
exec(compile(mainpy.read(), mainpyfile, "exec")) # ruff:ignore[exec-builtin]

pycuda/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _add_cuda_libdir_to_dll_path():
6060

6161

6262
try:
63-
os.add_dll_directory # noqa: B018
63+
os.add_dll_directory # ruff:ignore[useless-expression]
6464
except AttributeError:
6565
# likely not on Py3.8 and Windows
6666
# https://github.com/inducer/pycuda/issues/213
@@ -72,7 +72,7 @@ def _add_cuda_libdir_to_dll_path():
7272

7373

7474
try:
75-
from pycuda._driver import * # noqa
75+
from pycuda._driver import * # ruff:ignore[undefined-local-with-import-star]
7676
except ImportError as e:
7777
if "_v2" in str(e):
7878
from warnings import warn
@@ -865,7 +865,7 @@ def matrix_to_array(matrix, order, allow_double_hack=False):
865865
return ary
866866

867867

868-
def np_to_array(nparray, order, allowSurfaceBind=False): # noqa: N803
868+
def np_to_array(nparray, order, allowSurfaceBind=False): # ruff:ignore[invalid-argument-name]
869869
case = order in ["C", "F"]
870870
if not case:
871871
raise LogicError("order must be either F or C")
@@ -946,7 +946,7 @@ def np_to_array(nparray, order, allowSurfaceBind=False): # noqa: N803
946946
return cudaArray
947947

948948

949-
def gpuarray_to_array(gpuarray, order, allowSurfaceBind=False): # noqa: N803
949+
def gpuarray_to_array(gpuarray, order, allowSurfaceBind=False): # ruff:ignore[invalid-argument-name]
950950
case = order in ["C", "F"]
951951
if not case:
952952
raise LogicError("order must be either F or C")

pycuda/gpuarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _get_broadcasted_binary_op_result(obj1, obj2,
4545
# {{{ vector types
4646

4747

48-
class vec: # noqa
48+
class vec: # ruff:ignore[invalid-class-name]
4949
pass
5050

5151

@@ -1077,7 +1077,7 @@ def transpose(self, axes=None):
10771077
)
10781078

10791079
@property
1080-
def T(self): # noqa
1080+
def T(self): # ruff:ignore[invalid-function-name]
10811081
"""
10821082
.. versionadded:: 2015.2
10831083
"""

pycuda/reduction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def __init__(
262262
)
263263

264264
def __call__(self, *args, **kwargs):
265-
MAX_BLOCK_COUNT = 1024 # noqa: N806
266-
SMALL_SEQ_COUNT = 4 # noqa: N806
265+
MAX_BLOCK_COUNT = 1024 # ruff:ignore[non-lowercase-variable-in-function]
266+
SMALL_SEQ_COUNT = 4 # ruff:ignore[non-lowercase-variable-in-function]
267267

268268
s1_func = self.stage1_func
269269
s2_func = self.stage2_func

pycuda/sparse/pkt_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ def build_pkt_data_structure(
7777
else:
7878
pyximport.install()
7979
from pycuda.sparse.pkt_build_cython import (
80-
build_pkt_data_structure, # noqa: F401
80+
build_pkt_data_structure, # ruff:ignore[unused-import]
8181
)

0 commit comments

Comments
 (0)