(input_path, output_path)
| 88 | |
| 89 | |
| 90 | def copy5(input_path, output_path): |
| 91 | print(f"copying data from {input_path} to {output_path}...") |
| 92 | input_file = tb.open_file(input_path, mode="r") |
| 93 | output_file = tb.open_file(output_path, mode="w", filters=filters) |
| 94 | |
| 95 | input_table = input_file.root.test |
| 96 | output_table = output_file.create_table("/", "test", input_table.dtype) |
| 97 | |
| 98 | chunksize = 100_000 |
| 99 | rowsleft = len(input_table) |
| 100 | start = 0 |
| 101 | for chunk in range(int(len(input_table) / chunksize) + 1): |
| 102 | stop = start + min(chunksize, rowsleft) |
| 103 | data = input_table.read(start, stop) |
| 104 | output_table.append(data) |
| 105 | output_table.flush() |
| 106 | rowsleft -= chunksize |
| 107 | start = stop |
| 108 | |
| 109 | input_file.close() |
| 110 | output_file.close() |
| 111 | |
| 112 | |
| 113 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected