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

[ENH] add include_t_stop flag to Synchrotool class, Issue 493 #637

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

Moritz-Alexander-Kern
Copy link
Member

@Moritz-Alexander-Kern Moritz-Alexander-Kern commented Jul 17, 2024

This PR adresses #493.

New feature: include_t_stop flag in Synchrotool class

This pull request introduces a new feature to the Synchrotool class by adding the include_t_stop flag. This allows users to include the end of the spike train (t_stop) in the analysis, ensuring that any spikes close to t_stop are properly annotated.

Summary of changes

  • added include_t_stop as a new optional boolean parameter to the Synchrotool class constructor. If set to True, the spikes close to t_stop of the spike train are included in the analysis.
  • added description of the new parameter to the Synchrotool class docstring.

Examples

The following minimal example should not longer raise an index out of bounds error:

import neo
import numpy as np
import quantities as pq
from elephant.spike_train_synchrony import Synchrotool

sampling_rate = 1/pq.ms
st = neo.SpikeTrain(np.arange(0, 11)*pq.ms, t_start=0*pq.ms, t_stop=10*pq.ms)

synchrotool_instance = Synchrotool([st, st], sampling_rate, spread=0, include_t_stop=True)
synchrotool_instance.annotate_synchrofacts()

@Moritz-Alexander-Kern Moritz-Alexander-Kern added the enhancement Editing an existing module, improving something label Jul 17, 2024
@Moritz-Alexander-Kern Moritz-Alexander-Kern changed the title [Fix] Index error synchrotool Issue 493 [ENH] add include_t_stop flag to Synchrotool class, Issue 493 Jul 17, 2024
@coveralls
Copy link
Collaborator

coveralls commented Jul 17, 2024

Coverage Status

coverage: 88.371% (+0.02%) from 88.35%
when pulling b2e32ab on INM-6:fix/index_error_synchrotool_493
into 0984e19 on NeuralEnsemble:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Editing an existing module, improving something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] IndexError in spike_train_synchrony.py, annotate_synchrofacts
2 participants