Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VCN session units access #2403

Closed
danielsf opened this issue Apr 29, 2022 · 0 comments
Closed

Fix VCN session units access #2403

danielsf opened this issue Apr 29, 2022 · 0 comments
Assignees
Labels

Comments

@danielsf
Copy link
Contributor

The fix to the structure acronym handling broke access to the VCN release sessions.

from allensdk.brain_observatory.ecephys.ecephys_project_cache import (
    EcephysProjectCache)
import os
import hashlib
manifest_path = '/allen/aibs/informatics/danielsf/scratch/ecephys_manifest.json'
if os.path.exists(manifest_path):
    os.unlink(manifest_path)

cache = EcephysProjectCache.from_warehouse(manifest=manifest_path)
session = cache.get_session_data(session_id=719161530)
session.units

fails with

  File "test_warehouse.py", line 11, in <module>
    session.units
  File "/home/scott.daniel/AllenSDK/allensdk/core/lazy_property/lazy_property_mixin.py", line 13, in __getattribute__
    curr_attr = super(LazyPropertyMixin, self).__getattribute__(name)
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/ecephys_session.py", line 227, in units
    return self._units.drop(columns=['width_rf',
  File "/home/scott.daniel/AllenSDK/allensdk/core/lazy_property/lazy_property_mixin.py", line 15, in __getattribute__
    return curr_attr.__get__(curr_attr)
  File "/home/scott.daniel/AllenSDK/allensdk/core/lazy_property/lazy_property.py", line 20, in __get__
    self.value = self.calculate()
  File "/home/scott.daniel/AllenSDK/allensdk/core/lazy_property/lazy_property.py", line 30, in calculate
    result = self.api_method(*self.args, **self.kwargs)
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/ecephys_session_api/ecephys_nwb_session_api.py", line 158, in get_units
    isi_violations_maximum=self.isi_violations_maximum
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/probes.py", line 114, in get_units_table
    ) for p in self.probes
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/probes.py", line 114, in <listcomp>
    ) for p in self.probes
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/_channels.py", line 60, in to_dataframe
    channels = [channel.to_dict()['channel'] for channel in self.value]
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/_channels.py", line 60, in <listcomp>
    channels = [channel.to_dict()['channel'] for channel in self.value]
  File "/home/scott.daniel/AllenSDK/allensdk/core/_data_object_base/data_object.py", line 106, in to_dict
    properties = _get_keys_and_values(base_value=value)
  File "/home/scott.daniel/AllenSDK/allensdk/core/_data_object_base/data_object.py", line 89, in _get_keys_and_values
    for name, value in base_value._get_properties().items():
  File "/home/scott.daniel/AllenSDK/allensdk/core/_data_object_base/data_object.py", line 139, in _get_properties
    return {name: getattr(self, name) for name in props}
  File "/home/scott.daniel/AllenSDK/allensdk/core/_data_object_base/data_object.py", line 139, in <dictcomp>
    return {name: getattr(self, name) for name in props}
  File "/home/scott.daniel/AllenSDK/allensdk/brain_observatory/ecephys/_channel.py", line 78, in manual_structure_acronym
    if self._strip_structure_subregion \
AttributeError: 'float' object has no attribute 'split'

I do not think vbn_2022_dev before #2401 was merged.

This ticket is to diagnose and fix this problem so that we do not break access to the VCN 2019 data release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants