Skip to content

Conversation

@jshanna100
Copy link

This makes mark_calibration_as_bad robust to duplicate calibration start/stop triggers, and also makes the regular expression agnostic to the ID of the trigger, i.e. the ID can be any string now, as opposed to any number

…more agnostic to non-numeric calibration IDs
@jshanna100 jshanna100 requested a review from behinger July 18, 2025 10:49
@behinger behinger changed the base branch from main_hochberger to temp_dev July 18, 2025 10:51
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"])
Copy link
Member

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

Copy link
Member

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 🙈

Copy link
Author

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?

Copy link
Member

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

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"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to print this calibration match? e.g. it could be recalibration start -> recalibration start or recalibration end -> recalibration end right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recalibration start -> recalibration start or recalibration end -> recalibration end right?

not sure what you mean by this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like that

Copy link
Author

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?

Suggested change
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"))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good!

@jshanna100 jshanna100 merged commit cde517d into s-ccs:temp_dev Jul 21, 2025
1 check passed
@jshanna100 jshanna100 deleted the calib_fix branch July 21, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants