Skip to content

Commit

Permalink
Updated contours tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 22, 2018
1 parent 0147b3e commit 38e5569
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions holoviews/tests/element/teststatselements.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_distribution_composite_custom_vdim(self):
self.assertEqual(area.vdims, [Dimension('Test')])

def test_distribution_composite_not_filled(self):
dist = Distribution(np.array([0, 1, 2])).opts(plot=dict(filled=False))
dist = Distribution(np.array([0, 1, 2]), ).opts(plot=dict(filled=False))
curve = Compositor.collapse_element(dist, backend='matplotlib')
self.assertIsInstance(curve, Curve)
self.assertEqual(curve.vdims, [Dimension(('Value_density', 'Value Density'))])
Expand Down Expand Up @@ -182,7 +182,7 @@ def test_bivariate_composite_filled(self):
dist = Bivariate(np.random.rand(10, 2)).opts(plot=dict(filled=True))
contours = Compositor.collapse_element(dist)
self.assertIsInstance(contours, Polygons)
self.assertEqual(contours.vdims, [Dimension('Density', range=(0, 1.1))])
self.assertEqual(contours.vdims, [Dimension('Density', range=(0, 1.05))])

def test_bivariate_composite_empty_filled(self):
dist = Bivariate([]).opts(plot=dict(filled=True))
Expand Down
4 changes: 2 additions & 2 deletions holoviews/tests/operation/teststatsoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def test_bivariate_kde_contours(self):
kde = bivariate_kde(bivariate, n_samples=100, x_range=(0, 1),
y_range=(0, 1), contours=True, levels=10)
self.assertIsInstance(kde, Contours)
self.assertEqual(len(kde.data), 9)
self.assertEqual(len(kde.data), 6)

def test_bivariate_kde_contours_filled(self):
np.random.seed(1)
bivariate = Bivariate(np.random.rand(100, 2))
kde = bivariate_kde(bivariate, n_samples=100, x_range=(0, 1),
y_range=(0, 1), contours=True, filled=True, levels=10)
self.assertIsInstance(kde, Polygons)
self.assertEqual(len(kde.data), 10)
self.assertEqual(len(kde.data), 7)

def test_bivariate_kde_nans(self):
kde = bivariate_kde(self.bivariate_nans, n_samples=2, x_range=(0, 4),
Expand Down

0 comments on commit 38e5569

Please sign in to comment.