Skip to content

Commit 561f69c

Browse files
committed
Remove unused imports and unused local variables.
Correct issues reported by pyflakes.
1 parent fb0b503 commit 561f69c

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

diffpy/utils/parsers/loaddata.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Turn on the "with" statement for Python 2.5.
1717
from __future__ import with_statement
18+
import numpy
1819

1920

2021
def loadData(filename, minrows=10, **kwargs):
@@ -145,7 +146,6 @@ def read(self, filename):
145146

146147

147148
def readfp(self, fp, append=False):
148-
import numpy
149149
self._reset()
150150
# try to read lines from fp first
151151
self._lines = fp.readlines()
@@ -158,7 +158,6 @@ def readfp(self, fp, append=False):
158158

159159

160160
def _findDataBlocks(self):
161-
import numpy
162161
mincols = 1
163162
if self.usecols is not None and len(self.usecols):
164163
mincols = max(mincols, max(self.usecols) + 1)
@@ -183,7 +182,6 @@ def _findDataBlocks(self):
183182
n1[lr.nw1[:-1]] = True
184183
lw.line = n1.cumsum()
185184
lw.col = lw.idx - lr.nw0[lw.line]
186-
flag = None
187185
lw.ok = True
188186
values = nwords * [0.0]
189187
for i, w in enumerate(self._words):

diffpy/utils/tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def testsuite():
2727
'''.split()
2828
suite = unittest.TestSuite()
2929
loader = unittest.defaultTestLoader
30+
mobj = None
3031
for mname in modulenames:
3132
exec ('import %s as mobj' % mname)
3233
suite.addTests(loader.loadTestsFromModule(mobj))

diffpy/utils/tests/testloaddata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class TestLoadData(unittest.TestCase):
1616
def test_loadData_default(self):
1717
"""check loadData() with default options
1818
"""
19-
d1c = numpy.arange(1, 6)
2019
d2c = numpy.array([[3, 31], [4, 32], [5, 33]])
2120
self.assertRaises(IOError, loadData, 'doesnotexist')
2221
d = loadData(loaddata01)

diffpy/utils/wx/gridutils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def limitSelectionToRows(grid, indices):
9191
'''
9292
import bisect
9393
if not indices: return
94-
cols = grid.GetNumberCols()
9594
rowblocks = _indicesToBlocks(indices)
9695
cindices = getSelectionColumns(grid) or [grid.GetGridCursorCol()]
9796
colblocks = _indicesToBlocks(cindices)

0 commit comments

Comments
 (0)