Skip to content

Commit

Permalink
fix sharpwave num_peaks
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmerk committed Jan 31, 2025
1 parent 6a3b916 commit 311cf69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py_neuromodulation/features/sharpwaves.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ def calc_feature(self, data: np.ndarray) -> dict:

# for each feature take the respective fun.
for feature_name, estimator_name, estimator in estimator_combinations:
if feature_name == "num_peaks":
key_name = f"{ch_name}_Sharpwave_{feature_name}_{filter_name}"
if len(waveform_results[feature_name]) == 1:
dict_ch_features[key_name][key_name_pt] = waveform_results[feature_name][0]
continue
else:
raise ValueError("num_peaks should be a list with length 1")
# there can be only one num_peak in each batch
feature_data = waveform_results[feature_name]
key_name = f"{ch_name}_Sharpwave_{estimator_name.title()}_{feature_name}_{filter_name}"

Expand Down

0 comments on commit 311cf69

Please sign in to comment.