コード例 #1
0
 def test_coordinates_are_lists_of_ints(self):
     heatmap = load.heatmap(123, channel_id=1)
     self.assertIsInstance(heatmap.X, list)
     self.assertIsInstance(heatmap.Y, list)
     for element in heatmap.X:
         self.assertIsInstance(element, int)
     for element in heatmap.Y:
         self.assertIsInstance(element, int)
コード例 #2
0
 def test_channel_is_list_of_floats(self):
     heatmap = load.heatmap(123, channel_id=1)
     self.assertIsInstance(heatmap.Intensities, list)
     for element in heatmap.Intensities:
         self.assertIsInstance(element, float)
コード例 #3
0
 def test_throws_when_channel_does_not_exist(self):
     with self.assertRaises(IndexError):
         load.heatmap(123, channel_id=123456789)
コード例 #4
0
 def test_loads_given_channel(self):
     heatmap = load.heatmap(123, channel_id=1)
     self.assertEqual(heatmap.Intensities, [12, 22, 32, 42, 52])
コード例 #5
0
def heatmap(dataset_id: int):
    channel_id = require('channelId', int)
    return as_response(load.heatmap(dataset_id, channel_id))