Skip to content

Commit f3c20e8

Browse files
committed
compiler: Comply with ruff
1 parent ff9b906 commit f3c20e8

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

devito/ir/support/space.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,10 +910,7 @@ def switch(self, d0, d1=None, direction=None):
910910
`d1`. Optionally, `d0` could be a mapper, in which case multiple Dimensions
911911
may be switched.
912912
"""
913-
if isinstance(d0, dict):
914-
mapper = d0
915-
else:
916-
mapper = {d0: d1}
913+
mapper = d0 if isinstance(d0, dict) else {d0: d1}
917914

918915
intervals = self.intervals
919916
sub_iterators = dict(self.sub_iterators)

devito/passes/clusters/aliases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ def make_blockdim_subiter(dimensions):
17061706

17071707
pd = d.parent
17081708

1709-
if pd.parent.is_Block:
1709+
if pd.parent.is_Block: # noqa SIM108
17101710
# A BlockDimension in between BlockDimensions
17111711
m = d.symbolic_min - pd.symbolic_min
17121712
else:

devito/passes/clusters/blocking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
from devito.types import BlockDimension
1818

19-
__all__ = ['blocking', 'apply_par_tiles']
19+
__all__ = ['apply_par_tiles', 'blocking']
2020

2121

2222
def blocking(clusters, sregistry, options):

tests/test_dimension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@ def test_blocking_w_guard(self):
20722072

20732073
op = Operator(eqns, opt=('advanced', {'openmp': True}))
20742074

2075-
op.cfunction
2075+
_ = op.cfunction
20762076

20772077
assert_structure(op, ['t,x0_blk0,y0_blk0,x,y,z',
20782078
't,x0_blk0,y0_blk0,x,y',

0 commit comments

Comments
 (0)