for key, values in session.get_stimulus_parameter_values().items():
print(f'{key}: {values}')
Error message:
TypeError Traceback (most recent call last)
Input In [19], in <cell line: 1>()
----> 1 for key, values in session.get_stimulus_parameter_values().items():
2 print(f'{key}: {values}')
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/allensdk/brain_observatory/ecephys/ecephys_session.py:1039, in EcephysSession.get_stimulus_parameter_values(self, stimulus_presentation_ids, drop_nulls)
1037 non_null = np.array(uniques[uniques != "null"])
1038 non_null = non_null
-> 1039 non_null = np.sort(non_null)
1041 if not drop_nulls and "null" in uniques:
1042 non_null = np.concatenate([non_null, ["null"]])
File <__array_function__ internals>:5, in sort(*args, **kwargs)
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/numpy/core/fromnumeric.py:996, in sort(a, axis, kind, order)
994 else:
995 a = asanyarray(a).copy(order="K")
--> 996 a.sort(axis=axis, kind=kind, order=order)
997 return a
TypeError: '<' not supported between instances of 'float' and 'str'
problem in cell 28:
units_of_interest = high_snr_unit_ids[:35]
waveforms = {uid: session.mean_waveforms[uid] for uid in units_of_interest}
peak_channels = {uid: session.units.loc[uid, 'peak_channel_id'] for uid in units_of_interest}
plot the mean waveform on each unit's peak channel/
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/pandas/_libs/index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/pandas/_libs/index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()
File pandas/_libs/hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas/_libs/hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'local_index'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Input In [31], in <cell line: 3>()
1 units_of_interest = high_snr_unit_ids[:35]
----> 3 waveforms = {uid: session.mean_waveforms[uid] for uid in units_of_interest}
4 peak_channels = {uid: session.units.loc[uid, 'peak_channel_id'] for uid in units_of_interest}
6 # plot the mean waveform on each unit's peak channel/
Input In [31], in (.0)
1 units_of_interest = high_snr_unit_ids[:35]
----> 3 waveforms = {uid: session.mean_waveforms[uid] for uid in units_of_interest}
4 peak_channels = {uid: session.units.loc[uid, 'peak_channel_id'] for uid in units_of_interest}
6 # plot the mean waveform on each unit's peak channel/
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/allensdk/core/lazy_property/lazy_property.py:20, in LazyProperty.get(self, obj, objtype)
17 return self
19 if self.value is None:
---> 20 self.value = self.calculate()
21 return self.value
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/allensdk/core/lazy_property/lazy_property.py:32, in LazyProperty.calculate(self)
30 result = self.api_method(*self.args, **self.kwargs)
31 for wrapper in self.wrappers:
---> 32 result = wrapper(result)
33 return result
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/allensdk/brain_observatory/ecephys/ecephys_session.py:1244, in EcephysSession._build_mean_waveforms(self, mean_waveforms)
1242 channel_id_lut = defaultdict(lambda: -1)
1243 for cid, row in self.channels.iterrows():
-> 1244 channel_id_lut[(row["local_index"], row["probe_id"])] = cid
1246 probe_id_lut = {
1247 uid: row['probe_id'] for uid, row in self._units.iterrows()
1248 }
1250 output_waveforms = {}
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/pandas/core/series.py:981, in Series.getitem(self, key)
978 return self._values[key]
980 elif key_is_scalar:
--> 981 return self._get_value(key)
983 if is_hashable(key):
984 # Otherwise index.get_value will raise InvalidIndexError
985 try:
986 # For labels that don't resolve as scalars like tuples and frozensets
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/pandas/core/series.py:1089, in Series._get_value(self, label, takeable)
1086 return self._values[label]
1088 # Similar to Index.get_value, but we do not fall back to positional
-> 1089 loc = self.index.get_loc(label)
1090 return self.index._get_values_for_loc(self, loc, label)
File ~/.conda/envs/TorchOnGPUs/lib/python3.8/site-packages/pandas/core/indexes/base.py:3805, in Index.get_loc(self, key, method, tolerance)
3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
-> 3805 raise KeyError(key) from err
3806 except TypeError:
3807 # If we have a listlike key, _check_indexing_error will raise
3808 # InvalidIndexError. Otherwise we fall through and re-raise
3809 # the TypeError.
3810 self._check_indexing_error(key)
KeyError: 'local_index'
To Reproduce
Conda Virtual env setup:
I created a new conda env in a node with A100 GPU on HPC using the following steps:
Describe the bug When running the example python notebook given in https://allensdk.readthedocs.io/en/latest/_static/examples/nb/ecephys_session.html, the allensdk2.13.6 showed two errors in two different cells.
problem in cell 28:
Error message:
To Reproduce
Run the notebook cell by cell The notebook I downloaded is from https://allensdk.readthedocs.io/en/latest/_static/examples/nb/ecephys_session.html. Just run from the top to the cell number 17 and cell number 28 should reproduce this error.
Expected behavior
for cell 17, we expect
for cell 28, we expect a figure like being shown in the example notebook in https://allensdk.readthedocs.io/en/latest/_static/examples/nb/ecephys_session.html
Actual Behavior The errors are mentioned above.
Environment (please complete the following information):
Additional context
Do you want to work on this issue? I am not capable of solving this problem.