def test_shape_factors(self):
"""
Tests for :func:`array_split.split.shape_factors`.
"""
f = shape_factors(4, 2)
self.assertTrue(_np.all(f == 2))
f = shape_factors(4, 1)
self.assertTrue(_np.all(f == 4))
f = shape_factors(5, 2)
self.assertTrue(_np.all(f == [1, 5]))
f = shape_factors(6, 2)
self.assertTrue(_np.all(f == [2, 3]))
f = shape_factors(6, 3)
self.assertTrue(_np.all(f == [1, 2, 3]))
评论列表
文章目录