Skip to content

Commit 1745806

Browse files
committed
api: fix bounds from range
1 parent 56d4626 commit 1745806

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

devito/operator/operator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,15 @@ def _prepare_arguments(self, autotune=None, estimate_memory=False, **kwargs):
637637
# E.g., given a ConditionalDimension `t_sub` with factor `fact`
638638
# and a TimeFunction `usave(t_sub, x, y)`, an override for
639639
# `fact` is supplied w/o overriding `usave`; that's legal
640-
continue
641-
if is_integer(args[k]) and not contains_val(args[k], v):
640+
pass
641+
elif is_integer(args[k]) and not contains_val(args[k], v):
642642
raise InvalidArgument(
643643
f"Default `{p}` is incompatible with other args as "
644644
f"`{k}={v}`, while `{k}={args[k]}` is expected. Perhaps "
645645
f"you forgot to override `{p}`?"
646646
)
647-
args[k] = args.unique(k, candidate=v)
647+
else:
648+
args[k] = args.unique(k, candidate=v)
648649

649650
kwargs['args'] = args.reduce_inplace()
650651

devito/types/dimension.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ def _arg_values(self, interval, grid=None, args=None, **kwargs):
318318
# may represent sets of legal values. If that's the case, here we just
319319
# pick one. Note that we sort for determinism
320320
try:
321-
loc_minv = loc_minv.stop
321+
loc_minv = loc_minv.start
322322
except AttributeError:
323323
with suppress(TypeError):
324324
loc_minv = sorted(loc_minv).pop(0)
325325
try:
326-
loc_maxv = loc_maxv.stop
326+
loc_maxv = loc_maxv.stop - 1
327327
except AttributeError:
328328
with suppress(TypeError):
329329
loc_maxv = sorted(loc_maxv).pop(0)

0 commit comments

Comments
 (0)