Skip to content

Commit 3fb7003

Browse files
committed
Revert "Remove the actual docstring to prevent errors"
This reverts commit 384475b.
1 parent 384475b commit 3fb7003

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

nibabel/gifti/tests/test_gifti.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,42 @@
2525

2626
def test_agg_data():
2727
"""
28-
Move examples of aggregate GIFTI data arrays into an ndarray or tuple of ndarray
28+
Aggregate GIFTI data arrays into an ndarray or tuple of ndarray
29+
30+
Examples
31+
--------
32+
33+
Load two kinds of Gifti files: a surface file containing two types of intent code;
34+
a functional file storing time series data only.
35+
36+
>>> import nibabel as nib
37+
>>> from nibabel.testing import test_data
38+
>>> surf_gii_fname = test_data('gifti', 'ascii.gii')
39+
>>> surf_gii_img = nib.load(surf_gii_fname)
40+
>>> func_gii_fname = test_data('gifti', 'task.func.gii')
41+
>>> func_gii_img = nib.load(func_gii_fname)
42+
43+
When not passing anything to ``intent_code``
44+
45+
>>> surf_gii_img.agg_data() # surface file
46+
>>> func_gii_img.agg_data() # functional file
47+
48+
When passig matching intend codes ``intent_code``
49+
50+
>>> surf_gii_img.agg_data('pointset') # surface pointset
51+
>>> surf_gii_img.agg_data('triangle') # surface triangle
52+
>>> func_gii_img.agg_data('time series') # functional file
53+
54+
When passing mismatching ``intent_code``, the function return a empty ``tuple``
55+
56+
>>> surf_gii_img.agg_data('time series')
57+
>>> func_gii_img.agg_data('triangle')
58+
59+
When passing tuple ``intent_code``, the output will follow
60+
the order of ``intent_code`` in the tuple
61+
62+
>>> surf_gii_img.agg_data(('pointset', 'triangle'))
63+
>>> surf_gii_img.agg_data(('triangle', 'pointset'))
2964
"""
3065

3166
surf_gii_fname = test_data('gifti', 'ascii.gii')
@@ -38,21 +73,15 @@ def test_agg_data():
3873
func_da = func_gii_img.get_arrays_from_intent('time series')
3974
func_data = np.column_stack(tuple(da.data for da in func_da))
4075

41-
# When not passing anything to ``intent_code``
4276
assert_equal(surf_gii_img.agg_data(), (point_data, triangle_data)) # surface file
4377
assert_array_equal(func_gii_img.agg_data(), func_data) # functional
44-
45-
# When passig matching intend codes ``intent_code``
4678
assert_array_equal(surf_gii_img.agg_data('pointset'), point_data) # surface pointset
4779
assert_array_equal(surf_gii_img.agg_data('triangle'), triangle_data) # surface triangle
4880
assert_array_equal(func_gii_img.agg_data('time series'), func_data) # functional
4981

50-
# When passing mismatching ``intent_code``, the function return a empty ``tuple``
5182
assert_equal(surf_gii_img.agg_data('time series'), ())
5283
assert_equal(func_gii_img.agg_data('triangle'), ())
5384

54-
# When passing tuple ``intent_code``, the output will follow
55-
# the order of ``intent_code`` in the tuple
5685
assert_equal(surf_gii_img.agg_data(('pointset', 'triangle')), (point_data, triangle_data))
5786
assert_equal(surf_gii_img.agg_data(('triangle', 'pointset')), (triangle_data, point_data))
5887

0 commit comments

Comments
 (0)