def test_spread_aggregate_symmetric_count(self): spread = Spread([(0, 1, 0.8), (1, 2, 0.3), (2, 3, 0.8)]) agg = rasterize(spread, width=4, height=4, dynamic=False) xs = [0.25, 0.75, 1.25, 1.75] ys = [0.65, 1.55, 2.45, 3.35] arr = np.array([[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1]]) expected = Image((xs, ys, arr), vdims='count') self.assertEqual(agg, expected)
def test_spread_aggregate_assymmetric_count(self): spread = Spread([(0, 1, 0.4, 0.8), (1, 2, 0.8, 0.4), (2, 3, 0.5, 1)], vdims=['y', 'pos', 'neg']) agg = rasterize(spread, width=4, height=4, dynamic=False) xs = [0.25, 0.75, 1.25, 1.75] ys = [0.6125, 1.4375, 2.2625, 3.0875] arr = np.array([[0, 0, 0, 0], [1, 0, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]) expected = Image((xs, ys, arr), vdims='count') self.assertEqual(agg, expected)