-
Notifications
You must be signed in to change notification settings - Fork 23
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
Detect mismatch errors between group and group names when writing ElectrodeGroups
#1165
base: main
Are you sure you want to change the base?
Detect mismatch errors between group and group names when writing ElectrodeGroups
#1165
Conversation
ElectrodeGroups
@@ -259,6 +267,23 @@ def _get_group_name(recording: BaseRecording) -> np.ndarray: | |||
# If for any reason the group names are empty, fill them with the default | |||
group_names[group_names == ""] = default_value | |||
|
|||
# Validate group names against groups | |||
if groups is not None: | |||
unique_groups = np.unique(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.
Mmm I will change this to sets as I remember np.unique being buggy for strings.
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.
Made the correction.
""" | ||
default_value = "ElectrodeGroup" | ||
group_names = recording.get_property("group_name") | ||
groups = recording.get_channel_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.
I think this us never None, so L262 will never be reached
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1165 +/- ##
==========================================
+ Coverage 90.69% 90.79% +0.10%
==========================================
Files 129 129
Lines 8189 8301 +112
==========================================
+ Hits 7427 7537 +110
- Misses 762 764 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This should come after #1164 and has it as its base.
This should close #932 as we have now a function that decides the right priority between "group_name" and "group". This PR adds some errors for two different types of mismatch:
@alejoe91 could you take a look?