Suggestion: add an pad parameter to np.memmap

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Suggestion: add an pad parameter to np.memmap

Tom Swirly
Hello, and thanks for all your work on the amazing numpy.

I'm using np.memmap() with great success for memory mapping WAV audio files, with one tiny blemish - the WAV spec wants me to sometimes put one byte after the list of samples that I'm memory mapping, which I can't do easily when writing a new file.

This little patch is probably backward compatible and would accomplish what I need:

If there were interest, I could figure out numpy's test system and write tests for it.

(For the foreseeable future, I'm intercepting the call to mmap.mmap() to add the padding, so I'm not blocked, though the code has aspects of ugliness.)


NumPy-Discussion mailing list
[hidden email]