def setup_bounds(self):
        """set up Minuit-style internal/external parameter transformation
        of min/max bounds.

        returns internal value for parameter from self.value (which holds
        the external, user-expected value).   This internal values should
        actually be used in a fit....

        As a side-effect, this also defines the self.from_internal method
        used to re-calculate self.value from the internal value, applying
        the inverse Minuit-style transformation.  This method should be
        called prior to passing a Parameter to the user-defined objective
        function.

        This code borrows heavily from JJ Helmus' leastsqbound.py
        """
        if self.min in (None, -inf) and self.max in (None, inf):
            self._from_internal = lambda val: val
            _val  = self._val
        elif self.max in (None, inf):
            self._from_internal = lambda val: self.min - 1 + sqrt(val*val + 1)
            _val  = sqrt((self._val - self.min + 1)**2 - 1)
        elif self.min in (None, -inf):
            self._from_internal = lambda val: self.max + 1 - sqrt(val*val + 1)
            _val  = sqrt((self.max - self._val + 1)**2 - 1)
        else:
            self._from_internal = lambda val: self.min + (sin(val) + 1) * \
                                  (self.max - self.min) / 2
            _val  = arcsin(2*(self._val - self.min)/(self.max / self.min) - 1)
        return _val
dataset/ETHPy150Open xraypy/xraylarch/lib/fitting/parameter.py/Parameter.setup_bounds/operator `-` -> `/`