-
Notifications
You must be signed in to change notification settings - Fork 14
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
PSTH #339
PSTH #339
Conversation
Changes to be committed: modified: syncopy/datatype/__init__.py deleted: syncopy/datatype/statistical_data.py
Update from Dev
- fixed some remaining indexing issues - correct channel labels now Changes to be committed: modified: syncopy/datatype/continuous_data.py modified: syncopy/spikes/compRoutines.py modified: syncopy/spikes/psth.py modified: syncopy/spikes/spike_psth.py
- now it's time to make sense out of the histograms Changes to be committed: modified: syncopy/spikes/compRoutines.py modified: syncopy/spikes/spike_psth.py
- totally random trial definition can produce trials with no events, which causes downstream problems for indexing - massaged the synth generator to always have at least 90% of average trial size nSamples .// nTrials - this might be a problem in RL as well if ppl define trials in empty regions.. Changes to be committed: modified: syncopy/tests/synth_data.py
- added NaN masking for time bins if trial outside of latency - TODO: fix time axis / trialdefinition Changes to be committed: modified: syncopy/datatype/continuous_data.py modified: syncopy/datatype/discrete_data.py modified: syncopy/spikes/compRoutines.py modified: syncopy/spikes/psth.py modified: syncopy/spikes/spike_psth.py modified: syncopy/tests/synth_data.py
- should be investigated why the manual construction of the Indexer to access selected trials outside the CR was necessary Changes to be committed: modified: syncopy/spikes/compRoutines.py modified: syncopy/spikes/psth.py modified: syncopy/spikes/spike_psth.py
Changes to be committed: modified: syncopy/spikes/psth.py new file: syncopy/tests/test_spike_psth.py
Codecov Report
@@ Coverage Diff @@
## dev #339 +/- ##
==========================================
+ Coverage 65.84% 68.89% +3.04%
==========================================
Files 77 77
Lines 8742 8850 +108
Branches 1784 1816 +32
==========================================
+ Hits 5756 6097 +341
+ Misses 2591 2335 -256
- Partials 395 418 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Changes to be committed: modified: syncopy/tests/synth_data.py
syncopy/spikes/spike_psth.py
Outdated
sinfo = data.sampleinfo | ||
trials = data.trials | ||
|
||
lenTrials = np.diff(sinfo).squeeze() |
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.
lenTrials
this seems to be unused
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.
True, this I will remove!
syncopy/spikes/spike_psth.py
Outdated
chan_labels = [f'channel{i}_unit{j}' for i, j in combs] | ||
|
||
# now we have our global (single-trial, avg, std,..) histogram shape | ||
h_shape = (nBins, len(combs)) |
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.
this is not part of this change set, but chan_labels
and h_shape
are also unused
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.
Also here, it's for book keeping of that complicated output shape, yet the chan_labels
already get used in process_metadata
, so I'll remove 'em.
The docstring for the frontend, |
The |
# now map with respect to unit for all single trial channels (-bins) | ||
map_unit = {u: np.logical_or.reduce([map_cu(c, u) for c in chan_vec]) for u in unique_units} | ||
|
||
# map into histogram time x channel dimensions | ||
map_unit_hist = {u: [np.any(map_cu(c, u)) for c in chan_vec] for u in unique_units} | ||
|
||
for i, iunit in enumerate(unique_units): |
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.
again not part of this changeset, but i
is unused, so no need for enumerate
from syncopy.datatype import SpikeData | ||
from syncopy.shared.tools import get_defaults, get_frontend_cfg | ||
from syncopy.datatype import TimeLockData | ||
from syncopy.datatype.base_data import Indexer | ||
|
||
from syncopy.shared.errors import SPYValueError, SPYTypeError, SPYWarning, SPYInfo |
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.
minor: SPYTypeError, SPYWarning, SPYInfo are imported but not used
onset, | ||
trl_end, | ||
chan_unit_combs=None, | ||
tbins=None, | ||
samplerate=1000): |
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.
not part of this changeset, but the docstring for the samplerate
parameter is missing
I implemented it just now :)
yep this still needs to be done! |
- still TODO: 'output' parameter Changes to be committed: modified: syncopy/datatype/base_data.py modified: syncopy/spikes/spike_psth.py
Changes to be committed: modified: syncopy/spikes/psth.py
PSTH 🚀
avg
orvar
will get added onceTimeLockData
is up to speedaddresses #295
Author Guidelines
Reviewer Checklist