diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-07-30 18:06:28 -0600 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-07-31 21:21:17 +0200 |
commit | 01b0d7e82211b581aaff925e3ccc36cff9ac1895 (patch) | |
tree | 8ec68353d5f09b9f0411948f1345ec79f5443b4c /numpy/lib/arrayterator.py | |
parent | dec6658cdc10a23ad0e733fb52a814306033d88c (diff) | |
download | numpy-01b0d7e82211b581aaff925e3ccc36cff9ac1895.tar.gz |
STY: Make files in numpy/lib PEP8 compliant.
The rules enforced are the same as those used for scipy.
Diffstat (limited to 'numpy/lib/arrayterator.py')
-rw-r--r-- | numpy/lib/arrayterator.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/lib/arrayterator.py b/numpy/lib/arrayterator.py index 8ac720ccd..d9839feeb 100644 --- a/numpy/lib/arrayterator.py +++ b/numpy/lib/arrayterator.py @@ -104,7 +104,8 @@ class Arrayterator(object): """ # Fix index, handling ellipsis and incomplete slices. - if not isinstance(index, tuple): index = (index,) + if not isinstance(index, tuple): + index = (index,) fixed = [] length, dims = len(index), len(self.shape) for slice_ in index: @@ -180,7 +181,8 @@ class Arrayterator(object): def __iter__(self): # Skip arrays with degenerate dimensions - if [dim for dim in self.shape if dim <= 0]: raise StopIteration + if [dim for dim in self.shape if dim <= 0]: + raise StopIteration start = self.start[:] stop = self.stop[:] @@ -199,12 +201,13 @@ class Arrayterator(object): # along higher dimensions, so we read only a single position if count == 0: stop[i] = start[i]+1 - elif count <= self.shape[i]: # limit along this dimension + elif count <= self.shape[i]: + # limit along this dimension stop[i] = start[i] + count*step[i] rundim = i else: - stop[i] = self.stop[i] # read everything along this - # dimension + # read everything along this dimension + stop[i] = self.stop[i] stop[i] = min(self.stop[i], stop[i]) count = count//self.shape[i] |