Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    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
Пример #4
0
    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'))
Пример #5
0
    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'))
Пример #6
0
    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
Пример #7
0
    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
Пример #8
0
    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
Пример #9
0
    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