Skip to content

Commit

Permalink
Fix test and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
levje committed Oct 29, 2024
1 parent e1bc3e5 commit 20f2e38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dwi_ml/unit_tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _verify_sft_data(sft_data, group_number):
assert dps_key_1 in list_4.data_per_streamline.keys()
assert dps_key_2 in list_4.data_per_streamline.keys()
assert np.allclose(
list_4.data_per_streamline[dps_key_2],
list_4.data_per_streamline[dps_key_2][0:4],
expected_mock_2d_dps[0:4])


Expand Down
6 changes: 5 additions & 1 deletion scripts_python/tests/test_create_hdf5_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import tempfile

Expand Down Expand Up @@ -36,14 +37,17 @@ def test_help_option(script_runner):

def test_execution(script_runner):
os.chdir(os.path.expanduser(tmp_dir.name))

dwi_ml_folder = os.path.join(data_dir, 'dwi_ml_ready')
config_file = os.path.join(data_dir, 'code_creation/config_file.json')
training_subjs = os.path.join(data_dir, 'code_creation/subjs_list.txt')
validation_subjs = os.path.join(data_dir,
'code_creation/empty_subjs_list.txt')
testing_subjs = validation_subjs

hdf5_output = 'test.hdf5'
ret = script_runner.run('dwiml_create_hdf5_dataset.py', '-f',

ret = script_runner.run('dwiml_create_hdf5_dataset.py',
dwi_ml_folder, hdf5_output, config_file,
training_subjs, validation_subjs, testing_subjs)
assert ret.success

0 comments on commit 20f2e38

Please sign in to comment.