コード例 #1
0
 def test_grey(self):
     with expected_warnings(['precision loss']):
         tmp = np.arange(12, dtype=float).reshape((4, 3)) / 11
         x = prepare_for_display(tmp)
     assert_array_equal(x[..., 0], x[..., 2])
     assert x[0, 0, 0] == 0
     assert x[3, 2, 0] == 255
コード例 #2
0
 def test_grey(self):
     x = prepare_for_display(np.arange(12, dtype=float).reshape((4, 3)) / 11)
     assert_array_equal(x[..., 0], x[..., 2])
     assert x[0, 0, 0] == 0
     assert x[3, 2, 0] == 255
コード例 #3
0
 def test_dtype(self):
     x = prepare_for_display(np.random.random((10, 15)))
     assert x.dtype == np.dtype(np.uint8)
コード例 #4
0
ファイル: test_plugin_util.py プロジェクト: Aakalpa/Thrift
 def test_wrong_depth(self):
     with testing.raises(ValueError):
         with expected_warnings(['precision loss']):
             prepare_for_display(np.random.rand(10, 10, 5))
コード例 #5
0
 def test_wrong_dimensionality(self):
     with expected_warnings(['precision loss']):
         prepare_for_display(np.random.rand(10, 10, 1, 1))
コード例 #6
0
 def test_basic(self):
     prepare_for_display(np.random.random((10, 10)))
コード例 #7
0
 def test_alpha(self):
     prepare_for_display(np.random.random((10, 10, 4)))
コード例 #8
0
 def test_wrong_dimensionality(self):
     prepare_for_display(np.random.random((10, 10, 1, 1)))
コード例 #9
0
 def test_grey(self):
     x = prepare_for_display(np.arange(12, dtype=float).reshape((4, 3)) / 11)
     assert_array_equal(x[..., 0], x[..., 2])
     assert x[0, 0, 0] == 0
     assert x[3, 2, 0] == 255
コード例 #10
0
 def test_colour(self):
     prepare_for_display(np.random.random((10, 10, 3)))
コード例 #11
0
 def test_dtype(self):
     x = prepare_for_display(np.random.random((10, 15)))
     assert x.dtype == np.dtype(np.uint8)
コード例 #12
0
 def test_wrong_depth(self):
     with testing.raises(ValueError):
         prepare_for_display(np.random.rand(10, 10, 5))
コード例 #13
0
 def test_wrong_dimensionality(self):
     with testing.raises(ValueError):
         prepare_for_display(np.random.rand(10, 10, 1, 1))
コード例 #14
0
 def test_colour(self):
     prepare_for_display(np.random.random((10, 10, 3)))
コード例 #15
0
 def test_wrong_dimensionality(self):
     prepare_for_display(np.random.random((10, 10, 1, 1)))
コード例 #16
0
 def test_alpha(self):
     prepare_for_display(np.random.random((10, 10, 4)))
コード例 #17
0
 def test_wrong_depth(self):
     prepare_for_display(np.random.random((10, 10, 5)))
コード例 #18
0
 def test_wrong_depth(self):
     prepare_for_display(np.random.random((10, 10, 5)))
コード例 #19
0
 def test_basic(self):
     prepare_for_display(np.random.random((10, 10)))
コード例 #20
0
 def test_dtype(self):
     with expected_warnings(['precision loss']):
         x = prepare_for_display(np.random.rand(10, 15))
     assert x.dtype == np.dtype(np.uint8)
コード例 #21
0
 def test_basic(self):
     with expected_warnings(['precision loss']):
         prepare_for_display(np.random.rand(10, 10))
コード例 #22
0
 def test_alpha(self):
     with expected_warnings(['precision loss']):
         prepare_for_display(np.random.rand(10, 10, 4))
コード例 #23
0
 def test_dtype(self):
     with expected_warnings(['precision loss']):
         x = prepare_for_display(np.random.rand(10, 15))
     assert x.dtype == np.dtype(np.uint8)
コード例 #24
0
 def test_wrong_depth(self):
     with expected_warnings(['precision loss']):
         prepare_for_display(np.random.rand(10, 10, 5))
コード例 #25
0
 def test_wrong_dimensionality(self):
     with expected_warnings(['precision loss']):
         prepare_for_display(np.random.rand(10, 10, 1, 1))