Skip to content
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

Account for unidirectional spiketrain->segment links in synchrofact deletion #398

Merged
merged 4 commits into from
Feb 1, 2021

Conversation

Kleinjohann
Copy link
Contributor

See NeuralEnsemble/python-neo#939 for an in-depth description and a minimal example.

This ensures that no error is raised for neo structures with unidirectional uplinks (which can still happen even if this is changed in neo, e.g. if people use an older version or modify the structure manually). The user is warned about the unidirectional link.

This also fixes a bug which occurred when the Synchrotool was initialised with the actual spiketrain list of a segment, so Synchrotool(segment.spiketrains, ...). Due to the execution order in the in-place deletion, the spiketrain was replaced in the list before its index was extracted, resulting in the same error as above.

when passing the actual segment.spiketrains list
to the Synchrotool and performing in-place deletion
the spiketrain was overwritten before its index was determined
resulting in an error
if the spiketrain is not part of a segment and/or block
the `continue` skipped the replacement in the input list
in in-place synchrofact deletion:
catch ValueError and raise UserWarning instead
elephant/spike_train_synchrony.py Outdated Show resolved Hide resolved
elephant/spike_train_synchrony.py Show resolved Hide resolved
@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.03%) to 89.641% when pulling 1876d48 on INM-6:fix/synchrofact_deletion into 1e5e33c on NeuralEnsemble:master.

@dizcza dizcza merged commit f20f071 into NeuralEnsemble:master Feb 1, 2021
@dizcza dizcza deleted the fix/synchrofact_deletion branch February 1, 2021 11:21
@dizcza dizcza added bugfix Fix for an indentified bug. enhancement Editing an existing module, improving something labels Feb 1, 2021
ackurth pushed a commit to INM-6/elephant that referenced this pull request Oct 1, 2021
…eletion (NeuralEnsemble#398)

* Fix a bug in synchrofact deletion

when passing the actual segment.spiketrains list
to the Synchrotool and performing in-place deletion
the spiketrain was overwritten before its index was determined
resulting in an error

* Fix spiketrain replacement being skipped

if the spiketrain is not part of a segment and/or block
the `continue` skipped the replacement in the input list

* Handle unidirectional segment uplinks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix for an indentified bug. enhancement Editing an existing module, improving something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants