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

Function copy4

bench/table-copy.py:65–87  ·  view source on GitHub ↗
(input_path, output_path)

Source from the content-addressed store, hash-verified

63
64
65def copy4(input_path, output_path):
66 print(f"copying data from {input_path} to {output_path}...")
67 input_file = tb.open_file(input_path, mode="r")
68 output_file = tb.open_file(output_path, mode="w", filters=filters)
69
70 input_table = input_file.root.test
71 print("reading data...", end=" ")
72 start = clock()
73 data = input_file.root.test.read()
74 print(f"{clock() - start:.3f}s elapsed.")
75 print("done.")
76
77 output_table = output_file.create_table("/", "test", input_table.dtype)
78 print("appending data...", end=" ")
79 start = clock()
80 output_table.append(data)
81 print("flushing...", end=" ")
82 output_table.flush()
83 print(f"{clock() - start:.3f}s elapsed.")
84 print("done.")
85
86 input_file.close()
87 output_file.close()
88
89
90def copy5(input_path, output_path):

Callers

nothing calls this directly

Calls 5

readMethod · 0.45
create_tableMethod · 0.45
appendMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected