Skip to content

Commit

Permalink
use os.path.join instead of +
Browse files Browse the repository at this point in the history
  • Loading branch information
vinferrer committed Jun 18, 2020
1 parent a56eacc commit e49a296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phys2bids/phys2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def phys2bids(filename, info=False, indir='.', outdir='.', heur_file=None,
outdir = utils.check_input_dir(outdir)
utils.path_exists_or_make_it(outdir)
# generate extra path
extra_dir = outdir + '/bids_ignore'
extra_dir = os.path.join(outdir, 'bids_ignore')
utils.path_exists_or_make_it(extra_dir)
# Create logfile name
basename = 'phys2bids_'
Expand Down
12 changes: 6 additions & 6 deletions phys2bids/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_logger(multifreq_lab_file):
test_chtrig = 3
test_ntp = 1
test_outdir = test_path
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')
# Phys2bids call through terminal
subprocess.run(f'phys2bids -in {test_filename} -indir {test_path} '
f'-chtrig {test_chtrig} -ntp {test_ntp} -outdir {test_outdir}',
Expand All @@ -60,7 +60,7 @@ def test_integration_txt(samefreq_short_txt_file):

test_path, test_filename = os.path.split(samefreq_short_txt_file)
test_chtrig = 2
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')

phys2bids(filename=test_filename, indir=test_path, outdir=test_path,
chtrig=test_chtrig, num_timepoints_expected=1)
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_integration_acq(samefreq_full_acq_file):

test_path, test_filename = os.path.split(samefreq_full_acq_file)
test_chtrig = 3
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')

phys2bids(filename=test_filename, indir=test_path, outdir=test_path,
chtrig=test_chtrig, num_timepoints_expected=1)
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_integration_multifreq(multifreq_lab_file):

test_path, test_filename = os.path.split(multifreq_lab_file)
test_chtrig = 3
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')

phys2bids(filename=test_filename, indir=test_path, outdir=test_path,
chtrig=test_chtrig, num_timepoints_expected=1)
Expand Down Expand Up @@ -313,7 +313,7 @@ def test_integration_heuristic(samefreq_short_txt_file):
test_full_path = os.path.join(test_path, test_filename)
test_chtrig = 1
test_outdir = test_path
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')
test_ntp = 158
test_tr = 1.2
test_thr = 0.735
Expand Down Expand Up @@ -390,7 +390,7 @@ def test_integration_info(samefreq_short_txt_file):
test_ntp = 158
test_tr = 1.2
test_thr = 0.735
extra_dir = test_path + '/bids_ignore/'
extra_dir = os.path.join(test_path, 'bids_ignore')
# Move into folder
subprocess.run(f'cd {test_path}', shell=True, check=True)
# Phys2bids call through terminal
Expand Down

0 comments on commit e49a296

Please sign in to comment.