Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanharvey1 committed Nov 10, 2024
1 parent 9bb2d4a commit 47ee949
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/test_up_down_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ def test_detect_up_down_states_detection():
& (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:
# 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(
(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}."
(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
assert (
up_state_epochs & down_state_epochs
).isempty, "DOWN state detected in UP state."
assert (up_state_epochs & down_state_epochs).isempty, "DOWN state detected in UP state."

0 comments on commit 47ee949

Please sign in to comment.