From dec6658cdc10a23ad0e733fb52a814306033d88c Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 30 Jul 2014 16:48:11 -0600 Subject: MAINT: Fixes for problems in numpy/lib revealed by pyflakes. Some of those problems look like potential coding errors. In those cases a Fixme comment was made and the offending code, usually an unused variable, was commented out. --- numpy/lib/arrayterator.py | 1 - 1 file changed, 1 deletion(-) (limited to 'numpy/lib/arrayterator.py') diff --git a/numpy/lib/arrayterator.py b/numpy/lib/arrayterator.py index c2cde574e..8ac720ccd 100644 --- a/numpy/lib/arrayterator.py +++ b/numpy/lib/arrayterator.py @@ -9,7 +9,6 @@ a user-specified number of elements. """ from __future__ import division, absolute_import, print_function -import sys from operator import mul from functools import reduce -- cgit v1.2.1 From 01b0d7e82211b581aaff925e3ccc36cff9ac1895 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 30 Jul 2014 18:06:28 -0600 Subject: STY: Make files in numpy/lib PEP8 compliant. The rules enforced are the same as those used for scipy. --- numpy/lib/arrayterator.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'numpy/lib/arrayterator.py') 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] -- cgit v1.2.1