-
Notifications
You must be signed in to change notification settings - Fork 85
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
MRG: Fix amending a dataset when new columns are being added to participants.tsv #1113
MRG: Fix amending a dataset when new columns are being added to participants.tsv #1113
Conversation
…sv with missing "default" columns Fixes mne-tools#1104
255639c
to
46f2a46
Compare
p_id = data['participant_id'][0] | ||
if p_id in orig_data['participant_id']: | ||
row_idx = orig_data['participant_id'].index(p_id) |
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 is just aesthetics.
for key in data.keys(): | ||
if key in orig_data: | ||
continue | ||
|
||
# add 'n/a' if any missing columns | ||
orig_data[key] = ['n/a'] * len(next(iter(data.values()))) | ||
orig_data[key] = ['n/a'] * len(orig_data['participant_id']) |
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.
participant_id column must always be present so just use this one.
Codecov Report
@@ Coverage Diff @@
## main #1113 +/- ##
=======================================
Coverage 95.03% 95.04%
=======================================
Files 40 40
Lines 8668 8670 +2
=======================================
+ Hits 8238 8240 +2
Misses 430 430
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Closes #1104
MWE:
On
main
:Passes with this PR branch.
PR Description
Merge checklist
Maintainer, please confirm the following before merging.
If applicable: