Skip to content

Commit

Permalink
disallow inf lower bound, -inf upper bound
Browse files Browse the repository at this point in the history
If the lower bound is `inf`, no integer number will satisfy the lower bound,
which implies the array must have size zero, in which case the bounds are
useless. This patch disallows `inf` lower bounds and `-inf` upper bounds.
  • Loading branch information
joostvanzwieten committed Feb 29, 2024
1 parent 59890da commit 0085a8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nutils/evaluable.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,8 @@ def _intbounds(self):
return value, value
else:
lower, upper = self._intbounds_impl()
assert isinstance(lower, int) or lower == float('-inf') or lower == float('inf')
assert isinstance(upper, int) or upper == float('-inf') or upper == float('inf')
assert isinstance(lower, int) or lower == float('-inf')
assert isinstance(upper, int) or upper == float('inf')
assert lower <= upper
return lower, upper

Expand Down

0 comments on commit 0085a8c

Please sign in to comment.