catalystneuro / neuroconv

Create NWB files by converting and combining neural data in proprietary formats and adding essential metadata.
https://neuroconv.readthedocs.io
BSD 3-Clause "New" or "Revised" License
51 stars 22 forks source link

[Bug]: `write_waveforms` fails due to misnamed variable #798

Closed aidapiccato closed 2 months ago

aidapiccato commented 7 months ago

What happened?

Writing waveforms to an NWB file fails due to a variable naming error on line 1442 of neuroconv/src/neuroconv/tools/spikeinterface/spikeinterface.py. nwbfile is passed as an argument to write_waveforms. This should be nwbfile_out - nwbfile is an optional parameter that is set as default to None.

Steps to Reproduce

from neuroconv.tools.spikeinterface import write_waveforms
write_waveforms(
        waveform_extractor=waveform_extractor,
        nwbfile_path=nwbfile_path,
        overwrite=False,
        write_as='units',
)

Traceback

No response

Operating System

macOS

Python Executable

Python

Python Version

3.11

Package Versions

aiobotocore==2.11.2 aiohttp==3.8.4 aioitertools==0.11.0 aiosignal==1.3.1 altair==5.0.0 anyio==3.6.2 appdirs==1.4.4 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 arrow==1.2.3 asciitree==0.3.3 asttokens==2.2.1 async-timeout==4.0.2 attrs==22.2.0 backcall==0.2.0 beautifulsoup4==4.12.1 bidsschematools==0.7.2 bleach==6.0.0 blessed==1.20.0 boto3==1.26.133 botocore==1.34.34 cbor2==5.4.6 certifi @ file:///work/ci_py311/certifi_1676822443922/work/certifi cffi==1.15.1 charset-normalizer==3.1.0 ci-info==0.3.0 click==8.1.3 click-didyoumean==0.3.0 cloudpickle==2.2.1 cmake==3.26.4 colorlog==6.7.0 comm==0.1.3 contourpy==1.0.7 cryptography==40.0.2 cycler==0.11.0 Cython==0.29.34 dandi==0.59.1 dandischema==0.8.4 dask==2023.5.0 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 distinctipy==1.2.2 distributed==2023.5.0 dnspython==2.5.0 elephant==0.12.0 email-validator==2.1.0.post1 entrypoints==0.4 etelemetry==0.3.1 executing==1.2.0 fasteners==0.18 fastjsonschema==2.16.3 figurl==0.2.18 filelock==3.12.2 flake8==6.0.0 fonttools==4.39.2 fqdn==1.5.1 frozenlist==1.3.3 fscacher==0.4.0 fsspec==2024.2.0 globus-sdk==3.19.0 graphviz==0.20.1 h5py==3.8.0 hdf5storage==0.1.19 hdmf==3.6.1 humanize==4.9.0 ibl-neuropixel==0.5.3 ibllib==2.22.3 iblutil==1.6.0 idna==3.4 imageio==2.28.1 importlib-metadata==6.6.0 iniconfig==2.0.0 interleave==0.2.1 ipykernel==6.22.0 ipympl==0.9.3 ipython==8.12.0 ipython-genutils==0.2.0 ipywidgets==8.0.6 isodate==0.6.1 isoduration==20.11.0 jaraco.classes==3.3.0 jedi==0.18.2 jeepney==0.8.0 Jinja2==3.1.2 jmespath==1.0.1 joblib==1.2.0 jsonpointer==2.3 jsonschema==4.17.3 jupyter==1.0.0 jupyter-console==6.6.3 jupyter-events==0.6.3 jupyter_client==8.1.0 jupyter_core==5.3.0 jupyter_server==2.5.0 jupyter_server_terminals==0.4.4 jupyterlab-pygments==0.2.2 jupyterlab-widgets==3.0.7 kachery-cloud==0.4.2 keyring==24.3.0 keyrings.alt==5.0.0 kiwisolver==1.4.4 labcams==0.6.5 lazy-ops==0.2.0 lazy_loader==0.2 lit==16.0.6 llvmlite==0.40.0 locket==1.0.0 lxml==4.9.2 markdown-it-py==3.0.0 MarkupSafe==2.1.2 matplotlib==3.7.1 matplotlib-inline==0.1.6 mccabe==0.7.0 mdurl==0.1.2 MEArec==1.8.0 MEAutility==1.5.1 mistune==2.0.5 more-itertools==10.2.0 mpmath==1.3.0 msgpack==1.0.5 mtscomp==1.0.2 multidict==6.0.4 natsort==8.3.1 nbclassic==0.5.5 nbclient==0.7.3 nbconvert==7.3.0 nbformat==5.8.0 neo==0.13.0 nest-asyncio==1.5.6 networkx==3.1 notebook==6.5.3 notebook_shim==0.2.2 npTDMS==1.6.2 nptyping==2.5.0 numba==0.57.0 numcodecs==0.11.0 numpy==1.24.2 nvidia-cublas-cu11==11.10.3.66 nvidia-cuda-cupti-cu11==11.7.101 nvidia-cuda-nvrtc-cu11==11.7.99 nvidia-cuda-runtime-cu11==11.7.99 nvidia-cudnn-cu11==8.5.0.96 nvidia-cufft-cu11==10.9.0.58 nvidia-curand-cu11==10.2.10.91 nvidia-cusolver-cu11==11.4.0.1 nvidia-cusparse-cu11==11.7.4.91 nvidia-nccl-cu11==2.14.3 nvidia-nvtx-cu11==11.7.91 nwbinspector==0.4.33 ONE-api==2.0.0 open-ephys-python-tools==0.1.6 opencv-python==4.7.0.72 opencv-python-headless==4.7.0.72 packaging==23.0 pandas==1.5.3 pandocfilters==1.5.0 parso==0.8.3 partd==1.4.0 pexpect==4.8.0 phylib==2.4.3 pickleshare==0.7.5 Pillow==9.4.0 PIMS==0.6.1 platformdirs==3.2.0 pluggy==1.0.0 probeinterface==0.2.21 prometheus-client==0.16.0 prompt-toolkit==3.0.38 psutil==5.9.4 ptyprocess==0.7.0 pubnub==6.3.3 pure-eval==0.2.2 pyarrow==12.0.0 pycodestyle==2.10.0 pycparser==2.21 pycryptodomex==3.18.0 pydantic==1.10.14 pyEDFlib==0.1.32 pyflakes==3.0.1 Pygments==2.14.0 PyJWT==2.7.0 pynapple==0.5.1 pynrrd==1.0.0 pynwb==2.3.2 pyout==0.7.3 pyparsing==3.0.9 PyQt5==5.15.9 PyQt5-Qt5==5.15.2 PyQt5-sip==12.12.1 pyqtgraph==0.13.3 PyQtWebEngine==5.15.6 PyQtWebEngine-Qt5==5.15.2 pyrsistent==0.19.3 pyserial==3.5 pytest==7.3.1 python-dateutil==2.8.2 python-json-logger==2.0.7 pytz==2023.2 PyWavelets==1.4.1 PyYAML==6.0 pyzmq==25.0.2 qtconsole==5.4.2 QtPy==2.3.1 quantities==0.14.1 requests==2.30.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rfc3987==1.3.8 rich==13.7.0 ruamel.yaml==0.17.26 ruamel.yaml.clib==0.2.7 s3fs==2024.2.0 s3transfer==0.6.1 scikit-image==0.20.0 scikit-learn==1.2.2 scikit-video==1.1.11 scipy==1.10.1 seaborn==0.12.2 SecretStorage==3.3.3 semantic-version==2.10.0 Send2Trash==1.8.0 simplejson==3.19.1 six==1.16.0 slicerator==1.1.0 slidingRP==1.0.0 sniffio==1.3.0 sortedcontainers==2.4.0 sortingview==0.11.15 soupsieve==2.4 spikeinterface==0.100.0 stack-data==0.6.2 sympy==1.12 tabulate==0.9.0 tblib==1.7.0 tenacity==8.2.3 terminado==0.17.1 threadpoolctl==3.1.0 tifffile==2023.4.12 tinycss2==1.2.1 toolz==0.12.0 torch==2.0.0 tornado==6.2 tqdm==4.65.0 traitlets==5.9.0 triton==2.0.0 typing_extensions==4.9.0 uri-template==1.2.0 urllib3==1.26.15 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.5.1 wfield==0.3.7 widgetsnbextension==4.0.7 wrapt==1.16.0 xarray==2023.5.0 yarl==1.9.2 zarr==2.14.2 zarr-checksum==0.4.0 zict==3.0.0 zipp==3.15.0 zmq==0.0.0

Code of Conduct

CodyCBakerPhD commented 7 months ago

Good catch, unsure why previous tests didn't find this

Asked @alejoe91 about that in #799

h-mayorquin commented 2 months ago

Need to check if the new analyzer inherited this and will close if it does not.

h-mayorquin commented 2 months ago

OK, closing this, the new sorting_analyzer writing does not have this problem:

https://github.com/catalystneuro/neuroconv/blob/11a45df35016d0061f5e8d76b81981421f0d65d8/src/neuroconv/tools/spikeinterface/spikeinterface.py#L2139-L2161

and we deprecated write_waveforms