Skip to content

Commit

Permalink
add check on electrical series dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandratrapani committed Sep 27, 2023
1 parent c731513 commit d76ecdb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nwbinspector/checks/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,16 @@ def check_spike_times_not_in_unobserved_interval(units_table: Units, nunits: int
"observed intervals."
)
)


@register_check(importance=Importance.CRITICAL, neurodata_type=ElectricalSeries)
def check_electrical_series_dtype(electrical_series: ElectricalSeries):
data = electrical_series.data
if (
np.issubdtype(data.dtype, np.integer)
and electrical_series.conversion == electrical_series.DEFAULT_CONVERSION
and electrical_series.offset == electrical_series.DEFAULT_OFFSET
):
return InspectorMessage(
message="ElectricalSeries data type is integer and conversion factor and offset are both default, the value may not be in the correct unit"
)

0 comments on commit d76ecdb

Please sign in to comment.