Skip to content

Commit 03b60d9

Browse files
author
Ben Cipollini
committed
STY: pep8 updates
1 parent a044a1f commit 03b60d9

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

nibabel/cifti/cifti.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from ..externals import inflection
2626
from ..externals.six import string_types
2727
from ..filebasedimages import FileBasedImage, FileBasedHeader
28-
from ..nifti1 import Nifti1Extension
2928
from ..nifti2 import Nifti2Image
3029

3130

@@ -464,7 +463,6 @@ def vertex_indices(self, value):
464463
def _to_xml_element(self):
465464
brain_model = xml.Element('BrainModel')
466465

467-
attrs = []
468466
for key in ['IndexOffset', 'IndexCount', 'ModelType', 'BrainStructure',
469467
'SurfaceNumberOfVertices']:
470468
attr = inflection.underscore(key)
@@ -593,7 +591,7 @@ def remove_cifti_volume(self):
593591

594592
def _to_xml_element(self):
595593
assert self.applies_to_matrix_dimension is not None
596-
attrs = []
594+
597595
mat_ind_map = xml.Element('MatrixIndicesMap')
598596
for key in ['AppliesToMatrixDimension', 'IndicesMapToDataType',
599597
'NumberOfSeriesPoints', 'SeriesExponent', 'SeriesStart',
@@ -739,9 +737,10 @@ def from_file_map(klass, file_map):
739737
nifti_img = _CiftiAsNiftiImage.from_file_map(file_map)
740738

741739
# Get cifti header
742-
cifti_header = reduce(lambda accum, item: item.get_content()
743-
if isinstance(item, CiftiExtension)
744-
else accum,
740+
cifti_header = reduce(lambda accum, item:
741+
item.get_content()
742+
if isinstance(item, CiftiExtension)
743+
else accum,
745744
nifti_img.get_header().extensions or [],
746745
None)
747746
if cifti_header is None:

nibabel/cifti/parse_cifti_fast.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@
99
from __future__ import division, print_function, absolute_import
1010

1111
from distutils.version import LooseVersion
12-
from xml.parsers.expat import ParserCreate, ExpatError
1312

1413
import numpy as np
1514

16-
from .cifti import (CiftiImage, CiftiHeader, CiftiMetaData, CiftiLabel,
15+
from .cifti import (CiftiHeader, CiftiMetaData, CiftiLabel,
1716
CiftiLabelTable, CiftiVertexIndices,
1817
CiftiVoxelIndicesIJK, CiftiBrainModel, CiftiMatrix,
1918
CiftiMatrixIndicesMap, CiftiNamedMap, CiftiParcel,
2019
CiftiSurface, CiftiTransformationMatrixVoxelIndicesIJKtoXYZ,
2120
CiftiVertices, CiftiVolume, CIFTI_BrainStructures,
22-
CIFTI_MODEL_TYPES,
23-
CiftiDenseDataSeries)
21+
CIFTI_MODEL_TYPES) # CiftiDenseDataSeries
2422
from .. import xmlutils as xml
2523
from ..externals import inflection
2624
from ..externals.six import BytesIO
@@ -108,8 +106,8 @@ def __init__(self, dataobj, affine, header=None,
108106

109107
# Get cifti header from extension
110108
self.cifti_img = reduce(lambda accum, newval: newval
111-
if isinstance(newval, CiftiExtension)
112-
else accum,
109+
if isinstance(newval, CiftiExtension)
110+
else accum,
113111
self.get_header().extensions, None)
114112
if self.cifti_img is None:
115113
raise ValueError('Nifti2 header does not contain a CIFTI '
@@ -175,8 +173,9 @@ def StartElementHandler(self, name, attrs):
175173

176174
elif name == 'MatrixIndicesMap':
177175
self.fsm_state.append('MatrixIndicesMap')
178-
mim = CiftiMatrixIndicesMap(applies_to_matrix_dimension=int(attrs["AppliesToMatrixDimension"]),
179-
indices_map_to_data_type=attrs["IndicesMapToDataType"])
176+
mim = CiftiMatrixIndicesMap(
177+
applies_to_matrix_dimension=int(attrs["AppliesToMatrixDimension"]),
178+
indices_map_to_data_type=attrs["IndicesMapToDataType"])
180179
for key, dtype in [("NumberOfSeriesPoints", int),
181180
("SeriesExponent", int),
182181
("SeriesStart", float),

0 commit comments

Comments
 (0)