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

Function compute_tables

bench/poly.py:120–143  ·  view source on GitHub ↗

Compute the polynomial with tables.Expr.

(clib, clevel)

Source from the content-addressed store, hash-verified

118
119
120def 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
146if __name__ == "__main__":

Callers 1

poly.pyFile · 0.85

Calls 6

set_outputMethod · 0.95
evalMethod · 0.95
print_filesizeFunction · 0.85
create_carrayMethod · 0.80
from_dtypeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected