From 0085a8ca528d0767fa0d7e7e0096b637c8cadb8f Mon Sep 17 00:00:00 2001 From: Joost van Zwieten Date: Wed, 28 Feb 2024 21:50:28 +0100 Subject: [PATCH] disallow inf lower bound, -inf upper bound 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. --- nutils/evaluable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nutils/evaluable.py b/nutils/evaluable.py index 208f75a74..fa15704cc 100644 --- a/nutils/evaluable.py +++ b/nutils/evaluable.py @@ -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