Skip to content

Commit c0ba7e1

Browse files
mock_ElectricalSeries : Make number of electrodes between data an electrode region agree when explicitly passing data (#2019)
* make n_electrodes between data and electrode region agree * added changelog * typo * Update CHANGELOG.md Co-authored-by: Steph Prince <[email protected]> --------- Co-authored-by: Steph Prince <[email protected]>
1 parent 739ee54 commit c0ba7e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Deprecated `EventWaveform` neurodata type. @rly [#1940](https://github.com/NeurodataWithoutBorders/pynwb/pull/1940)
1212
- Deprecated `ImageMaskSeries` neurodata type. @rly [#1941](https://github.com/NeurodataWithoutBorders/pynwb/pull/1941)
1313
- Removed python 3.8 support, added python 3.13 support. @stephprince [#2007](https://github.com/NeurodataWithoutBorders/pynwb/pull/2007)
14+
- `mock_ElectricalSeries`. Make number of electrodes between data and electrode region agree when explicitly passing data @h-mayorquin [#2019](https://github.com/NeurodataWithoutBorders/pynwb/pull/2019)
1415

1516
### Documentation and tutorial enhancements
1617
- Updated `SpikeEventSeries`, `DecompositionSeries`, and `FilteredEphys` examples. @stephprince [#2012](https://github.com/NeurodataWithoutBorders/pynwb/pull/2012)

src/pynwb/testing/mock/ecephys.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,16 @@ def mock_ElectricalSeries(
8383

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

8788
electrical_series = ElectricalSeries(
8889
name=name or name_generator("ElectricalSeries"),
8990
description=description,
90-
data=data if data is not None else np.ones((10, 5)),
91+
data=data if data is not None else np.ones((10, n_electrodes)),
9192
rate=rate,
9293
starting_time=starting_time,
9394
timestamps=timestamps,
94-
electrodes=electrodes or mock_electrodes(nwbfile=nwbfile),
95+
electrodes=electrodes or mock_electrodes(nwbfile=nwbfile, n_electrodes=n_electrodes),
9596
filtering=filtering,
9697
conversion=conversion,
9798
offset=offset,

0 commit comments

Comments
 (0)