Skip to content

Commit

Permalink
Handle numpy arrays (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno authored Jan 16, 2024
1 parent a8dcea8 commit 6705ee0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/spyglass/lfp/lfp_electrode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datajoint as dj
from numpy import ndarray

from spyglass.common.common_ephys import Electrode
from spyglass.common.common_session import Session # noqa: F401
Expand Down Expand Up @@ -48,6 +49,9 @@ def create_lfp_electrode_group(
as_dict=True
)
primary_key = Electrode.primary_key
if isinstance(electrode_list, ndarray):
# convert to list if it is an numpy array
electrode_list = list(electrode_list.astype(int).reshape(-1))
for e in all_electrodes:
# create a dictionary so we can insert the electrodes
if e["electrode_id"] in electrode_list:
Expand Down

0 comments on commit 6705ee0

Please sign in to comment.