Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,11 @@ def check_array(array, exp_halo, exp_shape, rotate=False):

shape = []
for i in array.symbolic_shape:
if i.is_Number or i.is_Symbol:
shape.append(i)
else:
assert i.is_Add
if i.is_Add:
# Ensure it's a plain sympy.Add and not a subclass
shape.append(Add(*i.args))
else:
shape.append(i)

if rotate:
exp_shape = (sum(exp_halo[0]) + 1,) + tuple(exp_shape[1:])
Expand Down
4 changes: 2 additions & 2 deletions devito/symbolics/extended_sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ def __new__(cls, value, step, **kwargs):
value = sympify(value)
step = sympify(step)

if step < 1:
raise ValueError("Cannot round up with negative `step`")
if not is_integer(step):
raise ValueError("`step` must be an integer")
if step < 1:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never experienced such joy

raise ValueError("Cannot round up with negative `step`")

if value.is_number and step.is_number:
remainder = value % step
Expand Down
2 changes: 2 additions & 0 deletions devito/types/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,8 @@ def __padding_setup_smart__(self, **kwargs):
else:
from devito.symbolics import RoundUp # noqa
v = RoundUp(snp, mmts) - snp
if v.is_Integer:
v = int(v)

dpadding = (0, v)
padding = [(0, 0)]*self.ndim
Expand Down
Loading