Skip to content

Commit

Permalink
Merge pull request #833 from EmmaRenauld/add_legacy_test_help
Browse files Browse the repository at this point in the history
Add legacy test (help)
  • Loading branch information
arnaudbore authored Dec 6, 2023
2 parents 9415ab6 + 03412b4 commit 9baf955
Show file tree
Hide file tree
Showing 42 changed files with 291 additions and 88 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ In order to install the library and scripts flawlessly (we hope), please follow
pip install packaging>=19.0
pip install numpy==1.23.*
pip install Cython==0.29.*
pip install -e .
```

The library and scripts can be installed locally by using:
Expand All @@ -49,6 +48,11 @@ export SCILPY_LEGACY='False'
pip install -e .
```

(Then, without the legacy scripts, if you want to use pytest, use:)
```
pytest --ignore=scripts/legacy
```

On Linux, most likely you will have to install libraries for COMMIT/AMICO
```
sudo apt install libblas-dev liblapack-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""


@deprecate_script("scil_split_dwi.py", DEPRECATION_MSG, '1.7.0')
@deprecate_script("scil_split_image.py", DEPRECATION_MSG, '1.7.0')
def main():
new_main()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""


@deprecate_script("scil_swap_gradients.py", DEPRECATION_MSG, '1.7.0')
@deprecate_script("scil_swap_gradient_axis.py", DEPRECATION_MSG, '1.7.0')
def main():
new_main()

Expand Down
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_add_tracking_mask_to_pft_maps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_add_tracking_mask_to_pft_maps.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_apply_bias_field_on_dwi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_apply_bias_field_on_dwi.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_apply_transform_to_tractogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_apply_transform_to_tractogram.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_combine_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_combine_labels.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compare_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compare_connectivity.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compute_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compute_connectivity.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compute_local_tracking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compute_local_tracking.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compute_local_tracking_dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compute_local_tracking_dev.py', '--help')
assert ret.success
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run(
'scil_compute_maps_for_particle_filter_tracking.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compute_pft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compute_pft.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_compute_powder_average.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_compute_powder_average.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_concatenate_dwi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_concatenate_dwi.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_dilate_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_dilate_labels.py', '--help')
assert ret.success
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_evaluate_connectivity_graph_measures.py',
'--help')
assert ret.success
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run(
'scil_evaluate_connectivity_pairwise_agreement_measures.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_extract_b0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_extract_b0.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_extract_dwi_shell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_extract_dwi_shell.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_filter_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_filter_connectivity.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_filter_tractogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_filter_tractogram.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_flip_gradients.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_flip_gradients.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_flip_streamlines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_flip_streamlines.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_normalize_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_normalize_connectivity.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_print_connectivity_filenames.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_print_connectivity_filenames.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_register_tractogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_register_tractogram.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_remove_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_remove_labels.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_reorder_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_reorder_connectivity.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_resample_bvals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_resample_bvals.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_resample_tractogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_resample_tractogram.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_shuffle_streamlines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_shuffle_streamlines.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_split_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_split_image.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_split_tractogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_split_tractogram.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_split_volume_by_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_split_volume_by_ids.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_split_volume_by_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_split_volume_by_labels.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_streamlines_math.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_streamlines_math.py', '--help')
assert ret.success
7 changes: 7 additions & 0 deletions scripts/legacy/tests/test_swap_gradient_axis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def test_help_option(script_runner):
ret = script_runner.run('scil_swap_gradient_axis.py', '--help')
assert ret.success
30 changes: 0 additions & 30 deletions scripts/tests/test_streamlines_math.py

This file was deleted.

Loading

0 comments on commit 9baf955

Please sign in to comment.