Skip to content

Commit bed8a9f

Browse files
committed
lint: Ruff (and flake8)
1 parent 6a2a225 commit bed8a9f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎devito/passes/clusters/buffering.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections import defaultdict, namedtuple
2+
from contextlib import suppress
23
from functools import cached_property
34
from itertools import chain
45

@@ -177,10 +178,8 @@ def callback(self, clusters, prefix):
177178
index_mapper = {i: mds[(v.xd, i)] for i in v.indices}
178179
for a in accesses:
179180
indices = [index_mapper.get(i, i) for i in a]
180-
try:
181+
with suppress(AttributeError):
181182
indices = b._buffer_indices(indices)
182-
except AttributeError:
183-
pass
184183
subs[a.access] = b.indexed[indices]
185184

186185
processed = []
@@ -464,7 +463,7 @@ def generate_buffers(clusters, key, sregistry, options, **kwargs):
464463
dimensions[dimensions.index(dim)] = xd
465464

466465
# Finally create the actual buffer
467-
## Better refactor: stash callback on original `f`
466+
# FIXME: A better refactor would stash callback on the original `f`
468467
cls = callback or Array
469468
name = sregistry.make_name(prefix=f'{f.name}b')
470469
mapper[f] = cls(name=name, dimensions=dimensions, dtype=f.dtype,

0 commit comments

Comments
 (0)