Skip to content

Commit 061ff36

Browse files
Uncomment some dimension deduction tests.
1 parent 2faa8d4 commit 061ff36

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

dynd/nd/test/test_array_construct.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -619,53 +619,50 @@ def test_extra_field(self):
619619
# self.assertEqual(nd.type_of(a), ndt.type('var * int32'))
620620
# self.assertEqual(nd.as_py(a), [2*x + 1 for x in range(7)])
621621

622-
"""
623622
class TestDeduceDims(unittest.TestCase):
623+
"""
624624
def test_simplearr(self):
625625
val = [[[1, 2], [3, 4]], [[5, 6], [7, 8]],
626626
[[11, 12], [13, 14]], [[15, 16], [17, 18]]]
627627
# Deduce all the dims
628-
a = nd.array(val, dtype=ndt.int16)
628+
a = nd.array(val, type=ndt.int16)
629629
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
630630
self.assertEqual(nd.as_py(a), val)
631631
# Specify some dims as fixed
632-
a = nd.array(val, dtype='Fixed * int16')
632+
a = nd.array(val, type='Fixed * int16')
633633
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
634634
self.assertEqual(nd.as_py(a), val)
635-
a = nd.array(val, dtype='Fixed * Fixed * int16')
635+
a = nd.array(val, type='Fixed * Fixed * int16')
636636
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
637637
self.assertEqual(nd.as_py(a), val)
638-
a = nd.array(val, dtype='Fixed * Fixed * Fixed * int16')
638+
a = nd.array(val, type='Fixed * Fixed * Fixed * int16')
639639
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
640640
self.assertEqual(nd.as_py(a), val)
641641
# Specify some dims as fixed
642-
a = nd.array(val, dtype='2 * int16')
642+
a = nd.array(val, type='2 * int16')
643643
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
644644
self.assertEqual(nd.as_py(a), val)
645-
a = nd.array(val, dtype='2 * 2 * int16')
645+
a = nd.array(val, type='2 * 2 * int16')
646646
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
647647
self.assertEqual(nd.as_py(a), val)
648-
a = nd.array(val, dtype='4 * 2 * 2 * int16')
648+
a = nd.array(val, type='4 * 2 * 2 * int16')
649649
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
650650
self.assertEqual(nd.as_py(a), val)
651651
# Mix fixed, symbolic fixed, and var
652-
a = nd.array(val, dtype='4 * var * Fixed * int16')
652+
a = nd.array(val, type='4 * var * Fixed * int16')
653653
self.assertEqual(nd.type_of(a), ndt.type('4 * var * 2 * int16'))
654654
self.assertEqual(nd.as_py(a), val)
655-
a = nd.array(val, dtype='var * 2 * int16')
655+
a = nd.array(val, type='var * 2 * int16')
656656
self.assertEqual(nd.type_of(a), ndt.type('4 * var * 2 * int16'))
657657
self.assertEqual(nd.as_py(a), val)
658-
a = nd.array(val, dtype='Fixed * 2 * int16')
658+
a = nd.array(val, type='Fixed * 2 * int16')
659659
self.assertEqual(nd.type_of(a), ndt.type('4 * 2 * 2 * int16'))
660660
self.assertEqual(nd.as_py(a), val)
661+
"""
661662

662663
def test_empty(self):
663-
# A fixed dimension of non-zero size gets pushed down
664-
a = nd.array([], dtype='3 * int32')
665-
self.assertEqual(nd.type_of(a), ndt.type('0 * 3 * int32'))
666-
self.assertEqual(nd.as_py(a), [])
667664
# A fixed dimension of zero size gets absorbed
668-
a = nd.array([], dtype='0 * int32')
665+
a = nd.array([], type='0 * int32')
669666
self.assertEqual(nd.type_of(a), ndt.type('0 * int32'))
670667
self.assertEqual(nd.as_py(a), [])
671668
# A symbolic fixed dimension gets absorbed
@@ -674,10 +671,9 @@ def test_empty(self):
674671
# self.assertEqual(nd.type_of(a), ndt.type('0 * int32'))
675672
# self.assertEqual(nd.as_py(a), [])
676673
# A var dimension gets absorbed
677-
a = nd.array([], dtype='var * int32')
674+
a = nd.array([], type='var * int32')
678675
self.assertEqual(nd.type_of(a), ndt.type('var * int32'))
679676
self.assertEqual(nd.as_py(a), [])
680-
"""
681677

682678
#class TestConstructErrors(unittest.TestCase):
683679
# def test_bad_params(self):

0 commit comments

Comments
 (0)