Populate the values in x axis for pytables.
(clib, clevel)
| 70 | |
| 71 | |
| 72 | def populate_x_tables(clib, clevel): |
| 73 | """Populate the values in x axis for pytables.""" |
| 74 | f = tb.open_file(h5fname, "w") |
| 75 | |
| 76 | # Create container for input |
| 77 | atom = tb.Atom.from_dtype(dtype) |
| 78 | filters = tb.Filters(complib=clib, complevel=clevel) |
| 79 | x = f.create_carray( |
| 80 | f.root, |
| 81 | "x", |
| 82 | atom=atom, |
| 83 | shape=(N,), |
| 84 | filters=filters, |
| 85 | chunkshape=CHUNKSHAPE, |
| 86 | ) |
| 87 | |
| 88 | # Populate x in range [-1, 1] |
| 89 | for i in range(0, N, step): |
| 90 | chunk = np.linspace((2 * i - N) / N, (2 * (i + step) - N) / N, step) |
| 91 | x[i : i + step] = chunk |
| 92 | f.close() |
| 93 | |
| 94 | |
| 95 | def compute_numpy(): |
no test coverage detected