From 28acc06e95496436fa308b50920b3378f1c5331d Mon Sep 17 00:00:00 2001 From: alessandratrapani Date: Thu, 8 Aug 2024 16:09:52 +0200 Subject: [PATCH] add nelems to check fun --- src/nwbinspector/checks/time_series.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nwbinspector/checks/time_series.py b/src/nwbinspector/checks/time_series.py index 80d087dd2..ff0dd2d73 100644 --- a/src/nwbinspector/checks/time_series.py +++ b/src/nwbinspector/checks/time_series.py @@ -94,9 +94,9 @@ def check_timestamps_ascending(time_series: TimeSeries, nelems=200): @register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=TimeSeries) -def check_timestamps_with_nans(time_series: TimeSeries): +def check_timestamps_with_nans(time_series: TimeSeries, nelems=200): """Check if there are NaN values in the timestamps array.""" - if time_series.timestamps is not None and np.isnan(time_series.timestamps).any(): + if time_series.timestamps is not None and np.isnan(time_series.timestamps[:nelems]).any(): return InspectorMessage(message=f"{time_series.name} timestamps contain NaN values.")