Compute the polynomial with tables.Expr.
(clib, clevel)
| 118 | |
| 119 | |
| 120 | def compute_tables(clib, clevel): |
| 121 | """Compute the polynomial with tables.Expr.""" |
| 122 | f = tb.open_file(h5fname, "a") |
| 123 | _ = f.root.x # get the x input |
| 124 | # Create container for output |
| 125 | atom = tb.Atom.from_dtype(dtype) |
| 126 | filters = tb.Filters(complib=clib, complevel=clevel) |
| 127 | r = f.create_carray( |
| 128 | f.root, |
| 129 | "r", |
| 130 | atom=atom, |
| 131 | shape=(N,), |
| 132 | filters=filters, |
| 133 | chunkshape=CHUNKSHAPE, |
| 134 | ) |
| 135 | |
| 136 | # Do the actual computation and store in output |
| 137 | ex = tb.Expr(expr) # parse the expression |
| 138 | ex.set_output(r) # where is stored the result? |
| 139 | # when commented out, the result goes in-memory |
| 140 | ex.eval() # evaluate! |
| 141 | |
| 142 | f.close() |
| 143 | print_filesize(h5fname, clib, clevel) |
| 144 | |
| 145 | |
| 146 | if __name__ == "__main__": |
no test coverage detected