Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanharvey1 committed Nov 10, 2024
1 parent 77fb198 commit 9bb2d4a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/test_up_down_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def test_detect_up_down_states_detection():

# Mock data generation
down_state_times = [4, 7, 15]

Expand Down Expand Up @@ -41,3 +41,23 @@ def test_detect_up_down_states_detection():
(down_state_time >= down_state_intervals[:, 0])
& (down_state_time <= down_state_intervals[:, 1])
), f"DOWN state at {down_state_time} not detected."

# Check UP states detected in high activity periods
up_state_intervals = up_state_epochs.time
for down_state_time in down_state_times:
assert not any(
(down_state_time >= up_state_intervals[:, 0])
& (down_state_time <= up_state_intervals[:, 1])
), f"UP state at {down_state_time} detected."

# Check that DOWN states are not detected in UP states
for up_state_interval in up_state_intervals:
assert not any(
(up_state_interval[0] >= down_state_intervals[:, 0])
& (up_state_interval[0] <= down_state_intervals[:, 1])
), f"DOWN state detected in UP state {up_state_interval}."

# Check that DOWN states are not detected in UP states
assert (
up_state_epochs & down_state_epochs
).isempty, "DOWN state detected in UP state."

0 comments on commit 9bb2d4a

Please sign in to comment.