Skip to content

Commit

Permalink
make n_electrodes between data and electrode region agree
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed Jan 24, 2025
1 parent 739ee54 commit 45e86c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pynwb/testing/mock/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ def mock_ElectricalSeries(

# Set a default rate if timestamps are not provided
rate = 30_000.0 if (timestamps is None and rate is None) else rate
n_electrodes = data.shape[1] if data is not None else 5

electrical_series = ElectricalSeries(
name=name or name_generator("ElectricalSeries"),
description=description,
data=data if data is not None else np.ones((10, 5)),
data=data if data is not None else np.ones((10, n_electrodes)),
rate=rate,
starting_time=starting_time,
timestamps=timestamps,
electrodes=electrodes or mock_electrodes(nwbfile=nwbfile),
electrodes=electrodes or mock_electrodes(nwbfile=nwbfile, n_electrodes=n_electrodes),
filtering=filtering,
conversion=conversion,
offset=offset,
Expand Down

0 comments on commit 45e86c0

Please sign in to comment.