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

Function compute_memmap

bench/poly.py:105–117  ·  view source on GitHub ↗

Compute the polynomial with numpy.memmap.

()

Source from the content-addressed store, hash-verified

103
104
105def compute_memmap():
106 """Compute the polynomial with numpy.memmap."""
107 # Reopen inputs in read-only mode
108 x = np.memmap(mpfnames[0], dtype=dtype, mode="r", shape=(N,))
109 # Create the array output
110 r = np.memmap(mpfnames[1], dtype=dtype, mode="w+", shape=(N,))
111
112 # Do the computation by chunks and store in output
113 r[:] = eval(expr) # where is stored the result?
114 # r = eval(expr) # result is stored in-memory
115
116 del x, r # close x and r memmap arrays
117 print_filesize(mpfnames)
118
119
120def compute_tables(clib, clevel):

Callers

nothing calls this directly

Calls 1

print_filesizeFunction · 0.85

Tested by

no test coverage detected