Skip to content

Commit

Permalink
remove instance on timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandratrapani committed Sep 25, 2023
1 parent 5f1769a commit 7430e45
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/nwbinspector/checks/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ def check_resolution(time_series: TimeSeries):

@register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=TimeSeries)
def check_rate_is_not_zero(time_series: TimeSeries):
if time_series.data is None and time_series.timestamps is None:
if time_series.data is None:
return
data_shape = get_data_shape(time_series.data)
timestamps_shape = get_data_shape(time_series.timestamps)
if time_series.rate == 0.0 and (data_shape[0] > 1 or timestamps_shape[0] > 1):
return InspectorMessage(f"{time_series.name} has a sampling rate value of 0.0Hz but the series has more than one frame.")
data_shape = get_data_shape(time_series.data)
if time_series.rate == 0.0 and data_shape[0] > 1:
return InspectorMessage(
f"{time_series.name} has a sampling rate value of 0.0Hz but the series has more than one frame."
)

0 comments on commit 7430e45

Please sign in to comment.