Skip to content

Commit 0152c5d

Browse files
committed
rmv units_query
1 parent 82c8655 commit 0152c5d

File tree

1 file changed

+2
-8
lines changed
  • element_array_ephys/export/nwb

1 file changed

+2
-8
lines changed

element_array_ephys/export/nwb/nwb.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
167167
def create_units_table(
168168
session_key: dict,
169169
nwbfile: pynwb.NWBFile,
170-
units_query,
171170
paramset_record,
172171
name="units",
173172
desc="data on spiking units"):
@@ -184,7 +183,6 @@ def create_units_table(
184183
----------
185184
session_key: dict
186185
nwbfile: pynwb.NWBFile
187-
units_query: ephys.CuratedClustering.Unit
188186
paramset_record: int
189187
name: str, optional
190188
default="units"
@@ -197,14 +195,13 @@ def create_units_table(
197195

198196
units_table = pynwb.misc.Units(name=name, description=desc)
199197
# add additional columns to the units table
200-
units_query = ephys.CuratedClustering.Unit() & session_key
201198
for additional_attribute in ["cluster_quality_label", "spike_depths"]:
202199
# The `index` parameter indicates whether the column is a "ragged array," i.e.
203200
# whether each row of this column is a vector with potentially different lengths
204201
# for each row.
205202
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,
208205
index=additional_attribute == "spike_depths",
209206
)
210207

@@ -281,15 +278,13 @@ def add_ephys_units_to_nwb(
281278
if nwbfile.electrodes is None:
282279
add_electrodes_to_nwb(session_key, nwbfile)
283280

284-
285281
for paramset_record in (
286282
ephys.ClusteringParamSet & ephys.CuratedClustering & session_key
287283
).fetch("paramset_idx", "clustering_method", "paramset_desc", as_dict=True):
288284
if paramset_record["paramset_idx"] == primary_clustering_paramset_idx:
289285
units_table = create_units_table(
290286
session_key,
291287
nwbfile,
292-
units_query,
293288
paramset_record,
294289
desc=paramset_record["paramset_desc"],
295290
)
@@ -299,7 +294,6 @@ def add_ephys_units_to_nwb(
299294
units_table = create_units_table(
300295
session_key,
301296
nwbfile,
302-
units_query,
303297
paramset_record,
304298
name=name,
305299
desc=paramset_record["paramset_desc"],

0 commit comments

Comments
 (0)