-
Notifications
You must be signed in to change notification settings - Fork 175
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
Update base.py #371
Update base.py #371
Conversation
Add `list' to acceptable type for `target_names`. It solves this issue: braindecode#370
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.
can you update an existing test to avoid a future regression and to make sure these new lines are covered by some test?
braindecode/datasets/base.py
Outdated
@@ -113,14 +113,16 @@ def set_description(self, description, overwrite=False): | |||
self._description = pd.concat([self.description, description]) | |||
|
|||
def _target_name(self, target_name): | |||
if target_name is not None and type(target_name) not in [str, tuple]: | |||
raise ValueError('target_name has to be None, str, tuple') | |||
if target_name is not None and type(target_name) not in [str, tuple, list]: |
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.
this should be using isinstance
Thanks @MohammadJavadD for the PR, have tried to address comments and clean up a bit. @gemeinl would be nice if you can check if this makes sense for you or you anticipate any problems? |
Codecov Report
@@ Coverage Diff @@
## master #371 +/- ##
==========================================
+ Coverage 82.73% 82.74% +0.01%
==========================================
Files 53 53
Lines 3718 3721 +3
==========================================
+ Hits 3076 3079 +3
Misses 642 642 |
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.
🙏 can you just add an entry in what's new to document the bug fix?
Thanks @MohammadJavadD @robintibor braindecode/braindecode/datautil/serialization.py Lines 139 to 141 in ad0ab1a
It appears the usage of |
Add
list
to acceptable types fortarget_names
. It solves this issue: #370