Skip to content

Commit 6eab085

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent de3f42a commit 6eab085

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

nwbinspector/checks/time_series.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ def check_regular_timestamps(
1313
time_series: TimeSeries, time_tolerance_decimals: int = 9, gb_severity_threshold: float = 1.0
1414
):
1515
"""If the TimeSeries uses timestamps, check if they are regular (i.e., they have a constant rate)."""
16-
if time_series.timestamps is not None and len(time_series.timestamps) > 2 and check_regular_series(
17-
series=time_series.timestamps, tolerance_decimals=time_tolerance_decimals
16+
if (
17+
time_series.timestamps is not None
18+
and len(time_series.timestamps) > 2
19+
and check_regular_series(series=time_series.timestamps, tolerance_decimals=time_tolerance_decimals)
1820
):
1921
timestamps = np.array(time_series.timestamps)
2022
if timestamps.size * timestamps.dtype.itemsize > gb_severity_threshold * 1e9:

tests/unit_tests/test_time_series.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ def test_check_regular_timestamps():
3737

3838
def test_pass_check_regular_timestamps():
3939
"""Should pass because there are only two timestamps"""
40-
assert check_regular_timestamps(
41-
time_series=pynwb.TimeSeries(
42-
name="test_time_series",
43-
unit="test_units",
44-
data=[0, 0],
45-
timestamps=[1.2, 3.2],
40+
assert (
41+
check_regular_timestamps(
42+
time_series=pynwb.TimeSeries(
43+
name="test_time_series",
44+
unit="test_units",
45+
data=[0, 0],
46+
timestamps=[1.2, 3.2],
47+
)
4648
)
47-
) is None
49+
is None
50+
)
4851

4952

5053
def test_check_data_orientation():

0 commit comments

Comments
 (0)