예제 #1
0
 def test_all(self):
     expected = np.array(
         [[0, 0, 0, 0, 0, 0, 0, 0],
          [1, 0, 0, 0, 0, 0, 0, 0],
          [1, 1, 0, 0, 0, 0, 0, 0],
          [1, 1, 1, 0, 0, 0, 0, 0],
          [1, 1, 1, 1, 0, 0, 0, 0],
          [1, 1, 1, 1, 1, 0, 0, 0],
          [1, 1, 1, 1, 1, 1, 0, 0],
          [1, 1, 1, 1, 1, 1, 1, 0],
          [1, 1, 1, 1, 1, 1, 1, 1]],
         dtype=np.uint8)
     encoded = thermo_encode_8([0, 1, 2, 3, 4, 5, 6, 7, 8])
     npt.assert_array_equal(encoded, expected)
예제 #2
0
 def test0(self):
     expected = np.array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=np.uint8)
     encoded = thermo_encode_8([0])
     npt.assert_array_equal(encoded, expected)
예제 #3
0
 def test8(self):
     expected = np.array([[1, 1, 1, 1, 1, 1, 1, 1]], dtype=np.uint8)
     encoded = thermo_encode_8([8])
     npt.assert_array_equal(encoded, expected)