Skip to content

Conversation

@alessandratrapani
Copy link
Collaborator

@alessandratrapani alessandratrapani commented Sep 27, 2023

Fix #395

Add check on ElectricalSeries data type: if the conversion and offset are DEFAULT values and the data type is any integer ("uint16", "int16", etc).

  • add check function
  • add unit tests
  • add check function documentation in ecephys.rst
  • update CHANGELOG.md

@alessandratrapani alessandratrapani added the category: new check a new best practices check to apply to all NWBFiles and their contents label Sep 27, 2023
@alessandratrapani alessandratrapani self-assigned this Sep 27, 2023
@CodyCBakerPhD CodyCBakerPhD changed the title Add check electricalseries of dtype int16 [New Check]: Add check electricalseries of dtype int16 Sep 29, 2023
@CodyCBakerPhD
Copy link
Contributor

Just occurred to me while inspecting some files on the GUIDE; we should also consider the channel_conversion array in this check

If the attribute exists, and the elements of it are not also 1.0, then it's fine to have conversion=1.0 and offset=0.0 because the array of conversion factors is the intended way of specifying that information

bendichter added a commit that referenced this pull request Dec 24, 2025
Add `check_electrical_series_unscaled_data` to warn when ElectricalSeries
has integer data type with default conversion (1.0) and offset (0.0),
which suggests raw acquisition units are not properly scaled to Volts.

The check also considers `channel_conversion` for per-channel scaling
to avoid false positives when proper conversion factors are specified.

Includes documentation for the best practice and changelog entry.

Closes #408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: new check a new best practices check to apply to all NWBFiles and their contents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Add Check]: ElectricalSeries of dtype int16 with conversion=1.0 and offset=0.0 is potentially wrong?

2 participants