def make_row(entry):
            channels = dict(('channel_{}'.format(ch.name), ch.trimmed_y)
                            for ch in entry.channels)

            parameters = map_keys('parameter_{}'.format, entry.parameters)
            properties = map_keys('property_{}'.format, entry.properties)

            r = {}
            r.update(entry.system_properties)
            r.update(channels)
            r.update(parameters)
            r.update(properties)
            return r
Example #2
0
    def test_non_empty_map(self):
        # when
        mapped_dict = map_keys(times_2, {2: 'a', 3: 'b'})

        # then
        self.assertEqual({4: 'a', 6: 'b'}, mapped_dict)
Example #3
0
    def test_empty_map(self):
        # when
        mapped_dict = map_keys(times_2, {})

        # then
        self.assertEqual({}, mapped_dict)
Example #4
0
    def test_non_empty_map(self):
        # when
        mapped_dict = map_keys(times_2, {2: "a", 3: "b"})

        # then
        self.assertEqual({4: "a", 6: "b"}, mapped_dict)