Skip to content

Commit

Permalink
Merge pull request #13 from sstucker/main
Browse files Browse the repository at this point in the history
0.5.2 remove Excel-style carriage return from TSV export and add utf-8 print to test
  • Loading branch information
sstucker authored Jun 10, 2022
2 parents 6dce199 + 6dba96e commit 133983c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snirf2bids/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# __version__.py
__VERSION__ = (0, 5, 1)
__VERSION__ = (0, 5, 2)
__version__ = '.'.join(map(str, __VERSION__))
2 changes: 1 addition & 1 deletion snirf2bids/snirf2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def save_to_tsv(self, info, fpath):

# TSV FILE WRITING
with open(filedir, 'w', newline='') as tsvfile:
writer = csv.writer(tsvfile, delimiter='\t', newline='\n') # writer setup in tsv format
writer = csv.writer(tsvfile, delimiter='\t', newline='') # writer setup in tsv format
writer.writerow(fieldnames) # write fieldnames
writer.writerows(valfiltered) # write rows

Expand Down
3 changes: 3 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def test_gen_from_all(self):
print(json.dumps(json.loads(s[fname]), indent=2))
elif fname.endswith('.tsv'):
rows = csv.reader(io.StringIO(s[fname]), delimiter='\t')
print('UTF-8:')
print(s[fname].encode('utf-8'))
print('Formatted:')
print(tabulate.tabulate(rows))
print('__________________________________________________')

Expand Down

0 comments on commit 133983c

Please sign in to comment.