-
Notifications
You must be signed in to change notification settings - Fork 222
Add append mode to IntanSplitFile building on #4070 #4075
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
for more information, see https://pre-commit.ci
I am OK with this. I have the intuition that a separate class instead of a keyword argument might be safer but this seems to work. We already have a test for pickling in the |
Yeah I'll have to find the pickle test info but I can add it. I do think regardless of whether we do yours or this one, we should discuss whether this ought to be allowable for any intan file or only the traditional split mode which we are not checking for at the moment. |
I think that's the beauty of doing it as a separate class, users can decide where they point this to. I don't think we should be policing any further. |
Yeah I think I was getting hung up on your original idea about this should try to be a class that handles how the "acquisition" intended. Not checking for the timestamps is actively against the intention of that system because the system internally uses the timestamps to validate the integrity of the blocks. But it does allow people to debug a corrupted file if they need to vs just failing. |
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.
I am OK with this instead of my PR. I think it is an improvement as it adds another feature. Still weary of the double class inheritance but the tests are passing for the critical case so it should be fine.
if mode == "concatenate": | ||
ConcatenateSegmentRecording.__init__(self, recording_list) | ||
elif mode == "append": | ||
AppendSegmentRecording.__init__(self, recording_list) | ||
|
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.
Is this legal when double hineritance not initialize the other class ?
Just wondering..
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.
Yeah, I am weary of that. But maybe it is an opportunity for us to learn something if it blows up at some point x D
I propose we merge this and see how long this will work. |
Thanks for the review, @samuelgarcia |
I think this is only okay because they both only have |
Do we want a comment in the code saying that this is slightly dangerous but we are testing it out blame zm711 if it goes wrong? |
It is too much of a hunch to write anything that would be useful I think. If we get an error at some point we can just create a separate class and use a router in the snake_case version of the caller to decided which class we use. This could also be done with new but Sam and Alessio think that pattern might not play well with serialization which would be another danger. |
Fair enough. I'll leave this to @samuelgarcia / @alejoe91 now :) |
@h-mayorquin,
this is my proposal on top of your PR for an append mode (without docs). If you have a reason to hate it we can close it, but this seems easy enough, no? But you know the pickle stuff better so maybe this ruins that?

may replace #4070