@@ -167,7 +167,6 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
167
167
def create_units_table (
168
168
session_key : dict ,
169
169
nwbfile : pynwb .NWBFile ,
170
- units_query ,
171
170
paramset_record ,
172
171
name = "units" ,
173
172
desc = "data on spiking units" ):
@@ -184,7 +183,6 @@ def create_units_table(
184
183
----------
185
184
session_key: dict
186
185
nwbfile: pynwb.NWBFile
187
- units_query: ephys.CuratedClustering.Unit
188
186
paramset_record: int
189
187
name: str, optional
190
188
default="units"
@@ -197,14 +195,13 @@ def create_units_table(
197
195
198
196
units_table = pynwb .misc .Units (name = name , description = desc )
199
197
# add additional columns to the units table
200
- units_query = ephys .CuratedClustering .Unit () & session_key
201
198
for additional_attribute in ["cluster_quality_label" , "spike_depths" ]:
202
199
# The `index` parameter indicates whether the column is a "ragged array," i.e.
203
200
# whether each row of this column is a vector with potentially different lengths
204
201
# for each row.
205
202
units_table .add_column (
206
- name = units_query . heading . attributes [ additional_attribute ]. name ,
207
- description = units_query .heading .attributes [additional_attribute ].comment ,
203
+ name = additional_attribute ,
204
+ description = ephys . CuratedClustering . Unit .heading .attributes [additional_attribute ].comment ,
208
205
index = additional_attribute == "spike_depths" ,
209
206
)
210
207
@@ -281,15 +278,13 @@ def add_ephys_units_to_nwb(
281
278
if nwbfile .electrodes is None :
282
279
add_electrodes_to_nwb (session_key , nwbfile )
283
280
284
-
285
281
for paramset_record in (
286
282
ephys .ClusteringParamSet & ephys .CuratedClustering & session_key
287
283
).fetch ("paramset_idx" , "clustering_method" , "paramset_desc" , as_dict = True ):
288
284
if paramset_record ["paramset_idx" ] == primary_clustering_paramset_idx :
289
285
units_table = create_units_table (
290
286
session_key ,
291
287
nwbfile ,
292
- units_query ,
293
288
paramset_record ,
294
289
desc = paramset_record ["paramset_desc" ],
295
290
)
@@ -299,7 +294,6 @@ def add_ephys_units_to_nwb(
299
294
units_table = create_units_table (
300
295
session_key ,
301
296
nwbfile ,
302
- units_query ,
303
297
paramset_record ,
304
298
name = name ,
305
299
desc = paramset_record ["paramset_desc" ],
0 commit comments