Skip to content
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

An updated function in the API for updating scans.tsv and participants files #439

Closed
adam2392 opened this issue May 27, 2020 · 7 comments · Fixed by #1149
Closed

An updated function in the API for updating scans.tsv and participants files #439

adam2392 opened this issue May 27, 2020 · 7 comments · Fixed by #1149

Comments

@adam2392
Copy link
Member

adam2392 commented May 27, 2020

Describe the problem

When you're writing datasets using the write_raw_bids functions, sometimes you might manually delete a participant, or some scans. However, this needs to get reflected in the corresponding files. The only way to do that is manually right now.

Describe your solution

A update_scans_tsv() and update_participants_files function perhaps to do that book-keeping for you. I'm not sure what the best looking API would look like, but if people agree, then I can put together something and a short "example?

The U in CRUD:

def update_scans_sidecar(bids_root, subject=None, session=None):
     # if a specific subject/session, then only do that specific scans.tsv
     # else loop through all files
 
     # load scans tsv file
     # delete row if that file doesn't exist anymore
def update_participants_sidecar(bids_root):
     # get all subject ids inside bids_root
 
     # load participants tsv file
     # delete row if that subject doesn't exist anymore

Describe possible alternatives

Possibly the function could be combined into one? Allowing one to update sidecar files in general? Idk how that would look though because we definitely can't account for all sidecars.

Additional context

Minimally keeping the scans and participants file up to date would be nice.

@jasmainak
Copy link
Member

it sounds like a reasonable request to me

@hoechenberger @sappelhoff wdyt?

@hoechenberger
Copy link
Member

This is something that has been on our "want-to-have" list for a while now, so: yes, I want to have this ;) I will need to think about which solution / API would make most sense, though. I believe we should try to sketch this out a little before you start with an implementation, @adam2392.

@agramfort may also have some ideas on this.

@agramfort
Copy link
Member

agramfort commented May 28, 2020 via email

@sappelhoff
Copy link
Member

yes, I agree it's important to replace this "manual fiddling around" with code as far as possible 👍

@adam2392
Copy link
Member Author

This is something that has been on our "want-to-have" list for a while now, so: yes, I want to have this ;) I will need to think about which solution / API would make most sense, though. I believe we should try to sketch this out a little before you start with an implementation, @adam2392.

What do you think of the proposed two functions, I put into the issue just now?

@agramfort
Copy link
Member

agramfort commented May 28, 2020 via email

@hoechenberger
Copy link
Member

Hey @adam2392, sorry I haven't gotten back to you yet, I was busy with other stuff. Like @agramfort said, an API proposal could be very helpful to get a discussion started! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants