Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable offset, conversion and channel conversion in mock_ElectricalSeries #1796

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add `NWBHDF5IO.can_read()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
- Add `pynwb.get_nwbfile_version()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
- Updated timeseries data checks to warn instead of error when reading invalid files. @stephprince [#1793](https://github.com/NeurodataWithoutBorders/pynwb/pull/1793)
- Expose the offset, conversion and channel conversion parameters in `mock_ElectricalSeries`. @h-mayorquin [#1796](https://github.com/NeurodataWithoutBorders/pynwb/pull/1796)

## PyNWB 2.5.0 (August 18, 2023)

Expand Down
8 changes: 7 additions & 1 deletion src/pynwb/testing/mock/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def mock_ElectricalSeries(
timestamps=None,
electrodes: Optional[DynamicTableRegion] = None,
filtering: str = "filtering",
nwbfile: Optional[NWBFile] = None
nwbfile: Optional[NWBFile] = None,
channel_conversion: Optional[np.ndarray] = None,
conversion: float = 1.0,
offset: float = 0.,
) -> ElectricalSeries:
electrical_series = ElectricalSeries(
name=name or name_generator("ElectricalSeries"),
Expand All @@ -83,6 +86,9 @@ def mock_ElectricalSeries(
timestamps=timestamps,
electrodes=electrodes or mock_electrodes(nwbfile=nwbfile),
filtering=filtering,
conversion=conversion,
offset=offset,
channel_conversion=channel_conversion,
)

if nwbfile is not None:
Expand Down
Loading