Skip to content

Commit

Permalink
misc: Add more helpful error for time bounds edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Sep 17, 2024
1 parent cec0542 commit 03d91a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devito/types/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ def _arg_check(self, args, size, interval):
# Autopadding causes non-integer upper limit
from devito.symbolics import normalize_args
upper = interval.upper.subs(normalize_args(args))

if args[self.max_name] is None:
raise ValueError("Argument %s not found. Do you need to supply it to the"
" operator at runtime?" % self.max_name)
if args[self.max_name] + upper >= size:
raise InvalidArgument("OOB detected due to %s=%d" % (self.max_name,
args[self.max_name]))
Expand Down

0 comments on commit 03d91a4

Please sign in to comment.