def right(self, value): """ Setter for **self.__right** private attribute. Parameters ---------- value : numeric Attribute value. """ if value is not None: assert is_numeric(value), ( '"{0}" attribute: "{1}" type is not "numeric"!').format( 'right', value) self.__right = value
def bandwidth_FWHM(self, value): """ Setter for **self.__bandwidth_FWHM** private attribute. Parameters ---------- value : numeric Attribute value. """ if value is not None: assert is_numeric(value), ( '"{0}" attribute: "{1}" type is not "numeric"!'.format( 'bandwidth_FWHM', value)) self.__bandwidth_FWHM = value
def test_is_numeric(self): """ Tests :func:`colour.algebra.common.is_numeric` definition. """ self.assertTrue(is_numeric(1)) self.assertTrue(is_numeric(1)) self.assertTrue(is_numeric(complex(1))) self.assertFalse(is_numeric((1, ))) self.assertFalse(is_numeric([1])) self.assertFalse(is_numeric('1'))
def test_is_numeric(self): """ Tests :func:`colour.algebra.common.is_numeric` definition. """ self.assertTrue(is_numeric(1)) self.assertTrue(is_numeric(1)) self.assertTrue(is_numeric(complex(1))) self.assertFalse(is_numeric((1,))) self.assertFalse(is_numeric([1])) self.assertFalse(is_numeric('1'))
def __call__(self, x): """ Evaluates the Extrapolator1d at given point(s). Parameters ---------- x : numeric or array_like Point(s) to evaluate the Extrapolator1d at. Returns ------- float or ndarray Extrapolated points value(s). """ xe = self.__evaluate(to_ndarray(x)) if is_numeric(x): return float(xe) else: return xe
def __call__(self, x): """ Evaluates the Extrapolator1d at given point(s). Parameters ---------- x : numeric or array_like Point(s) to evaluate the Extrapolator1d at. Returns ------- float or ndarray Extrapolated points value(s). """ xe = self.__evaluate(as_array(x)) if is_numeric(x): return float(xe) else: return xe
def __call__(self, x): """ Evaluates the interpolating polynomial at given point(s). Parameters ---------- x : numeric or array_like Point(s) to evaluate the interpolant at. Returns ------- float or ndarray Interpolated value(s). """ xi = self.__evaluate(to_ndarray(x)) if is_numeric(x): return float(xi) else: return xi