コード例 #1
0
ファイル: extrapolation.py プロジェクト: canavandl/colour
    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
ファイル: extrapolation.py プロジェクト: aforsythe/colour
    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
ファイル: ies_tm2714.py プロジェクト: aforsythe/colour
    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
ファイル: tests_common.py プロジェクト: canavandl/colour
    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
ファイル: tests_common.py プロジェクト: KevinJW/colour
    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
ファイル: extrapolation.py プロジェクト: canavandl/colour
    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
ファイル: extrapolation.py プロジェクト: aforsythe/colour
    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
ファイル: interpolation.py プロジェクト: KevinJW/colour
    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