Skip to content

Commit 5e64b9f

Browse files
committed
compiler: Simplify implementation and polish docstrings
1 parent 7dd1e2b commit 5e64b9f

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

devito/ir/clusters/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ def exprs_dimensions(self):
177177
The Dimensions that appear explicitly in the Cluster expressions.
178178
"""
179179
dims_explicit = {i for i in self.free_symbols if i.is_Dimension}
180-
dims_implicit = set().union(*[set(e.implicit_dims) for e in self.exprs])
180+
dims_implicit = {d for e in self.exprs for d in e.implicit_dims}
181181
return dims_explicit | dims_implicit
182182

183183
@cached_property
184184
def guards_dimensions(self):
185185
"""
186186
The Dimensions that appear explicitly in the Cluster guards.
187187
"""
188-
syms_guards = set().union(*[e.free_symbols for e in self.guards.values()])
188+
syms_guards = {d for e in self.guards.values() for d in e.free_symbols}
189189
dims_guards = {i for i in syms_guards if i.is_Dimension}
190190
return dims_guards
191191

devito/symbolics/extended_sympy.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ def __mul__(self, other):
151151
class Terminal:
152152

153153
"""
154-
Abstract base class for all terminal objects, that is, those objects
155-
collected by `retrieve_terminals` in addition to all other SymPy atoms
156-
such as `Symbol`, `Number`, etc.
154+
Abstract base class for special SymPy objects that can only appear as
155+
leaves (that is nodes with no children/arguments) in an expression.
157156
"""
158157

159158
pass
@@ -553,10 +552,6 @@ class Reserved(Pickable):
553552
"""
554553
A base class for all reserved words used throughout the lowering process,
555554
including the final stage of code generation itself.
556-
557-
Reserved objects have the following properties:
558-
559-
* `estimate_cost(o) = 0`, where `o` is an instance of Reserved
560555
"""
561556

562557
pass

0 commit comments

Comments
 (0)