-
Notifications
You must be signed in to change notification settings - Fork 6
Update npy_append_array.py #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- support for both write/append for a smooth switching between the two - if original file did not support appending, we will try in the background to save it so it does
self.filename = filename | ||
self.fp = None | ||
self.__is_init = False | ||
if os.path.isfile(filename): | ||
self.__init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__init is now called only if we are appending, so is done in .append
Thank you for the pull request, always makes me happy to see them! However, I don't want do add more features at this point since I want NpyAppendArray to become part of Numpy (compare numpy/numpy#20321). Currently, I want NpyAppendArray to develop as close as possible to the Numpy pull request. Also, I see the following aspects:
I will leave the pull request open and maybe some variant of it might be merged at some point in the future. |
all made sense. I removed the write/append entirely. The write method is enough: if the user wants to write, let her use npa.write explicitly. I also removed the contigous check, this can be done by user before appending. As suggested, I added a make_file_appendable method. |
btw, I am using it in |
After a lot of work and discussions here and there, the pull request went through and I've got some feedback from the Numpy team: the wanted to have the AppendArray functionality in an external module. However, now |
That's good to hear, I now have in production a listener appending to npy files continuosly throughout the day. It's production code so will take some time to migrate but I will have a look. Thanks for keeping me updated and happy new year. |
If there is something missing for your usecase, just write here, we can add it then. Happy new year, too! |
I have implemented the |
And sorry for the late answer, took me a while to get it into the state I wanted to have it. |
Uh oh!
There was an error while loading. Please reload this page.