Skip to content

Commit 432538c

Browse files
committed
compiler: pep8 happiness
1 parent 93356a4 commit 432538c

5 files changed

Lines changed: 7 additions & 10 deletions

File tree

devito/ir/equations/equation.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class IREq(sympy.Eq, Pickable):
3333
__rkwargs__ = ('ispace', 'conditionals', 'implicit_dims', 'operation')
3434

3535
def _hashable_content(self):
36-
return (*super()._hashable_content(),
37-
*tuple(getattr(self, i) for i in self.__rkwargs__))
36+
return (super()._hashable_content() +
37+
tuple(as_hashable(getattr(self, i)) for i in self.__rkwargs__))
3838

3939
@property
4040
def is_Scalar(self):
@@ -74,10 +74,6 @@ def state(self):
7474
def operation(self):
7575
return self._operation
7676

77-
def _hashable_content(self):
78-
return (super()._hashable_content() +
79-
tuple(as_hashable(getattr(self, i)) for i in self.__rkwargs__))
80-
8177
@property
8278
def is_Reduction(self):
8379
return self.operation in (OpInc, OpMin, OpMax, OpMinMax)

devito/ir/iet/visitors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import ctypes
88
from collections import OrderedDict
99
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
10-
from contextlib import suppress
1110
from itertools import chain, groupby
1211
from typing import Any, Generic, TypeVar
1312

@@ -1203,7 +1202,6 @@ def visit(self, o, *args, **kwargs):
12031202
# `start` and `stop` are part of this visitor's state.
12041203
return GenericVisitor.visit(self, o, *args, **kwargs)
12051204

1206-
12071205
def visit_object(self, o: object, flag: bool = False) -> LazyVisit[Node, bool]:
12081206
yield from ()
12091207
return flag # noqa: B901

devito/ir/support/basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from devito.ir.support.utils import AccessMode, extrema
1111
from devito.ir.support.vector import LabeledVector, Vector
1212
from devito.symbolics import (
13-
compare_ops, q_affine, q_comp_acc, q_constant, retrieve_accesses, retrieve_indexed
13+
compare_ops, q_affine, q_comp_acc, q_constant, retrieve_indexed
1414
)
1515
from devito.tools import (
1616
CacheInstances, Tag, as_mapper, as_tuple, cached_hash, filter_sorted, flatten,
@@ -1496,6 +1496,7 @@ def is_regular(self):
14961496
def vinf(entries):
14971497
return Vector(*(entries + [S.Infinity]))
14981498

1499+
14991500
def disjoint_test(e0, e1, d, it):
15001501
"""
15011502
A rudimentary test to check if two accesses `e0` and `e1` along `d` within

devito/ir/support/space.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ def reset(self):
799799

800800
return DataSpace(intervals, parts)
801801

802+
802803
class IterationSpace(Space, CacheInstances):
803804

804805
"""

devito/tools/memoization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def wrapper(cls, *args, **kwargs):
324324
if type(input_obj) is cls:
325325
names = getattr(cls, fields) if isinstance(fields, str) else fields
326326
for name in names:
327-
if name in kwargs and kwargs[name] is not getattr(input_obj, name, None):
327+
if name in kwargs and \
328+
kwargs[name] is not getattr(input_obj, name, None):
328329
break
329330
else:
330331
return input_obj

0 commit comments

Comments
 (0)