Skip to content

Commit

Permalink
Fix issue with certain numpy versions and np.delete
Browse files Browse the repository at this point in the history
The syntax for np.delete with a boolean mask may not work as intended.
  • Loading branch information
ryanharvey1 committed Jan 22, 2025
1 parent 5d5f140 commit 2448734
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neuro_py/session/locate_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ def find_multitask_pre_post(
task_bool = env.str.contains(task_tag, case=False)
sleep_bool = env.str.contains("sleep", case=False)

# find the task indices
task_idx = np.where(task_bool)[0]
task_idx = np.delete(task_idx, task_idx == 0, 0)
# remove 0 index, task can never be first
task_idx = task_idx[task_idx != 0]
# find the sleep indices
sleep_idx = np.where(sleep_bool)[0]

pre_task_post = []
Expand Down

0 comments on commit 2448734

Please sign in to comment.