-
Notifications
You must be signed in to change notification settings - Fork 266
Merge Multiple Spiketrains #652
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
Merge Multiple Spiketrains #652
Conversation
…one with spiketrain.merge while preserving the previous functionality for merging a pair of spiketrains.
…notations of multiple objects
…annotations of multiple neo objects
…h/merge_multiple_spiketrains
|
Hello @Kleinjohann! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-02-07 08:51:12 UTC |
|
I'm not too sure how merging SpikeTrainProxies is supposed to work, should it just not work and raise an error? Or should it load the SpikeTrains automatically? Or should it return a ProxyObject which will return the merged SpikeTrain when one calls its load function? |
|
Intuitivelly I would say "load automatically" then merge. |
…ributes always results in merge(unique list) or one single attribute if it is the same for all spiketrains. Made sure this still works if the involved spiketrains are already merged spiketrains.
…pikeTrain objects, added a unittest for this case
…into enh/merge_multiple_spiketrains # Conflicts: # neo/core/spiketrain.py
|
I incorporated the changes @apdavison requested and resolved the conflicts. |
|
Hi @Kleinjohann. Thank for the fixes. To me the PR looks fine. The only issue not solved is if SpiketrainProxyObjects should be automagically loaded for merging as suggested by @samuelgarcia. |
|
@JuliaSprenger I went with @apdavison 's remark in #652 (comment) and changed the behaviour to returning an error instead of loading automagically. |
|
Ok, then we can leave the |
Addresses #632
I extended the
spiketrain.mergefunction to an arbitrary number of arguments with the interfacedef merge(self, *others)in order not to change anything for the case of just merging two spiketrains as suggested in #632 (comment)I similarly extended
BaseNeo.mergeandBaseNeo.merge_annotationsin order to be able to merge the annotations correctly.