Re: optimize.Bounds - does lb need to be less than ub?
Kevin Sheppard <[email protected]> Thu, 18 May 2023 18:45:33 +0100
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CAE8Ss2F5qLJrb0istFi7+U9sJu0mQ7x_QrpkDkNGZKPmQ4xOHQ@mail.gmail.com> |
In the spirit of explicit is better then implicit, I think the current behavior is desirable. It may catch problems that are I'll posed or otherwise codes wrong. Kevin On Thu, May 18, 2023, 17:41 Andrew Nelson <[email protected]> wrote: > 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] > _______________________________________________ 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]