Skip to content

Commit b3adb15

Browse files
committed
docstring passed nosetests
1 parent 51ff298 commit b3adb15

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

nibabel/gifti/gifti.py

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def agg_data(self, intent_code=None):
684684
685685
In the general case, the numpy data array is extracted from each ``GiftiDataArray``
686686
object and returned in a ``tuple``, in the order they are found in the GIFTI image.
687-
687+
688688
If all ``GiftiDataArray`` s have ``intent`` of 2001 (``NIFTI_INTENT_TIME_SERIES``),
689689
then the data arrays are concatenated as columns, producing a vertex-by-time array.
690690
If an ``intent_code`` is passed, data arrays are filtered by the selected intents,
@@ -715,57 +715,71 @@ def agg_data(self, intent_code=None):
715715
>>> from nibabel.testing import test_data
716716
>>> surf_gii_fname = test_data('gifti', 'ascii.gii')
717717
>>> surf_gii_img = nib.load(surf_gii_fname)
718-
>>> func_gii_fname = test_data('gifti', 'sub-01_task-rhymejudgment_space-xformspaceverage3_hemi-L.func.gii')
718+
>>> func_gii_fname = test_data('gifti', 'sub-01_task-rhymejudgment_space-fsaverage3_hemi-L.func.gii')
719719
>>> func_gii_img = nib.load(func_gii_fname)
720720
721721
When not passing anything to ``intent_code``
722722
723723
>>> surf_gii_img.agg_data() # surface file
724724
(array([[-16.07201 , -66.187515, 21.266994],
725-
[-16.705893, -66.05434 , 21.232786],
726-
[-17.61435 , -65.40164 , 21.071466]], dtype=float32),
727-
array([0, 1, 2], dtype=int32))
725+
[-16.705893, -66.05434 , 21.232786],
726+
[-17.61435 , -65.40164 , 21.071466]], dtype=float32), array([0, 1, 2], dtype=int32))
728727
>>> func_gii_img.agg_data() # functional file
729-
array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
730-
...,
731-
[268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
732-
259.7127 ]], dtype=float32)
728+
array([[ 545.4326 , 535.8471 , 537.5014 , ..., 540.2762 ,
729+
539.53827 , 541.3617 ],
730+
[ 640.0118 , 634.727 , 630.03784 , ..., 635.21936 ,
731+
641.19586 , 638.7647 ],
732+
[ 612.9056 , 607.3228 , 606.1355 , ..., 608.2441 ,
733+
615.8239 , 613.0585 ],
734+
...,
735+
[ 101.28482 , 101.41192 , 99.21213 , ..., 100.47232 ,
736+
99.258316, 99.440796],
737+
[ 371.81592 , 367.02896 , 363.90207 , ..., 365.52597 ,
738+
363.44937 , 363.10278 ],
739+
[ 268.6521 , 262.0212 , 259.06717 , ..., 262.5381 ,
740+
257.8245 , 259.7127 ]], dtype=float32)
733741
734742
When passig matching intend codes ``intent_code``
735743
736-
>>> surf_gii_img.agg_data('pointset') # surface pointset
744+
>>> surf_gii_img.agg_data('pointset') # surface pointset
737745
array([[-16.07201 , -66.187515, 21.266994],
738-
[-16.705893, -66.05434 , 21.232786],
739-
[-17.61435 , -65.40164 , 21.071466]], dtype=float32)
746+
[-16.705893, -66.05434 , 21.232786],
747+
[-17.61435 , -65.40164 , 21.071466]], dtype=float32)
740748
>>> surf_gii_img.agg_data('triangle') # surface triangle
741749
array([0, 1, 2], dtype=int32)
742750
>>> func_gii_img.agg_data('time series') # functional file
743-
array([[545.4326 , 535.8471 , 537.5014 , ..., 540.2762 , 539.53827 ,
744-
541.3617 ],
745-
...,
746-
[268.6521 , 262.0212 , 259.06717 , ..., 262.5381 , 257.8245 ,
747-
259.7127 ]], dtype=float32)
748-
751+
array([[ 545.4326 , 535.8471 , 537.5014 , ..., 540.2762 ,
752+
539.53827 , 541.3617 ],
753+
[ 640.0118 , 634.727 , 630.03784 , ..., 635.21936 ,
754+
641.19586 , 638.7647 ],
755+
[ 612.9056 , 607.3228 , 606.1355 , ..., 608.2441 ,
756+
615.8239 , 613.0585 ],
757+
...,
758+
[ 101.28482 , 101.41192 , 99.21213 , ..., 100.47232 ,
759+
99.258316, 99.440796],
760+
[ 371.81592 , 367.02896 , 363.90207 , ..., 365.52597 ,
761+
363.44937 , 363.10278 ],
762+
[ 268.6521 , 262.0212 , 259.06717 , ..., 262.5381 ,
763+
257.8245 , 259.7127 ]], dtype=float32)
749764
750765
When passing mismatching ``intent_code``, the function return a empty ``tuple``
751766
752767
>>> surf_gii_img.agg_data('time series')
753768
()
754-
>>> func_gii_img.agg_data('triangle')
769+
>>> func_gii_img.agg_data('triangle')
755770
()
756771
757-
When passing tuple ``intent_code``, the output will follow
772+
When passing tuple ``intent_code``, the output will follow
758773
the order of ``intent_code`` in the tuple
759774
760775
>>> surf_gii_img.agg_data(('pointset', 'triangle'))
761776
(array([[-16.07201 , -66.187515, 21.266994],
762-
[-16.705893, -66.05434 , 21.232786],
763-
[-17.61435 , -65.40164 , 21.071466]], dtype=float32),
764-
array([0, 1, 2], dtype=int32))
777+
[-16.705893, -66.05434 , 21.232786],
778+
[-17.61435 , -65.40164 , 21.071466]], dtype=float32), array([0, 1, 2], dtype=int32))
765779
>>> surf_gii_img.agg_data(('triangle', 'pointset'))
766780
(array([0, 1, 2], dtype=int32), array([[-16.07201 , -66.187515, 21.266994],
767-
[-16.705893, -66.05434 , 21.232786],
768-
[-17.61435 , -65.40164 , 21.071466]], dtype=float32))
781+
[-16.705893, -66.05434 , 21.232786],
782+
[-17.61435 , -65.40164 , 21.071466]], dtype=float32))
769783
"""
770784

771785
# Allow multiple intents to specify the order

0 commit comments

Comments
 (0)