-
Notifications
You must be signed in to change notification settings - Fork 14
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
API: Make write_brainvision take keyword arguments only #57
Conversation
Codecov Report
@@ Coverage Diff @@
## master #57 +/- ##
===========================================
- Coverage 100.00% 97.19% -2.81%
===========================================
Files 3 3
Lines 264 285 +21
===========================================
+ Hits 264 277 +13
- Misses 0 8 +8
Continue to review full report at Codecov.
|
@@ -30,7 +30,7 @@ | |||
SUPPORTED_UNITS = ['V', 'mV', 'µV', 'uV', 'nV'] | |||
|
|||
|
|||
def write_brainvision(data, sfreq, ch_names, fname_base, folder_out, | |||
def write_brainvision(*, data, sfreq, ch_names, fname_base, folder_out, |
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 guess I would allow for data
to be passed by position, but it's a matter of taste I suppose!
def write_brainvision(*, data, sfreq, ch_names, fname_base, folder_out, | |
def write_brainvision(data, *, sfreq, ch_names, fname_base, folder_out, |
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 would like to keep it all keyword, no positional because I think it leads to a better consistency in this case
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'd also prefer the first argument to not be kw-only, but this writer is different enough that I'm also fine with all kw-only (normally the data is the first and the file name the second parameter).
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'm fine with either, just meant to throw in another possibility :)
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.
Okay great, thanks both! I am merging then and following up with a huge API PR that'll better align what we are doing with the BrainVision spec.
write_brainvision
is a long function with many parameters.Making these parameters keyword only gives us two advantages: