Traceback (most recent call last):
File "/Users/adam.amster/AllenSDK/scripts/vbn_scratch.py", line 71, in <module>
main()
File "/Users/adam.amster/AllenSDK/scripts/vbn_scratch.py", line 61, in main
sess = cache.get_behavior_session(behavior_session_id=1052374521)
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/behavior_project_cache/behavior_neuropixels_project_cache.py", line 171, in get_behavior_session
return self.fetch_api.get_behavior_session(behavior_session_id)
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_neuropixels_project_cloud_api.py", line 70, in get_behavior_session
return BehaviorSession.from_nwb_path(str(data_path))
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/behavior_session.py", line 545, in from_nwb_path
return cls.from_nwb(
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/behavior_session.py", line 489, in from_nwb
stimuli = Stimuli.from_nwb(
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/data_objects/stimuli/stimuli.py", line 44, in from_nwb
p = Presentations.from_nwb(
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/data_objects/stimuli/presentations.py", line 145, in from_nwb
table['is_change'] = is_change_event(stimulus_presentations=table)
File "/Users/adam.amster/AllenSDK/allensdk/brain_observatory/behavior/stimulus_processing.py", line 526, in is_change_event
stimuli = stimuli[~stimulus_presentations['omitted']]
File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 1436, in __invert__
new_data = self._mgr.apply(operator.invert)
File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/internals/managers.py", line 425, in apply
applied = b.apply(f, **kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/pandas/core/internals/blocks.py", line 378, in apply
result = func(self.values, **kwargs)
TypeError: bad operand type for unary ~: 'float'
results in
The issue is that
add_is_change_to_stimulus_presentations_table
is only getting set to false when instantiatingBehaviorEcephysSession
but not when instantiatingBehaviorSession
. See https://github.com/AllenInstitute/AllenSDK/blob/master/allensdk/brain_observatory/ecephys/behavior_ecephys_session.py#L497