def check_bounds(self, *, err_on_missing_bounds=False): "Checks if any variables are unbounded, through equality constraints." missingbounds = {} for var, locs in self.varlocs.items(): upperbound, lowerbound = False, False for i in locs: if i not in self.meq_idxs.all: if self....
It sort of makes sense but makes for odd syntax. I prefer a single Boolean False when two arrays have different types. That Numpy managed like this for years without major problems suggests that the lack of consistency (returning a single Boolean vs an array of Booleans) is not a big dea...
While checking for equality, the algorithm considers all zero values equal, regardless of sign. ( -0, +0 are all considered to be equal to 0), but false is not equal to 0. It uses the sameValueZero algorithm for searching whether an element is present in the array....
A NumPy array has various parts to it though, and some of the parts can be equal while others aren't. The new assertions are more strict in that they check for equality of dtypes and shapes in places where the old assertions didn't. Perhaps you would prefer a longer name likeassert_ar...