Skip to content

Commit

Permalink
misc: Adjust tests and tidy variable names for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Oct 28, 2024
1 parent f5786d2 commit 4e0318a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion devito/ir/equations/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _(d, mapper, rebuilt, sregistry):
return

tkns = tuple(t._rebuild(name=sregistry.make_name(prefix=t.name)) for t in d.tkns)
mapper.update({t0: t1 for t0, t1 in zip(d.tkns, tkns)})
mapper.update({tkn0: tkn1 for tkn0, tkn1 in zip(d.tkns, tkns)})
mapper[d] = d._rebuild(thickness=tkns)


Expand Down
6 changes: 3 additions & 3 deletions tests/test_dle.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_cache_blocking_structure_subdims():
# zi is rebuilt with name z, so check symbolic max and min are preserved
# Also check the zi was rebuilt
assert not tree[4].dim.is_Block and tree[4].dim is not zi and\
str(tree[4].dim.symbolic_min) == 'z_ltkn0 + z_m' and\
str(tree[4].dim.symbolic_min) == 'z_m + z_ltkn0' and\
str(tree[4].dim.symbolic_max) == 'z_M - z_rtkn0' and\
tree[4].dim.parent is z

Expand Down Expand Up @@ -1374,7 +1374,7 @@ def test_nested_cache_blocking_structure_subdims(self, blocklevels):

if blocklevels == 1:
assert not tree[4].dim.is_Block and tree[4].dim is not zi and\
str(tree[4].dim.symbolic_min) == 'z_ltkn0 + z_m' and\
str(tree[4].dim.symbolic_min) == 'z_m + z_ltkn0' and\
str(tree[4].dim.symbolic_max) == 'z_M - z_rtkn0' and\
tree[4].dim.parent is z
elif blocklevels == 2:
Expand All @@ -1385,7 +1385,7 @@ def test_nested_cache_blocking_structure_subdims(self, blocklevels):
assert tree[5].dim.is_Block and tree[5].dim.parent is tree[3].dim and\
tree[5].dim.root is y
assert not tree[6].dim.is_Block and tree[6].dim is not zi and\
str(tree[6].dim.symbolic_min) == 'z_ltkn0 + z_m' and\
str(tree[6].dim.symbolic_min) == 'z_m + z_ltkn0' and\
str(tree[6].dim.symbolic_max) == 'z_M - z_rtkn0' and\
tree[6].dim.parent is z

Expand Down
4 changes: 2 additions & 2 deletions tests/test_symbolic_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def test_staggered_equation(self):

eq_f = Eq(f, f.dx2(weights=weights))

expected = 'Eq(f(x + h_x/2), 1.0*f(x - h_x/2) - 2.0*f(x + h_x/2)'\
' + 1.0*f(x + 3*h_x/2))'
expected = 'Eq(f(x + h_x/2), f(x - h_x/2) - 2.0*f(x + h_x/2)'\
' + f(x + 3*h_x/2))'
assert(str(eq_f.evaluate) == expected)

@pytest.mark.parametrize('stagger', [True, False])
Expand Down

0 comments on commit 4e0318a

Please sign in to comment.