Skip to content

Commit e066203

Browse files
committed
DOC Correct docstring per numpy guidelines
1 parent d87ee32 commit e066203

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

nibabel/nifti1.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def __init__(self, code, content):
259259
"""
260260
Parameters
261261
----------
262-
code : int|str
262+
code : int or str
263263
Canonical extension code as defined in the NIfTI standard, given
264264
either as integer or corresponding label
265265
(see :data:`~nibabel.nifti1.extension_codes`)
@@ -385,25 +385,27 @@ class Nifti1DicomExtension(Nifti1Extension):
385385
"""NIfTI1 DICOM header extension
386386
387387
This class is a thin wrapper around pydicom to read a binary DICOM
388-
byte string. If pydicom is not available, it silently falls back to the
389-
standard NiftiExtension class.
388+
byte string. If pydicom is available, content is exposed as a Dicom Dataset.
389+
Otherwise, this silently falls back to the standard NiftiExtension class
390+
and content is the raw bytestring loaded directly from the nifti file
391+
header.
390392
"""
391393
def __init__(self, code, content, parent_hdr=None):
392394
"""
393395
Parameters
394396
----------
395-
code : int|str
397+
code : int or str
396398
Canonical extension code as defined in the NIfTI standard, given
397399
either as integer or corresponding label
398400
(see :data:`~nibabel.nifti1.extension_codes`)
399-
content : bytes|pydicom Dataset|None
401+
content : bytes or pydicom Dataset or None
400402
Extension content - either a bytestring as read from the NIfTI file
401403
header or an existing pydicom Dataset. If a bystestring, the content
402404
is converted into a Dataset on initialization. If None, a new empty
403405
Dataset is created.
404-
parent_hdr : :data:`~nibabel.nifti1.Nifti1Header`
405-
Optional - If a dicom extension belongs to an existing
406-
:data:`~nibabel.nifti1.Nifti1Header`, it may be provided here to
406+
parent_hdr : :class:`~nibabel.nifti1.Nifti1Header`, optional
407+
If a dicom extension belongs to an existing
408+
:class:`~nibabel.nifti1.Nifti1Header`, it may be provided here to
407409
ensure that the DICOM dataset is written with correctly corresponding
408410
endianness; otherwise it is assumed the dataset is little endian.
409411
@@ -428,7 +430,7 @@ def __init__(self, code, content, parent_hdr=None):
428430
ds = self._unmangle(content, self._is_implicit_VR,
429431
self._is_little_endian)
430432
self._content = ds
431-
elif content == None: # Otherwise, initialize a new dicom dataset
433+
elif content is None: # initialize a new dicom dataset
432434
self._is_implicit_VR = False
433435
self._content = pdcm.dataset.Dataset()
434436
else:

0 commit comments

Comments
 (0)