Skip to content

Commit

Permalink
Replace Error raised by less than 5 minutes of data by a Warning (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabilalibou authored Feb 13, 2024
1 parent ae9ccc7 commit 33dbd9d
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 33dbd9d

Please sign in to comment.