ENH: Add option to append to existing .npy files to numpy.save#11939
ENH: Add option to append to existing .npy files to numpy.save#11939kohlrabi wants to merge 1 commit intonumpy:mainfrom
Conversation
|
Thinking about this, it might be more general and useful to implement a true Buffer-like (npyBuffer) object into which one can write incrementally, and use that for the append-business as well. |
|
You need to write tests for the new functionality. Might also mention this on the mailing list for discussion. |
|
Will also need release note if it goes in. |
|
Thanks for taking a look. Currently I have not much time to dive into how to create test cases. I'll have to do it at a later time. |
|
Thanks for the PR, considering the age, I am going to close it. Note that gh-20321 modified our headers to make it easier to do this externally, and the PR also links a project that does so outside of NumPy. |
Since my workflow involves working with large memmapped
.npyfiles, I was always a bit stumped that I was not able to append to.npyfiles, and was only able to save and work with arrays which fit into RAM.This patch adds the option to append arrays to
.npyfiles. I successfully ran theruntests.pytest suite for both Python2.7 and Python3.6, and tested it with arrays of different shapes.Further future improvements could be to add this option to
numpy.savezas well.