Skip to content

Commit

Permalink
Use a tsv file extension instead of .prov
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Feb 13, 2024
1 parent 949d22d commit 8c9a369
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bidscoin/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2208,17 +2208,17 @@ def bidsprov(sesfolder: Path, source: Path, runid: str='', datatype: str='unknow
bidsfolder = sesfolder.parent
if bidsfolder.name.startswith('sub-'):
bidsfolder = bidsfolder.parent
provfile = bidsfolder/'code'/'bidscoin'/'bidscoiner.prov'
provfile = bidsfolder/'code'/'bidscoin'/'bidscoiner.tsv'

# Read the provenance data and add the new data to it
if provfile.is_file():
provdata = pd.read_csv(provfile, sep='\t', index_col='source')
else:
provdata = pd.DataFrame(columns=['runid', 'datatype', 'targets'])
provdata.index.name = 'source'
provdata.loc[source] = [runid, datatype, ', '.join([target.name for target in targets])]

# Write the provenance data
provdata.loc[source] = [runid, datatype, ', '.join([target.name for target in targets])]
LOGGER.debug(f"Writing provenance data to: {provfile}")
provdata.to_csv(provfile, sep='\t')

Expand Down

0 comments on commit 8c9a369

Please sign in to comment.