Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# |
# `---- Other property b (nix.Property)
traces_md = nf.create_section("traces.metadata",
"spikeinterface.properties")
da.metadata = traces_md
channels = recording.get_channel_ids()
for chan_id in channels:
chan_md = traces_md.create_section(str(chan_id),
"spikeinterface.properties")
for propname in recording.get_channel_property_names(chan_id):
propvalue = recording.get_channel_property(chan_id, propname)
if nf.version <= (1, 1, 0):
if isinstance(propvalue, Iterable):
values = list(map(nix.Value, propvalue))
else:
values = nix.Value(propvalue)
else:
values = propvalue
chan_md.create_property(propname, values)
nf.close()
spikes_md = nf.create_section("spikes.metadata",
"spikeinterface.properties")
for da in spikes_das:
da.metadata = spikes_md
units = sorting.get_unit_ids()
for unit_id in units:
unit_md = spikes_md.create_section(str(unit_id),
"spikeinterface.properties")
for propname in sorting.get_unit_property_names(unit_id):
propvalue = sorting.get_unit_property(unit_id, propname)
if nf.version <= (1, 1, 0):
if isinstance(propvalue, Iterable):
values = list(map(nix.Value, propvalue))
else:
values = nix.Value(propvalue)
else:
values = propvalue
unit_md.create_property(propname, values)
nf.close()