You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to solve this issue on spikeextractors, I ran across this problem as a contributing factor. The docstring and overall schema treatment of electrode table IDs mandates they be unique, but we can set them arbitrarily through pynwb.
Steps to Reproduce
import numpy as np
import uuid
from datetime import datetime
import spikeextractors as se
from pynwb import NWBFile
nwbfile_kwargs = dict(
session_description="Testing NWBFile",
identifier=str(uuid.uuid4()),
session_start_time=datetime(1970, 1, 1)
)
nwbfile = NWBFile(**nwbfile_kwargs)
re = se.example_datasets.toy_example()[0]
se.NwbRecordingExtractor.add_devices(recording=re, nwbfile=nwbfile)
se.NwbRecordingExtractor.add_electrode_groups(recording=re, nwbfile=nwbfile)
defaults = dict(
x=np.nan,
y=np.nan,
z=np.nan,
# There doesn't seem to be a canonical default for impedence, if missing.
# The NwbRecordingExtractor follows the -1.0 convention, other scripts sometimes use np.nan
imp=-1.0,
location="unknown",
filtering="none",
group_name="Electrode Group"
)
nwbfile.add_electrode(**dict(defaults, id=0, group=nwbfile.electrode_groups[str(0)]))
nwbfile.add_electrode(**dict(defaults, id=0, group=nwbfile.electrode_groups[str(0)]))
This should throw an error letting the user know to make the ids unique so as not to cause confusion for downstream mapping through the tables.
Description
While trying to solve this issue on spikeextractors, I ran across this problem as a contributing factor. The docstring and overall schema treatment of electrode table IDs mandates they be unique, but we can set them arbitrarily through pynwb.
Steps to Reproduce
This should throw an error letting the user know to make the ids unique so as not to cause confusion for downstream mapping through the tables.
Environment
Checklist
The text was updated successfully, but these errors were encountered: