catalystneuro / tye-lab-to-nwb

NWB Conversion project for the Tye lab at the Salk Institute.
MIT License
0 stars 0 forks source link

Update custom behavior interfaces to latest NeuroConv #33

Closed CodyCBakerPhD closed 11 months ago

CodyCBakerPhD commented 11 months ago

Darn, got a new error:

(tye_lab_to_nwb_env) lkeyes@node32:/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb$ python src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_al
  0%|                                                                                                                                                          Source data is valid!
                                                                                                                                                               concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/concurrent/futures/process.py", line 256, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nadata/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb/src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_session.py", line 149, in session_to_nwb
    converter = NeurotensinValenceNWBConverter(source_data=source_data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/site-packages/neuroconv/nwbconverter.py", line 65, in __init__
    self.data_interface_objects = {
                                  ^
  File "/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/site-packages/neuroconv/nwbconverter.py", line 66, in <dictcomp>
    name: data_interface(**source_data[name])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class NeurotensinDeepLabCutInterface with abstract method add_to_nwbfile
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/nadata/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb/src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_all_sessions.py", line 93, in <module>
    parallel_convert_sessions(
  File "/nadata/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb/src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_all_sessions.py", line 83, in parallel_convert_sessions
    future.result()
  File "/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
TypeError: Can't instantiate abstract class NeurotensinDeepLabCutInterface with abstract method add_to_nwbfile

Originally posted by @laurelrr in https://github.com/catalystneuro/tye-lab-to-nwb/issues/29#issuecomment-1739987761

CodyCBakerPhD commented 11 months ago

@weiglszonja Should be easy, instead of that stuff in run_conversion here just define mapping protocol in add_to_nwbfile

Also if you could triple check that a unified (all data streams) conversion runs in the fresh environment, that would be awesome

weiglszonja commented 11 months ago

@laurelrr I apologise for this oversight! I opened #34 that should fix this.

CodyCBakerPhD commented 11 months ago

@laurelrr OK can you try to pull the latest changes and let us know of any further issues?

laurelrr commented 11 months ago

I pulled in your changes with git pull Then attempted to convert the same subject file using: python src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_all_sessions.py Did I miss a step?
I immediately got this error:

(tye_lab_to_nwb_env) lkeyes@node32:/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb$ python src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_al                                              l_sessions.py
Traceback (most recent call last):
  File "/nadata/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb/src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_all_sessions.py", line 13, in                                               <module>
    from tye_lab_to_nwb.neurotensin_valence.neurotensin_valence_convert_session import session_to_nwb
  File "/nadata/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb/src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_convert_session.py", line 16, in <modu                                              le>
    from nwbinspector import inspect_nwbfile
ImportError: cannot import name 'inspect_nwbfile' from 'nwbinspector' (/home/lkeyes/anaconda3/envs/tye_lab_to_nwb_env/lib/python3.11/site-packages/nwbinspector                                              /__init__.py)
CodyCBakerPhD commented 11 months ago

@laurelrr Might be worth trying @weiglszonja's steps in https://github.com/catalystneuro/tye-lab-to-nwb/pull/34#issuecomment-1740606634 to create a new fresh environment; it looks like external packages might have gotten a little out of sync otherwise

laurelrr commented 11 months ago

Thanks, I'll try that on Monday.

laurelrr commented 11 months ago

I got an error while trying @weiglszonja's steps in https://github.com/catalystneuro/tye-lab-to-nwb/pull/34#issuecomment-1740606634 to create a new fresh environment:

conda create --name tyenwb39 python=3.9
conda activate tyenwb39
pip install -r src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_requirements.txt

gave this error:

(tyenwb39) lkeyes@node32:/snlkt/home/lkeyes/Projects/GIT/tye-lab-to-nwb$ pip install -r src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_requirements.txt
Obtaining neuroconv from git+https://github.com/catalystneuro/neuroconv@add_ignore_timestamps_errors_to_interface#egg=neuroconv (from -r src/tye_lab_to_nwb/neurotensin_valence/neurotensin_valence_requirements.txt (line 1))
  Updating ./src/neuroconv clone (to revision add_ignore_timestamps_errors_to_interface)
  Running command git fetch -q --tags
  fatal: pack has 5 unresolved deltas
  fatal: index-pack failed
  error: subprocess-exited-with-error

  × git fetch -q --tags did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git fetch -q --tags did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I attempted to pip uninstall neuroconv but it is not installed in this environment.
Thanks

laurelrr commented 11 months ago

This is what is in my current neurotensin_valence_requirements.txt:

-e git+https://github.com/catalystneuro/neuroconv@add_ignore_timestamps_errors_to_interface#egg=neuroconv
neuroconv[openephys,plexon,video]
git+https://github.com/neuralensemble/python-neo@master
ndx_pose>=0.1.1
oiffile==2022.9.29
easydict>=1.10
openpyxl>=3.1.2