Skip to content

Commit

Permalink
ruff: fix C409 rule issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Aug 11, 2024
1 parent eccf7a8 commit 104937c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contrib/fortran-to-opencl/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ def map_Equivalence(self, node):
def dtype_from_stmt(self, stmt):
length, kind = stmt.selector
assert not kind
return np.dtype(self.TYPE_MAP[(type(stmt).__name__.lower(), length)])
return np.dtype(self.TYPE_MAP[type(stmt).__name__.lower(), length])

def map_type_decl(self, node):
scope = self.scope_stack[-1]
Expand Down
7 changes: 4 additions & 3 deletions pyopencl/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2050,9 +2050,10 @@ def squeeze(self):
.. versionadded:: 2015.2
"""
new_shape = tuple([dim for dim in self.shape if dim > 1])
new_strides = tuple([self.strides[i]
for i, dim in enumerate(self.shape) if dim > 1])
new_shape = tuple(dim for dim in self.shape if dim > 1)
new_strides = tuple(
self.strides[i] for i, dim in enumerate(self.shape)
if dim > 1)

return self._new_with_changes(
self.base_data, self.offset,
Expand Down
2 changes: 1 addition & 1 deletion test/test_enqueue_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


def generate_slice(start, shape):
return tuple([slice(start[i], start[i]+shape[i]) for i in range(len(start))])
return tuple(slice(start[i], start[i]+shape[i]) for i in range(len(start)))


def test_enqueue_copy_rect_2d(ctx_factory, honor_skip=True):
Expand Down

0 comments on commit 104937c

Please sign in to comment.