-
Notifications
You must be signed in to change notification settings - Fork 1
Calib fix #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calib fix #6
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,10 +39,10 @@ def _mark_calibration_as_bad(raw): | |||||||||
| # marks recalibration beginnings and ends as one bad segment | ||||||||||
| cur_idx = None | ||||||||||
| cur_start_time = 0. | ||||||||||
| last_status = None | ||||||||||
| for annot in raw.annotations: | ||||||||||
| calib_match = re.match(".* Recalibration (start|end) \\| (\\d*)", annot["description"]) | ||||||||||
| calib_match = re.match(".* Recalibration (start|end) \\| (.*)", annot["description"]) | ||||||||||
| if not calib_match: continue | ||||||||||
|
|
||||||||||
| calib_status, calib_idx = calib_match.group(1), calib_match.group(2) | ||||||||||
| if calib_idx == cur_idx and calib_status == "end": | ||||||||||
| duration = annot["onset"] - cur_start_time | ||||||||||
|
|
@@ -51,8 +51,11 @@ def _mark_calibration_as_bad(raw): | |||||||||
| elif calib_status == "start" and cur_idx is None: | ||||||||||
| cur_idx = calib_idx | ||||||||||
| cur_start_time = annot["onset"] | ||||||||||
| elif calib_status == last_status: | ||||||||||
| logger.info(**gen_log_kwargs(message=f"Encountered apparent duplicate calibration event - skipping")) | ||||||||||
|
||||||||||
| logger.info(**gen_log_kwargs(message=f"Encountered apparent duplicate calibration event - skipping")) | |
| logger.info(**gen_log_kwargs(message=f"Encountered apparent duplicate calibration event (last:current => {last_status}:{calib_status})- skipping")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last_status and calib_status will always per the if condition be the same. could do this instead?
| logger.info(**gen_log_kwargs(message=f"Encountered apparent duplicate calibration event - skipping")) | |
| logger.info(**gen_log_kwargs(message=f"Encountered apparent duplicate calibration event ({calib_status}, {calib_idx}) - skipping")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be an option of the pipeline? E.g. someone else might name their recalibrations differently, or have none at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something to comment on and for now continue with our lives 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we make it a user defined string that defaults to what it is now? or shall we make definition mandatory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds very good to me, let's keep our default for now