optimize.Bounds - does lb need to be less than ub?
Andrew Nelson <[email protected]> Thu, 18 May 2023 17:38:57 +0100
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CAAbtOZeXNVH7kFNJ_B-KE=ac-K-r5F9aH8GauTEjaSu90owfzA@mail.gmail.com> |
Hi all,
in https://github.com/scipy/scipy/pull/18483 `Bounds` is being modified
slightly.
Currently there's a check in there:
```
if (self.lb > self.ub).any():
raise ValueError("An upper bound is less than the corresponding lower
bound.")
```
I would personally find it useful if Bounds was more robust in this area,
and was able to deal with lb entries that were greater than the ub. I would
like Bounds to have a clear up code with something like:
```
_lb = np.minimum(self.lb, self.ub)
_ub = np.maximum(self.lb, self.ub)
self.lb = _lb
self.ub = _ub
```
What are peoples thoughts on this?
A.
_____________________________________
Dr. Andrew Nelson
_____________________________________
_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]