Skip to content

Commit

Permalink
Replace Error raised by less than 5 minutes of data by a Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nabilalibou committed Feb 8, 2024
1 parent ae9ccc7 commit 3f2479e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yasa/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ def __init__(self, raw, eeg_name, *, eog_name=None, emg_name=None, metadata=None

# Extract duration of recording in minutes
duration_minutes = data.shape[1] / sf / 60
assert duration_minutes >= 5, "At least 5 minutes of data is required."
if duration_minutes < 5:
msg = (
"Insufficient data. A minimum of 5 minutes of data is recommended "
"otherwise results may be unreliable."
)
logger.warning(msg)

# Add to self
self.sf = sf
Expand Down

0 comments on commit 3f2479e

Please sign in to comment.