コード例 #1
0
 def testNewOrder(self):
     neworder = [2, 1, 3]
     newpot = orderpot(self.pot, neworder)
     newtable = np.array([[[0, 12], [1, 13], [2, 14], [3, 15]],
                          [[4, 16], [5, 17], [6, 18], [7, 19]],
                          [[8, 20], [9, 21], [10, 22], [11, 23]]])
     assert np.allclose(newpot.variables, np.array(neworder))
     assert not (newpot.table - newtable).any()
コード例 #2
0
ファイル: orderpotTest.py プロジェクト: Henrilin28/PyBRML
 def testNewOrder(self):
     neworder = [2, 1, 3]
     newpot = orderpot(self.pot, neworder)
     newtable = np.array([[[0, 12], [1, 13], [2, 14], [3, 15]],
                          [[4, 16], [5, 17], [6, 18], [7, 19]],
                          [[8, 20], [9, 21], [10, 22], [11, 23]]])
     assert np.allclose(newpot.variables, np.array(neworder))
     assert not (newpot.table - newtable).any()
コード例 #3
0
 def testSortedOrder(self):
     neworder = [1, 2, 3]
     newtable = np.array([[[0, 12], [4, 16], [8, 20]],
                          [[1, 13], [5, 17], [9, 21]],
                          [[2, 14], [6, 18], [10, 22]],
                          [[3, 15], [7, 19], [11, 23]]])
     newpot = orderpot(self.pot, [])
     assert np.allclose(newpot.variables, np.array(neworder))
     assert not (newpot.table - newtable).any()
コード例 #4
0
ファイル: orderpotTest.py プロジェクト: Henrilin28/PyBRML
 def testSortedOrder(self):
     neworder = [1, 2, 3]
     newtable = np.array([[[0, 12], [4, 16], [8, 20]],
                          [[1, 13], [5, 17], [9, 21]],
                          [[2, 14], [6, 18], [10, 22]],
                          [[3, 15], [7, 19], [11, 23]]])
     newpot = orderpot(self.pot, [])
     assert np.allclose(newpot.variables, np.array(neworder))
     assert not (newpot.table - newtable).any()