def test_npartition(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    self.assertEqual(len(tree.leaves), 2)
    tree = DomainTree(domains=self.d0, min_split=0.3)
    self.assertIn(len(tree.leaves), [2, 3])
    tree = DomainTree(domains=self.d0, min_split=0.2)
    self.assertIn(len(tree.leaves), [3, 4, 5])
    tree = DomainTree(domains=self.d0, min_split=0, depth_max=5)
    n = ((2 ** 5) / 2)
    self.assertEqual(len(tree.leaves), n)
def test_npartition(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    self.assertEqual(len(tree.leaves), 2)
    tree = DomainTree(domains=self.d0, min_split=0.3)
    self.assertIn(len(tree.leaves), [2, 3])
    tree = DomainTree(domains=self.d0, min_split=0.2)
    self.assertIn(len(tree.leaves), [3, 4, 5])
    tree = DomainTree(domains=self.d0, min_split=0, depth_max=5)
    n = ((2 ** 5) / 2)
    self.assertEqual(len(tree.leaves), n)