MCPcopy Create free account
hub / github.com/PyTables/PyTables / create_node

Method create_node

bench/undo_redo.py:41–69  ·  view source on GitHub ↗

Checking a undo/redo create_array.

(self)

Source from the content-addressed store, hash-verified

39 # os.remove(self.file)
40
41 def create_node(self):
42 """Checking a undo/redo create_array."""
43
44 for i in range(self.nobjects):
45 # Create a new array
46 self.fileh.create_array("/", "array" + str(i), self.a1)
47 # Put a mark
48 self.fileh.mark()
49 # Unwind all marks sequentially
50 for i in range(self.niter):
51 t1 = clock()
52 for i in range(self.nobjects):
53 self.fileh.undo()
54 if verbose:
55 print("u", end=" ")
56 if verbose:
57 print()
58 undo = clock() - t1
59 # Rewind all marks sequentially
60 t1 = clock()
61 for i in range(self.nobjects):
62 self.fileh.redo()
63 if verbose:
64 print("r", end=" ")
65 if verbose:
66 print()
67 redo = clock() - t1
68
69 print("Time for Undo, Redo (createNode):", undo, "s, ", redo, "s")
70
71 def copy_children(self):
72 """Checking a undo/redo copy_children."""

Callers

nothing calls this directly

Calls 4

markMethod · 0.80
undoMethod · 0.80
redoMethod · 0.80
create_arrayMethod · 0.45

Tested by

no test coverage detected