コード例 #1
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_no_smaller_dimension(self):
     array = np.arange(100, 150, dtype='int32')
     with self.assertRaises(ValueError):
         ts.in_array2_3(array)
コード例 #2
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_requires_non_null(self):
     with self.assertRaises(TypeError):
         ts.in_array2_3(None)
コード例 #3
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_no_bigger_dimension(self):
     array = np.arange(100, 150, dtype='int32').reshape(1, 10, 5)
     with self.assertRaises(ValueError):
         ts.in_array2_3(array)
コード例 #4
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_no_other_data_type(self):
     array = np.arange(100, 150, dtype='float').reshape(10, 5)
     with self.assertRaises(ValueError):
         ts.in_array2_3(array)
コード例 #5
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_no_other_width(self):
     array = np.arange(100, 150, dtype='int32').reshape(5, 10)
     with self.assertRaises(ValueError):
         ts.in_array2_3(array)
コード例 #6
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_non_contiguous_array(self):
     array = np.arange(150, dtype='int32').reshape((3, 5, 10))[..., 2]
     self.assertEqual((flatten(array), 3, 5), ts.in_array2_3(array))
コード例 #7
0
ファイル: typemap_test.py プロジェクト: SETI/pds-cspyce
 def test_basic_run(self):
     array = np.arange(100, 150, dtype='int32').reshape(10, 5)
     self.assertEqual((flatten(array), 10, 5), ts.in_array2_3(array))
     self.assertEqual((flatten(array[1:]), 9, 5), ts.in_array2_3(array[1:]))