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

Function populate_x_tables

bench/poly.py:72–92  ·  view source on GitHub ↗

Populate the values in x axis for pytables.

(clib, clevel)

Source from the content-addressed store, hash-verified

70
71
72def 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
95def compute_numpy():

Callers 1

poly.pyFile · 0.85

Calls 3

create_carrayMethod · 0.80
from_dtypeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected