Skip to content

Commit dae36d1

Browse files
author
Thinh Nguyen
committed
fix NWB export - null waveforms - back to version 0.1.0b1
1 parent 6107e8e commit dae36d1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

55

6-
## [0.1.0b2] - 2021-11-29
6+
## [0.1.0b1] - 2021-11-29
77
### Added
88
+ NWB export
99
+ Processing with Kilosort and pyKilosort for Open Ephys and SpikeGLX

element_array_ephys/export/nwb.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,17 @@ def curated_clusterings_to_nwb(curated_clustering_keys, nwbfile, ephys_module=No
100100
# ---- Units ----
101101
unit_query = clustering_query @ ephys.CuratedClustering.Unit
102102
for unit in unit_query.fetch(as_dict=True):
103+
waveform_mean = waveform_std = np.full(1, np.nan)
103104
if ephys.WaveformSet & curated_clustering_key & {'unit': unit['unit']}:
104105
waveform_mean = (ephys.WaveformSet.PeakWaveform
105106
& curated_clustering_key
106107
& {'unit': unit['unit']}).fetch1('peak_electrode_waveform')
107108
# compute waveform's STD across spikes from the peak electrode
108-
waveform_std = np.std((ephys.WaveformSet.Waveform & curated_clustering_key
109+
electrode_waveforms = (ephys.WaveformSet.Waveform & curated_clustering_key
109110
& {'unit': unit['unit']}
110-
& {'electrode': unit['electrode']}).fetch1('waveforms'), axis=0)
111-
else:
112-
waveform_mean = waveform_std = np.full(1, np.nan)
111+
& {'electrode': unit['electrode']}).fetch1('waveforms')
112+
if electrode_waveforms is not None:
113+
waveform_std = np.std(electrode_waveforms, axis=0)
113114

114115
nwbfile.add_unit(id=unit['unit'],
115116
electrodes=np.where(nwbfile.electrodes.id.data == int(unit['electrode']))[0],

element_array_ephys/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Package metadata."""
2-
__version__ = '0.1.0b2'
2+
__version__ = '0.1.0b1'

0 commit comments

Comments
 (0)