Skip to content

Commit

Permalink
run pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
frheault committed Oct 11, 2023
1 parent 6e6975b commit 13d173e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions scripts/tests/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# If they already exist, this only takes 5 seconds (check md5sum)
fetch_data(get_testing_files_dict(), keys=['DSI.zip', 'trx_from_scratch.zip'])


def test_help_option_convert_dsi(script_runner):
ret = script_runner.run(['tff_convert_dsi_studio.py', '--help'])
assert ret.success
Expand Down Expand Up @@ -191,11 +192,13 @@ def test_execution_generate_trx_from_scratch():
exp_trx = tmm.load(expected_trx)
gen_trx = tmm.load(out_gen_path)

assert DeepDiff(exp_trx.get_dtype_dict(), gen_trx.get_dtype_dict()) == {}
assert DeepDiff(exp_trx.get_dtype_dict(),
gen_trx.get_dtype_dict()) == {}

assert_allclose(exp_trx.streamlines._data, gen_trx.streamlines._data,
atol=0.1, rtol=0.1)
assert_equal(exp_trx.streamlines._offsets, gen_trx.streamlines._offsets)
assert_equal(exp_trx.streamlines._offsets,
gen_trx.streamlines._offsets)

for key in exp_trx.data_per_vertex.keys():
assert_equal(exp_trx.data_per_vertex[key]._data,
Expand Down Expand Up @@ -233,8 +236,10 @@ def test_execution_concatenate_validate_trx():

# Right data
end_idx = trx1.header['NB_VERTICES']
assert_allclose(trx.streamlines._data[:end_idx], trx1.streamlines._data)
assert_allclose(trx.streamlines._data[end_idx:], trx2.streamlines._data)
assert_allclose(
trx.streamlines._data[:end_idx], trx1.streamlines._data)
assert_allclose(
trx.streamlines._data[end_idx:], trx2.streamlines._data)

# Right data_per_*
for key in trx.data_per_vertex.keys():
Expand Down
3 changes: 2 additions & 1 deletion scripts/tff_manipulate_datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def main():
for group, name, dtype in args.dpg:
dtype_dict['dpg'][group] = {name: np.dtype(dtype)}

manipulate_trx_datatype(args.in_tractogram, args.out_tractogram, dtype_dict)
manipulate_trx_datatype(
args.in_tractogram, args.out_tractogram, dtype_dict)


if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion trx/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def test_multi_load_save_rasmm(path):

obj = load(path, os.path.join(gs_dir, 'gs.nii'))
for i in range(3):
out_path = os.path.join(tmp_gs_dir, '{}_tmp{}_{}'.format(basename, i, ext))
out_path = os.path.join(
tmp_gs_dir, '{}_tmp{}_{}'.format(basename, i, ext))
save(obj, out_path)

if isinstance(obj, TrxFile):
Expand Down

0 comments on commit 13d173e

Please sign in to comment.