elephant icon indicating copy to clipboard operation
elephant copied to clipboard

[Feature] Bring all spike triggered statistics to the same category

Open morales-gregorio opened this issue 4 years ago • 2 comments

Right now there exists elephant.sta and elephant.phase_analysis, the latter containing one single function that is spike_triggered_phase.

I would suggest moving spike_triggered_phase into elephant.sta, since it feel like the right place for it. Also in the documentation Spike triggered average could be renamed Spike triggered statistics or something like that.

I am not sure if this is too disruptive, and would not want to cause confusion by messing with other user's imports.

Let me know if you think this should come all together.

Best, Aitor

morales-gregorio avatar Apr 30 '20 08:04 morales-gregorio

I agree, the current state of this structure leaves room for improvement. Thanks for pointing this out.

sta.py

It seems the module sta.py originally contained only the spike_triggered_average function, hence the naming(?). More general it contains analysis methods with analog signals and spiketrains, maybe this could be used as a guiding principle for this module, i.e. sta.py contains all analysis methods involving analog signals in combination with spiketrains. If this case a renaming of the module seems sensible. https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/sta.py#L33 https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/sta.py#L194

phase_analysis.py

On the other hand phase_analysis.py has been developed since and now contains several functions, which all carry out analysis involving phase. https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/phase_analysis.py#L31 https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/phase_analysis.py#L208 https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/phase_analysis.py#L265 https://github.com/NeuralEnsemble/elephant/blob/b263ffe80e5ab759288ad25331cde4f6a359f3ec/elephant/phase_analysis.py#L300 At this point it seems sensible to keep phase_analysis.py as it is and maybe consider renaming/restructuring sta.py.

Furthermore, the documentation for both modules should be reworked in this context (doc/reference/sta.rstand doc/reference/phase_analysis.rst). An updated documentation might clarify the intended structure for both modules.

Moritz-Alexander-Kern avatar Mar 02 '22 11:03 Moritz-Alexander-Kern

As discussed in the elephant meeting today:

  • refactor sta to spike_lfp_analysis or spike_triggered_average ?

Moritz-Alexander-Kern avatar Dec 05 '22 11:12 Moritz-Alexander-Kern