Skip to content

Commit

Permalink
Fix RUF052 and RUF046 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Dec 15, 2024
1 parent 9e3c6c2 commit 977da07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyopencl/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@ def arange(queue, *args, **kwargs):
raise TypeError("arange requires a dtype argument")

from math import ceil
size = int(ceil((stop-start)/step))
size = ceil((stop-start)/step)

result = Array(queue, (size,), dtype, allocator=inf.allocator)
result.add_event(_arange_knl(result, start, step, queue=queue))
Expand Down
4 changes: 2 additions & 2 deletions pyopencl/cltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# {{{ vector types

def _create_vector_types():
_mapping = [(k, globals()[k]) for k in
mapping = [(k, globals()[k]) for k in
["char", "uchar", "short", "ushort", "int",
"uint", "long", "ulong", "float", "double"]]

Expand All @@ -64,7 +64,7 @@ def set_global(key, val):

counts = [2, 3, 4, 8, 16]

for base_name, base_type in _mapping:
for base_name, base_type in mapping:
for count in counts:
name = "%s%d" % (base_name, count)

Expand Down

0 comments on commit 977da07

Please sign in to comment.