示例#1
0
    def test_keys_from_value(self):
        """
        Tests :meth:`colour.utilities.data_structures.Lookup.keys_from_value`
        method.
        """

        lookup = Lookup(John='Doe', Jane='Doe', Luke='Skywalker')
        self.assertListEqual(sorted(['Jane', 'John']),
                             sorted(lookup.keys_from_value('Doe')))

        lookup = Lookup(A=np.array([0, 1, 2]),
                        B=np.array([0, 1, 2]),
                        C=np.array([1, 2, 3]))
        self.assertListEqual(sorted(['A', 'B']),
                             lookup.keys_from_value(np.array([0, 1, 2])))
    def test_keys_from_value(self):
        """
        Tests :meth:`colour.utilities.data_structures.Lookup.keys_from_value`
        method.
        """

        lookup = Lookup(John='Doe', Jane='Doe', Luke='Skywalker')
        self.assertListEqual(
            sorted(['Jane', 'John']), sorted(lookup.keys_from_value('Doe')))

        lookup = Lookup(
            A=np.array([0, 1, 2]),
            B=np.array([0, 1, 2]),
            C=np.array([1, 2, 3]))
        self.assertListEqual(
            sorted(['A', 'B']), lookup.keys_from_value(np.array([0, 1, 2])))
    def test_keys_from_value(self):
        """
        Test :meth:`colour.utilities.data_structures.Lookup.keys_from_value`
        method.
        """

        lookup = Lookup(John="Doe", Jane="Doe", Luke="Skywalker")
        self.assertListEqual(["Jane", "John"],
                             sorted(lookup.keys_from_value("Doe")))

        lookup = Lookup(A=np.array([0, 1, 2]),
                        B=np.array([0, 1, 2]),
                        C=np.array([1, 2, 3]))
        self.assertListEqual(["A", "B"],
                             sorted(lookup.keys_from_value(np.array([0, 1,
                                                                     2]))))
示例#4
0
    def test_keys_from_value(self):
        """
        Tests :meth:`colour.utilities.data_structures.Lookup.keys_from_value`
        method.
        """

        lookup = Lookup(John='Doe', Jane='Doe', Luke='Skywalker')
        self.assertListEqual(sorted(['Jane', 'John']),
                             sorted(lookup.keys_from_value('Doe')))
示例#5
0
    def test_keys_from_value(self):
        """
        Tests :meth:`colour.utilities.data_structures.Lookup.keys_from_value`
        method.
        """

        lookup = Lookup(John='Doe', Jane='Doe', Luke='Skywalker')
        self.assertListEqual(sorted(['Jane', 'John']),
                             sorted(lookup.keys_from_value('Doe')))