diff --git a/.travis.yml b/.travis.yml index 57748d2..3237c03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: - '3.6' install: - pip install -e . + - pip install -r requirements.txt - pip install nose coverage coveralls script: travis_wait 30 python setup.py nosetests --with-coverage --cover-package rubik_solver after_success: coveralls diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..2b46b07 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include requirements.txt rubik_solver/CoordCube/*.csv diff --git a/rubik_solver/CoordCube/__init__.py b/rubik_solver/CoordCube/__init__.py index 8e346a3..b6e88be 100644 --- a/rubik_solver/CoordCube/__init__.py +++ b/rubik_solver/CoordCube/__init__.py @@ -14,10 +14,10 @@ class CoordCube(object): N_URtoUL = 1320 # 12!/(12-3)! permutation of UR,UF,UL edges N_UBtoDF = 1320 # 12!/(12-3)! permutation of UB,DR,DF edges N_URtoDF = 20160 # 8!/(8-6)! permutation of UR,UF,UL,UB,DR,DF edges in phase2 - + N_URFtoDLB = 40320 # 8! permutations of the corners N_URtoBR = 479001600 # 8! permutations of the corners - + N_MOVE = 18 # twistMove = [[0 for _ in range(N_MOVE)] for _ in range( N_TWIST )] ## CUIDADO CON LAS REFERENCIAS @@ -29,32 +29,32 @@ class CoordCube(object): # UBtoDF_Move = [[0 for _ in range(N_MOVE)] for _ in range( N_UBtoDF )] # MergeURtoULandUBtoDF = [[0 for _ in range(336)] for _ in range( 336 )] - Slice_URFtoDLF_Parity_Prun = [-1] * (N_SLICE2 * N_URFtoDLF * N_PARITY // 2) - Slice_URtoDF_Parity_Prun = [-1] * (N_SLICE2 * N_URtoDF * N_PARITY // 2) - Slice_Twist_Prun = [-1] * (N_SLICE1 * N_TWIST // 2 + 1) - Slice_Flip_Prun = [-1] * (N_SLICE1 * N_FLIP // 2) - + # Slice_URFtoDLF_Parity_Prun = [-1] * (N_SLICE2 * N_URFtoDLF * N_PARITY // 2) + # Slice_URtoDF_Parity_Prun = [-1] * (N_SLICE2 * N_URtoDF * N_PARITY // 2) + # Slice_Twist_Prun = [-1] * (N_SLICE1 * N_TWIST // 2 + 1) + # Slice_Flip_Prun = [-1] * (N_SLICE1 * N_FLIP // 2) + ## Parity of the corner permutation. This is the same as the parity for the edge permutation of a valid cube. ## parity has values 0 and 1 parityMove = [ [1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0] ] - + @staticmethod def setPruning(table, index, value): if (index & 1) == 0: table[index // 2] &= (0xf0 | value) else: table[index // 2] &= (0x0f | (value << 4)) - + @staticmethod def getPruning(table, index): if (index & 1) == 0: return table[index // 2] & 0x0f else: return (table[index // 2] & 0xf0) >> 4 - + def __init__(self, c): ''' c is a CubieCube instance''' if not isinstance(c, CubieCube): @@ -67,7 +67,7 @@ def __init__(self, c): self.URtoUL = c.getURtoUL() self.UBtoDF = c.getUBtoDF() self.URtoDF = c.getURtoDF() # only needed in phase2 - + def move(self, m): '''A move on the coordinate level''' self.twist = self.twistMove[self.twist][m] @@ -80,7 +80,7 @@ def move(self, m): if self.URtoUL < 336 and self.UBtoDF < 336: # updated only if UR,UF,UL,UB,DR,DF # are not in UD-slice self.URtoDF = self.MergeURtoULandUBtoDF[self.URtoUL][self.UBtoDF] - + ## Init more static values of class CubieCube def read_or_func_list(file_name, func): abspath = os.path.join(os.path.dirname(os.path.abspath(__file__)), file_name) @@ -101,7 +101,7 @@ def read_or_func_matrix(file_name, func): return ret def build_twist_move(): - twist_move = CoordCube.twistMove + twist_move = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_TWIST )] a = CubieCube() for i in range(CoordCube.N_TWIST): a.setTwist(i) @@ -113,7 +113,7 @@ def build_twist_move(): return twist_move def build_flip_move(): - flip_move = CoordCube.flipMove + flip_move = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_FLIP )] a = CubieCube() for i in range(CoordCube.N_FLIP): a.setFlip(i) @@ -125,7 +125,7 @@ def build_flip_move(): return flip_move def build_urf_to_dlf(): - urf_to_dlf = CoordCube.URFtoDLF_Move + urf_to_dlf = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_URFtoDLF )] a = CubieCube() for i in range(CoordCube.N_URFtoDLF): a.setURFtoDLF(i) @@ -137,7 +137,7 @@ def build_urf_to_dlf(): return urf_to_dlf def build_fr_to_br(): - fr_to_br = CoordCube.FRtoBR_Move + fr_to_br = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_FRtoBR )] a = CubieCube() for i in range(CoordCube.N_FRtoBR): a.setFRtoBR(i) @@ -149,7 +149,7 @@ def build_fr_to_br(): return fr_to_br def build_ur_to_df(): - ur_to_df = CoordCube.URtoDF_Move + ur_to_df = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_URtoDF )] a = CubieCube() for i in range(CoordCube.N_URtoDF): a.setURtoDF(i) @@ -161,7 +161,7 @@ def build_ur_to_df(): return ur_to_df def build_ur_to_ul(): - ur_to_ul = CoordCube.URtoUL_Move + ur_to_ul = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_URtoUL )] a = CubieCube() for i in range(CoordCube.N_URtoUL): a.setURtoUL(i) @@ -173,7 +173,7 @@ def build_ur_to_ul(): return ur_to_ul def build_ub_to_df(): - ub_to_df = CoordCube.UBtoDF_Move + ub_to_df = [[0 for _ in range(CoordCube.N_MOVE)] for _ in range( CoordCube.N_UBtoDF )] a = CubieCube() for i in range(CoordCube.N_URtoUL): a.setUBtoDF(i) @@ -185,14 +185,14 @@ def build_ub_to_df(): return ub_to_df def build_merge_ur_to_ul_and_ub_to_df(): - merge_ur_to_ul_and_ub_to_df = CoordCube.MergeURtoULandUBtoDF + merge_ur_to_ul_and_ub_to_df = [[0 for _ in range(336)] for _ in range( 336 )] for uRtoUL in range(336): for uBtoDF in range(336): merge_ur_to_ul_and_ub_to_df[uRtoUL][uBtoDF] = CubieCube.getURtoDFs(uRtoUL, uBtoDF) return merge_ur_to_ul_and_ub_to_df def build_slice_urf_to_dlf_parity_prun(): - slice_urf_to_dlf_parity_prun = CoordCube.Slice_URFtoDLF_Parity_Prun + slice_urf_to_dlf_parity_prun = [-1] * (CoordCube.N_SLICE2 * CoordCube.N_URFtoDLF * CoordCube.N_PARITY // 2) CoordCube.setPruning(slice_urf_to_dlf_parity_prun, 0, 0) done, depth = 1, 0 while done < CoordCube.N_SLICE2 * CoordCube.N_URFtoDLF * CoordCube.N_PARITY: @@ -213,7 +213,7 @@ def build_slice_urf_to_dlf_parity_prun(): return slice_urf_to_dlf_parity_prun def build_slice_ur_to_df_parity_prun(): - slice_ur_to_df_parity_prun = CoordCube.Slice_URtoDF_Parity_Prun + slice_ur_to_df_parity_prun = [-1] * (CoordCube.N_SLICE2 * CoordCube.N_URtoDF * CoordCube.N_PARITY // 2) CoordCube.setPruning(slice_ur_to_df_parity_prun, 0, 0) done, depth = 1, 0 while done != (CoordCube.N_SLICE2 * CoordCube.N_URtoDF * CoordCube.N_PARITY): @@ -233,7 +233,7 @@ def build_slice_ur_to_df_parity_prun(): return slice_ur_to_df_parity_prun def build_slice_twist_prun(): - slice_twist_prun = CoordCube.Slice_Twist_Prun + slice_twist_prun = [-1] * (CoordCube.N_SLICE1 * CoordCube.N_TWIST // 2 + 1) CoordCube.setPruning(slice_twist_prun, 0, 0) done, depth = 1, 0 while done < (CoordCube.N_SLICE1 * CoordCube.N_TWIST): @@ -251,7 +251,7 @@ def build_slice_twist_prun(): return slice_twist_prun def build_slice_flip_prun(): - slice_flip_prun = CoordCube.Slice_Flip_Prun + slice_flip_prun = [-1] * (CoordCube.N_SLICE1 * CoordCube.N_FLIP // 2) CoordCube.setPruning(slice_flip_prun, 0, 0) done, depth = 1, 0 while done < (CoordCube.N_SLICE1 * CoordCube.N_FLIP): diff --git a/rubik_solver/CubieCube.py b/rubik_solver/CubieCube.py index 08bef5b..40efd35 100644 --- a/rubik_solver/CubieCube.py +++ b/rubik_solver/CubieCube.py @@ -8,7 +8,7 @@ class ParityError(Exception): pass class CubieCube(object): '''Cube on the cubie level''' - + ## moves on the cubie level cpU = [ Corner.UBR, Corner.URF, Corner.UFL, Corner.ULB, Corner.DFR, Corner.DLF, Corner.DBL, Corner.DRB @@ -18,7 +18,7 @@ class CubieCube(object): Edge.UB, Edge.UR, Edge.UF, Edge.UL, Edge.DR, Edge.DF, Edge.DL, Edge.DB, Edge.FR, Edge.FL, Edge.BL, Edge.BR ] eoU = [0] * 12 - + cpR = [ Corner.DFR, Corner.UFL, Corner.ULB, Corner.URF, Corner.DRB, Corner.DLF, Corner.DBL, Corner.UBR ] @@ -27,7 +27,7 @@ class CubieCube(object): Edge.FR, Edge.UF, Edge.UL, Edge.UB, Edge.BR, Edge.DF, Edge.DL, Edge.DB, Edge.DR, Edge.FL, Edge.BL, Edge.UR ] eoR = [0] * 12 - + cpF = [ Corner.UFL, Corner.DLF, Corner.ULB, Corner.UBR, Corner.URF, Corner.DFR, Corner.DBL, Corner.DRB ] @@ -36,7 +36,7 @@ class CubieCube(object): Edge.UR, Edge.FL, Edge.UL, Edge.UB, Edge.DR, Edge.FR, Edge.DL, Edge.DB, Edge.UF, Edge.DF, Edge.BL, Edge.BR ] eoF = [0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0] - + cpD = [ Corner.URF, Corner.UFL, Corner.ULB, Corner.UBR, Corner.DLF, Corner.DBL, Corner.DRB, Corner.DFR ] @@ -45,7 +45,7 @@ class CubieCube(object): Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DF, Edge.DL, Edge.DB, Edge.DR, Edge.FR, Edge.FL, Edge.BL, Edge.BR ] eoD = [0] * 12 - + cpL = [ Corner.URF, Corner.ULB, Corner.DBL, Corner.UBR, Corner.DFR, Corner.UFL, Corner.DLF, Corner.DRB ] @@ -54,7 +54,7 @@ class CubieCube(object): Edge.UR, Edge.UF, Edge.BL, Edge.UB, Edge.DR, Edge.DF, Edge.FL, Edge.DB, Edge.FR, Edge.UL, Edge.DL, Edge.BR ] eoL = [0] * 12 - + cpB = [ Corner.URF, Corner.UFL, Corner.UBR, Corner.DRB, Corner.DFR, Corner.DLF, Corner.ULB, Corner.DBL ] @@ -63,9 +63,9 @@ class CubieCube(object): Edge.UR, Edge.UF, Edge.UL, Edge.BR, Edge.DR, Edge.DF, Edge.DL, Edge.BL, Edge.FR, Edge.FL, Edge.UB, Edge.DB ] eoB = [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1] - + def __init__(self, cp = None, co = None, ep = None, eo = None): - + if cp is None or co is None or ep is None or eo is None: ## corner permutation cp = [ @@ -77,7 +77,7 @@ def __init__(self, cp = None, co = None, ep = None, eo = None): ## edge permutation ep = [ - Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DR, Edge.DF, Edge.DL, Edge.DB, Edge.FR, Edge.FL, Edge.BL, Edge.BR + Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DR, Edge.DF, Edge.DL, Edge.DB, Edge.FR, Edge.FL, Edge.BL, Edge.BR ] ## edge orientation @@ -240,7 +240,7 @@ def edgeParity(self): if self.ep[j] > self.ep[i]: s += 1 return s % 2 - + def getFRtoBR(self): '''permutation of the UD-slice edges FR,FL,BL and BR''' a, x = 0, 0 @@ -250,7 +250,7 @@ def getFRtoBR(self): a += CubieCube.Cnk(11 - j, x + 1) edge4[3 - x] = self.ep[j] x += 1 - + b = 0 for j in [3, 2, 1]: k = 0 @@ -258,22 +258,22 @@ def getFRtoBR(self): CubieCube.rotateLeft(edge4, 0, j) k += 1 b = ((j + 1) * b) + k - + return (24 * a) + b - + def setFRtoBR(self, idx): x = 0 sliceEdge = [Edge.FR, Edge.FL, Edge.BL, Edge.BR] otherEdge = [Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DR, Edge.DF, Edge.DL, Edge.DB] b = idx % 24 - a = idx / 24 - + a = idx // 24 + for e in Edge.reverse_mapping.keys(): self.ep[e] = Edge.DB - + for j in [1, 2, 3]: k = b % (j + 1) - b /= j + 1 + b //= j + 1 while k > 0: CubieCube.rotateRight(sliceEdge, 0, j) k -= 1 @@ -283,13 +283,13 @@ def setFRtoBR(self, idx): self.ep[j] = sliceEdge[3 - x] a -= CubieCube.Cnk(11 - j, x + 1) x -= 1 - + x = 0 for j in range(Edge.UR, Edge.BR + 1): if self.ep[j] == Edge.DB: self.ep[j] = otherEdge[x] x += 1 - + def getURFtoDLF(self): '''Permutation of all corners except DBL and DRB''' a, x = 0, 0 @@ -299,7 +299,7 @@ def getURFtoDLF(self): a += CubieCube.Cnk(j, x + 1) corner6[x] = self.cp[j] x += 1 - + b = 0 for j in [5, 4, 3, 2, 1]: k = 0 @@ -308,23 +308,23 @@ def getURFtoDLF(self): k += 1 b = (j + 1) * b + k return 720 * a + b - + def setURFtoDLF(self, idx): corner6 = [Corner.URF, Corner.UFL, Corner.ULB, Corner.UBR, Corner.DFR, Corner.DLF] otherCorner = [Corner.DBL, Corner.DRB] b = idx % 720 - a = idx / 720 - + a = idx // 720 + for c in Corner.reverse_mapping.keys(): self.cp[c] = Corner.DRB - + for j in [1, 2, 3, 4, 5]: k = b % (j + 1) - b /= j + 1 + b //= j + 1 while k > 0: k -= 1 CubieCube.rotateRight(corner6, 0, j) - + x = 5 for j in range(Corner.DRB, -1, -1): if (a - CubieCube.Cnk(j, x + 1)) >= 0: @@ -336,7 +336,7 @@ def setURFtoDLF(self, idx): if self.cp[j] == Corner.DRB: self.cp[j] = otherCorner[x] x += 1 - + def getURtoDF(self): '''Permutation of the six edges UR,UF,UL,UB,DR,DF.''' a, b, x = 0, 0, 0 @@ -354,18 +354,18 @@ def getURtoDF(self): k += 1 b = (j + 1) * b + k return 720 * a + b - + def setURtoDF(self, idx): edge6 = [Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DR, Edge.DF] otherEdge = [Edge.DL, Edge.DB, Edge.FR, Edge.FL, Edge.BL, Edge.BR] b = idx % 720 # Permutation - a = idx / 720 # Combination + a = idx // 720 # Combination for e in Edge.reverse_mapping.keys(): self.ep[e] = Edge.BR # Use BR to invalidate all edges for j in [1, 2, 3, 4, 5]: k = b % (j + 1) - b /= j + 1 + b //= j + 1 while k > 0: k -= 1 CubieCube.rotateRight(edge6, 0, j) @@ -375,13 +375,13 @@ def setURtoDF(self, idx): self.ep[j] = edge6[x] a -= CubieCube.Cnk(j, x + 1) x -= 1 - + x = 0 for j in range(Edge.UR, Edge.BR + 1): if self.ep[j] == Edge.BR: self.ep[j] = otherEdge[x] x += 1 - + @staticmethod def getURtoDFs(idx1, idx2): '''Permutation of the six edges UR,UF,UL,UB,DR,DF''' @@ -396,7 +396,7 @@ def getURtoDFs(idx1, idx2): else: b.ep[i] = a.ep[i] return b.getURtoDF() - + def getURtoUL(self): '''Permutation of the three edges UR,UF,UL''' x, a, = 0, 0 @@ -414,31 +414,31 @@ def getURtoUL(self): while edge3[j] != j: CubieCube.rotateLeft(edge3, 0, j) k += 1 - + b = (j + 1) * b + k return 6 * a + b - + def setURtoUL(self, idx): edge3 = [Edge.UR, Edge.UF, Edge.UL] b = idx % 6 # Permutation - a = idx / 6 # Combination + a = idx // 6 # Combination for e in Edge.reverse_mapping.keys(): self.ep[e] = Edge.BR # Use BR to invalidate all edges for j in [1, 2]: # generate permutation from index b k = b % (j + 1) - b /= j + 1 + b //= j + 1 while k > 0: CubieCube.rotateRight(edge3, 0, j) k -= 1 - + x = 2 # generate combination and set edges for j in range(Edge.BR, -1, -1): if (a - CubieCube.Cnk(j, x + 1)) >= 0: self.ep[j] = edge3[x] a -= CubieCube.Cnk(j, x + 1) x -= 1 - + def getUBtoDF(self): a, x = 0, 0 edge3 = [0] * 3 @@ -455,56 +455,56 @@ def getUBtoDF(self): while edge3[j] != (Edge.UB + j): CubieCube.rotateLeft(edge3, 0, j) k += 1 - + b = (j + 1) * b + k - + return 6 * a + b - + def setUBtoDF(self, idx): edge3 = [Edge.UB, Edge.DR, Edge.DF] b = idx % 6 # Permutation - a = idx / 6 # Combination + a = idx // 6 # Combination for e in Edge.reverse_mapping.keys(): self.ep[e] = Edge.BR # Use BR to invalidate all edges for j in [1, 2]: #generate permutation from index b k = b % (j + 1) - b /= j + 1 + b //= j + 1 while k > 0: k-=1 CubieCube.rotateRight(edge3, 0, j) - + x = 2 # generate combination and set edges for j in range(Edge.BR, -1, -1): if (a - CubieCube.Cnk(j, x + 1)) >= 0: self.ep[j] = edge3[x] a -= CubieCube.Cnk(j, x + 1) x -= 1 - + def getURFtoDLB(self): perm = [0] * 8 b = 0 for i in range(8): perm[i] = self.cp[i] - + for j in range(7, 0, -1): #compute the index b < 8! for the permutation in perm k = 0 while perm[j] != j: CubieCube.rotateLeft(perm, 0, j) k += 1 b = (j + 1) * b + k - + return b - + def setURFtoDLB(self, idx): perm = [ Corner.URF, Corner.UFL, Corner.ULB, Corner.UBR, Corner.DFR, Corner.DLF, Corner.DBL, Corner.DRB ] for j in range(1, 8): k = idx % (j + 1) - idx /= j + 1 + idx //= j + 1 while k > 0: k -= 1 CubieCube.rotateRight(perm, 0, j) - + x = 7 # set corners for j in range(7, -1, -1): self.cp[j] = perm[x] @@ -520,7 +520,7 @@ def getURtoBR(self): while perm[j] != j: CubieCube.rotateLeft(perm, 0, j) k += 1 - + b = (j + 1) * b + k return b @@ -528,11 +528,11 @@ def setURtoBR(self, idx): perm = [ Edge.UR, Edge.UF, Edge.UL, Edge.UB, Edge.DR, Edge.DF, Edge.DL, Edge.DB, Edge.FR, Edge.FL, Edge.BL, Edge.BR ] for j in range(1, 12): k = idx % (j + 1) - idx /= j + 1 + idx //= j + 1 while k > 0: k -= 1 CubieCube.rotateRight(perm, 0, j) - + x = 11 # set edges for j in range(11, -1, -1): self.ep[j] = perm[x] diff --git a/setup.py b/setup.py index eee6e28..a4b9e45 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,6 @@ install_reqs = [ - 'wheel==0.24.0', - 'timeout-decorator==0.3.3', 'future==0.16.0', ] @@ -21,7 +19,7 @@ name='rubik_solver', author='Victor Cabezas', author_email='wiston666@gmail.com', - version='0.1.1', + version='0.1.2', description='Rubik solver algorithms', long_description=long_description, url='https://github.com/Wiston999/python-rubik', diff --git a/tests/test_CoordCube.py b/tests/test_CoordCube.py new file mode 100644 index 0000000..f4a8347 --- /dev/null +++ b/tests/test_CoordCube.py @@ -0,0 +1,62 @@ +from rubik_solver import CoordCube +import unittest + + +class TestCoordCube(unittest.TestCase): + def _compare_lists(self, l1, l2): + for i, _ in enumerate(l1): + self.assertEqual(l1[i], l2[i], msg = "Elements at index %d aren't the same %s != %s" % ( + i, l1[i], l2[i] + )) + + def _compare_matrices(self, m1, m2): + for i, _ in enumerate(m1): + for j, _ in enumerate(m1[i]): + self.assertEqual(m1[i][j], m2[i][j], msg = "Elements at index [%d][%d] aren't the same %s != %s" % ( + i, j, m1[i][j], m2[i][j] + )) + + def test_build_twist_move(self): + twist_move = CoordCube.build_twist_move() + self._compare_matrices(twist_move, CoordCube.CoordCube.twistMove) + + def test_build_flip_move(self): + flip_move = CoordCube.build_flip_move() + self._compare_matrices(flip_move, CoordCube.CoordCube.flipMove) + + def test_build_FRtoBR_move(self): + fr_to_br_move = CoordCube.build_fr_to_br() + self._compare_matrices(fr_to_br_move, CoordCube.CoordCube.FRtoBR_Move) + + def test_build_URFtoDLF_move(self): + urf_to_dlf_move = CoordCube.build_urf_to_dlf() + self._compare_matrices(urf_to_dlf_move, CoordCube.CoordCube.URFtoDLF_Move) + + def test_build_URtoDF_move(self): + ur_to_df_move = CoordCube.build_ur_to_df() + self._compare_matrices(ur_to_df_move, CoordCube.CoordCube.URtoDF_Move) + + def test_build_URtoUL_move(self): + ur_to_ul_move = CoordCube.build_ur_to_ul() + self._compare_matrices(ur_to_ul_move, CoordCube.CoordCube.URtoUL_Move) + + def test_build_UBtoDF_move(self): + ub_to_df_move = CoordCube.build_ub_to_df() + self._compare_matrices(ub_to_df_move, CoordCube.CoordCube.UBtoDF_Move) + + def test_build_MergeURtoULandUBtoDF(self): + merge_ur_to_ul_and_ub_to_df = CoordCube.build_merge_ur_to_ul_and_ub_to_df() + self._compare_lists(merge_ur_to_ul_and_ub_to_df, CoordCube.CoordCube.MergeURtoULandUBtoDF) + + def test_build_Slice_URFtoDLF_Parity_Prun(self): + slice_urf_to_dlf_parity_prun = CoordCube.build_slice_urf_to_dlf_parity_prun() + self._compare_lists(slice_urf_to_dlf_parity_prun, CoordCube.CoordCube.Slice_URFtoDLF_Parity_Prun) + + def test_build_Slice_URtoDF_Parity_Prun(self): + slice_ur_to_df_parity_prun = CoordCube.build_slice_ur_to_df_parity_prun() + self._compare_lists(slice_ur_to_df_parity_prun, CoordCube.CoordCube.Slice_URtoDF_Parity_Prun) + + def test_build_twist_prun(self): + slice_twist_prun = CoordCube.build_slice_twist_prun() + self._compare_lists(slice_twist_prun, CoordCube.CoordCube.Slice_Twist_Prun) + diff --git a/tests/test_utils.py b/tests/test_utils.py index 35209ac..fd40834 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -58,3 +58,5 @@ def test_pprint(self): with self.assertRaises(ValueError): utils.pprint(1) + # Just call it and wait not to fail + utils.pprint(Cube())