Esempio n. 1
0
    def test__str__(self):
        """
        Tests :meth:`colour.utilities.deprecation.ObjectRenamed.__str__`
        method.
        """

        self.assertIn('name', str(ObjectRenamed('name', 'new_name')))
        self.assertIn('new_name', str(ObjectRenamed('name', 'new_name')))
Esempio n. 2
0
    def test__str__(self):
        """
        Test :meth:`colour.utilities.deprecation.ObjectRenamed.__str__`
        method.
        """

        self.assertIn("name", str(ObjectRenamed("name", "new_name")))
        self.assertIn("new_name", str(ObjectRenamed("name", "new_name")))
Esempio n. 3
0
    def extrapolator_args(self, value):
        # Docstrings are omitted for documentation purposes.
        usage_warning(
            str(
                ObjectRenamed('Signal.extrapolator_args',
                              'Signal.extrapolator_kwargs')))

        self.extrapolator_kwargs = value
Esempio n. 4
0
    def interpolator_args(self):
        # Docstrings are omitted for documentation purposes.
        usage_warning(
            str(
                ObjectRenamed('Signal.interpolator_args',
                              'Signal.interpolator_kwargs')))

        return self.interpolator_kwargs
Esempio n. 5
0
    def encoding_cctf(self):  # pragma: no cover
        # Docstrings are omitted for documentation purposes.
        runtime_warning(
            str(
                ObjectRenamed('RGB_Colourspace.encoding_cctf',
                              'RGB_Colourspace.cctf_encoding')))

        return self.cctf_encoding
Esempio n. 6
0
    def illuminant(self, value):  # pragma: no cover
        # Docstrings are omitted for documentation purposes.
        runtime_warning(
            str(
                ObjectRenamed('RGB_Colourspace.illuminant',
                              'RGB_Colourspace.whitepoint_name')))

        self.whitepoint_name = value
Esempio n. 7
0

NAME: Any = None
"""An non-deprecated module attribute."""

NEW_NAME: Any = None
"""A module attribute with a new name."""

try:
    sys.modules[
        "colour.utilities.tests.test_deprecated"
    ] = deprecated(  # type: ignore[assignment]
        sys.modules["colour.utilities.tests.test_deprecated"],
        {
            "OLD_NAME": ObjectRenamed(
                name=("colour.utilities.tests.test_deprecated.OLD_NAME"),
                new_name=("colour.utilities.tests.test_deprecated.NEW_NAME"),
            ),
            "REMOVED": ObjectRemoved(
                name="colour.utilities.tests.test_deprecated.REMOVED"
            ),
        },
    )
except KeyError:  # pragma: no cover
    pass

del ModuleAPI
del ObjectRenamed
del ObjectRemoved
del sys
Esempio n. 8
0
NAME = None
"""
An non-deprecated module attribute.

NAME : object
"""

NEW_NAME = None
"""
A module attribute with a new name.

NAME : object
"""

sys.modules['colour.utilities.tests.test_deprecated'] = (deprecated(
    sys.modules['colour.utilities.tests.test_deprecated'], {
        'OLD_NAME':
            ObjectRenamed(
                name='colour.utilities.tests.test_deprecated.OLD_NAME',
                new_name='colour.utilities.tests.test_deprecated.NEW_NAME'),
        'REMOVED':
            ObjectRemoved(name='colour.utilities.tests.test_deprecated.REMOVED'
                          )
    }))

del ModuleAPI
del ObjectRenamed
del ObjectRemoved
del sys