AllenInstitute / npc_sessions

Tools for accessing and packaging data from behavior and epyhys sessions from the Mindscope Neuropixels team, in the cloud.
1 stars 1 forks source link

bad units #101

Open bjhardcastle opened 3 months ago

bjhardcastle commented 3 months ago
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/npc_ephys/units.py", line 269, in make_units_table_from_spike_interface_ks25
    _ = future.result()
  File "/opt/conda/lib/python3.9/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/opt/conda/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/opt/conda/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/conda/lib/python3.9/site-packages/npc_ephys/units.py", line 182, in _device_helper
    df_device_metrics["peak_channel"] = awc.peak_channels
  File "/opt/conda/lib/python3.9/site-packages/pandas/core/frame.py", line 4299, in __setitem__
    self._set_item(key, value)
  File "/opt/conda/lib/python3.9/site-packages/pandas/core/frame.py", line 4512, in _set_item
    value, refs = self._sanitize_column(value)
  File "/opt/conda/lib/python3.9/site-packages/pandas/core/frame.py", line 5253, in _sanitize_column
    com.require_length_match(value, self.index)
  File "/opt/conda/lib/python3.9/site-packages/pandas/core/common.py", line 573, in require_length_match
    raise ValueError(
ValueError: Length of values (1043) does not match length of index (523)

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

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/scripts/write_sessions_to_cache.py", line 88, in <module>
    main()
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/scripts/write_sessions_to_cache.py", line 84, in main
    write_sessions_to_cache(**kwargs)  # type: ignore[misc, arg-type]
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/scripts/write_sessions_to_cache.py", line 73, in write_sessions_to_cache
    helper(
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/scripts/write_sessions_to_cache.py", line 27, in helper
    npc_sessions.write_all_components_to_cache(
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/utils/cache.py", line 248, in write_all_components_to_cache
    component = _get_nwb_component(session, component_name)
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/utils/cache.py", line 101, in _get_nwb_component
    c = getattr(session, component_name, None)
  File "/opt/conda/lib/python3.9/site-packages/npc_io/cached_property.py", line 78, in __get__
    val = self.func(instance)
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/sessions.py", line 1436, in units
    for column in self._units.columns:
  File "/opt/conda/lib/python3.9/site-packages/npc_io/cached_property.py", line 78, in __get__
    val = self.func(instance)
  File "/opt/conda/lib/python3.9/site-packages/npc_sessions/sessions.py", line 1375, in _units
    units=npc_ephys.make_units_table_from_spike_interface_ks25(
  File "/opt/conda/lib/python3.9/site-packages/npc_ephys/units.py", line 280, in make_units_table_from_spike_interface_ks25
    raise RuntimeError(
RuntimeError: Error fetching units for 708016_2024-04-29 - see original exception above/below
arjunsridhar12345 commented 3 months ago

2 probe F folders again like 699847_2024-04-15. One has 523 units in metrics other has 520 units in metrics, adds up to 1043.