Skip to content

Commit eb8f12c

Browse files
committed
DOC: correct form of Raises section
I never bothered to look it up; raises should have error then description indented on a new line underneath.
1 parent db8638e commit eb8f12c

File tree

8 files changed

+23
-13
lines changed

8 files changed

+23
-13
lines changed

nibabel/casting.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def type_info(np_type):
199199
200200
Raises
201201
------
202-
FloatingError : for floating point types we don't recognize
202+
FloatingError
203+
for floating point types we don't recognize
203204
204205
Notes
205206
-----

nibabel/mriutils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def calculate_dwell_time(water_fat_shift, echo_train_length, field_strength):
4040
4141
Raises
4242
------
43-
MRIError if values are out of range
43+
MRIError
44+
if values are out of range
4445
"""
4546
if field_strength < 0:
4647
raise MRIError("Field strength should be positive")

nibabel/nifti1.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1835,8 +1835,10 @@ def load(filename):
18351835
18361836
Raises
18371837
------
1838-
ImageFileError: if `filename` doesn't look like NIfTI1
1839-
IOError : if `filename` does not exist
1838+
ImageFileError
1839+
if `filename` doesn't look like NIfTI1;
1840+
IOError
1841+
if `filename` does not exist.
18401842
"""
18411843
try:
18421844
img = Nifti1Image.load(filename)

nibabel/nifti2.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ def load(filename):
255255
256256
Raises
257257
------
258-
ImageFileError: if `filename` doesn't look like nifti2
259-
IOError : if `filename` does not exist
258+
ImageFileError
259+
if `filename` doesn't look like nifti2;
260+
IOError
261+
if `filename` does not exist.
260262
"""
261263
try:
262264
img = Nifti2Image.load(filename)

nibabel/parrec.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ def vol_is_full(slice_nos, slice_max, slice_min=1):
375375
376376
Raises
377377
------
378-
ValueError if any `slice_nos` value is outside slice set.
378+
ValueError
379+
if any `slice_nos` value is outside slice set.
379380
"""
380381
slice_set = set(range(slice_min, slice_max + 1))
381382
if not slice_set.issuperset(slice_nos):
@@ -721,8 +722,8 @@ def _get_unique_image_prop(self, name):
721722
722723
Raises
723724
------
724-
PARRECError - if the rows of ``self.image_defs[name]`` do not all
725-
compare equal
725+
PARRECError
726+
if the rows of ``self.image_defs[name]`` do not all compare equal.
726727
"""
727728
props = self.image_defs[name]
728729
if np.any(np.diff(props, axis=0)):

nibabel/spatialimages.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,9 @@ def filespec_to_file_map(klass, filespec):
738738
739739
Raises
740740
------
741-
ImageFileError - if `filespec` is not recognizable as being a filename
742-
for this image type.
741+
ImageFileError
742+
if `filespec` is not recognizable as being a filename for this
743+
image type.
743744
"""
744745
try:
745746
filenames = types_filenames(filespec,

nibabel/wrapstruct.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ def get_value_label(self, fieldname):
509509
510510
Raises
511511
------
512-
ValueError : if field is not coded
512+
ValueError
513+
if field is not coded.
513514
514515
Examples
515516
--------

nisext/testers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def back_tick(cmd, ret_err=False, as_str=True):
7272
7373
Raises
7474
------
75-
Raises RuntimeError if command returns non-zero exit code
75+
RuntimeError
76+
if command returns non-zero exit code.
7677
"""
7778
proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=NEEDS_SHELL)
7879
out, err = proc.communicate()

0 commit comments

Comments
 (0)