Skip to content

Commit e15bb8d

Browse files
JulianKlugeffigies
andauthored
Apply suggestions from code review: Removing unused code
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 57f7723 commit e15bb8d

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

nibabel/cmdline/stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get_parser():
2424
p.add_argument("-V", "--Volume", action="store_true", required=False,
2525
help="Compute mask volume of a given mask image.")
2626
p.add_argument("--units", default="mm3", required=False,
27-
help="Preferred output units of {mm3, vox}. Defaults to mm3")
27+
choices=("mm3", "vox"), help="Preferred output units")
2828
return p
2929

3030
def main(args=None):
@@ -36,4 +36,4 @@ def main(args=None):
3636
if opts.Volume:
3737
computed_volume = mask_volume(from_img, opts.units)
3838
print(computed_volume)
39-
return computed_volume
39+
return 0

nibabel/cmdline/tests/test_stats.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
#
99
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
1010

11-
import unittest
12-
13-
import pytest
14-
1511
from nibabel.testing import test_data
1612
from nibabel.cmdline.stats import main
17-
from nibabel.optpkg import optional_package
18-
19-
_, have_scipy, _ = optional_package('scipy.ndimage')
20-
needs_scipy = unittest.skipUnless(have_scipy, 'These tests need scipy')
2113

2214

2315
def test_volume():
@@ -30,4 +22,3 @@ def test_volume():
3022
assert float(vol_mm3) == 2273328656.0
3123
assert float(vol_vox) == 284166082.0
3224

33-

0 commit comments

Comments
 (0)