-
Notifications
You must be signed in to change notification settings - Fork 190
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
Fix: save a copy of group ids in CommonReferenceRecording #2215
Conversation
Thanks @oaaij-gnahz I'm having a hard time understanding exactly how behavior is changed. It seems you have only renamed |
Apply suggestion Co-authored-by: Alessio Buccino <[email protected]>
Hi @alejoe91 I think the difference that this commit makes is: when the |
@@ -98,15 +98,17 @@ def __init__( | |||
|
|||
# tranforms groups (ids) to groups (indices) | |||
if groups is not None: | |||
groups = [self.ids_to_indices(g) for g in groups] | |||
group_indices = [self.ids_to_indices(g) for g in groups] |
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.
@oaaij-gnahz same name change should apply to all other groups_inds
!
Yep, makes sense! I left another comment! |
Apply suggested changes
I applied the same name change to all other |
Hi,
I found a potential bug and fix while using
common_reference
.Problem scenario: In my original recording object, channel IDs are the same as channel indices. I use
common_reference
after a combination ofchannel_slice
andsplit_by
while keeping the original IDs. Then when re-loading my latest recording object from the JSON file, theids_to_indices
function of theCommonReferenceRecording
object would raise error suggesting the channel ID is not found.My guess for the cause: After
channel_slice
, the channel IDs and indices are different. When initializingCommonReferenceRecording
, thegroups
property is directly modified to reflect indices. Then when re-loading from kwargs, it would run the functionids_to_indices
again, but this time the input propertygroups
reflects indices and it should really reflect IDs. This causes error on some occasion (in my case,split_by
is called afterchannel_slice
so that may complicate the IDs of each channel), although most of the usual cases would not elicit the error.I upload my fix here, treating
groups
property similarly asref_channel_ids
. Would you take a look?Thanks!