Skip to content

Commit c65c79b

Browse files
committed
Remove unused imports and unused local variables.
Stuff reported by pyflakes.
1 parent a7bf4bb commit c65c79b

25 files changed

+30
-45
lines changed

diffpy/Structure/Parsers/P_bratoms.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
"""Parser for Bruce Ravel's Atoms structure format
1717
"""
1818

19-
import sys
20-
import numpy
21-
2219
from diffpy.Structure import Lattice, Atom, StructureFormatError
2320
from diffpy.Structure.bratomsstructure import BRAtomsStructure
2421
from diffpy.Structure.Parsers import StructureParser
@@ -44,7 +41,6 @@ def parseLines(self, lines):
4441
atoms = []
4542
title = ""
4643
anext = False
47-
sg = None
4844
structure = BRAtomsStructure()
4945
meta = structure.bratoms
5046
pdict = dict.fromkeys(self.plist)
@@ -134,7 +130,7 @@ def parseLines(self, lines):
134130

135131
atoms.append(a)
136132

137-
except (ValueError, IndexError), e:
133+
except (ValueError, IndexError):
138134
emsg = "%d: file is not in Atoms format" % ln
139135
raise StructureFormatError(emsg)
140136

diffpy/Structure/Parsers/P_discus.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
"""
1818

1919
import sys
20-
import numpy
2120

22-
from diffpy.Structure import PDFFitStructure, Lattice, Atom
21+
from diffpy.Structure import PDFFitStructure, Lattice
2322
from diffpy.Structure import StructureFormatError
2423
from diffpy.Structure.Parsers import StructureParser
2524

diffpy/Structure/Parsers/P_pdb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import numpy
2626
from numpy import pi
2727

28-
from diffpy.Structure import Structure, Lattice, Atom
28+
from diffpy.Structure import Structure
2929
from diffpy.Structure import StructureFormatError
3030
from diffpy.Structure.Parsers import StructureParser
3131

@@ -117,7 +117,6 @@ def parseLines(self, lines):
117117
elif record in ("ATOM", "HETATM"):
118118
name = line[12:16].strip()
119119
rc = [float(x) for x in line[30:54].split()]
120-
xyz = numpy.dot(scale, rc) + scaleU
121120
try:
122121
occupancy = float(line[54:60])
123122
except ValueError:

diffpy/Structure/Parsers/P_pdffit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import sys
2020
import numpy
2121

22-
from diffpy.Structure import PDFFitStructure, Lattice, Atom
22+
from diffpy.Structure import PDFFitStructure, Lattice
2323
from diffpy.Structure import StructureFormatError
2424
from diffpy.Structure.Parsers import StructureParser
2525

@@ -42,7 +42,6 @@ def parseLines(self, lines):
4242
Return Structure object or raise StructureFormatError.
4343
"""
4444
p_nl = 0
45-
rlist = []
4645
try:
4746
self.stru = PDFFitStructure()
4847
stru = self.stru

diffpy/Structure/Parsers/P_rawxyz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import sys
2222

23-
from diffpy.Structure import Structure, Lattice, Atom
23+
from diffpy.Structure import Structure
2424
from diffpy.Structure import StructureFormatError
2525
from diffpy.Structure.utils import isfloat
2626
from diffpy.Structure.Parsers import StructureParser

diffpy/Structure/Parsers/P_xcfg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import re
2020
import numpy
2121

22-
from diffpy.Structure import Structure, Lattice, Atom
22+
from diffpy.Structure import Structure
2323
from diffpy.Structure import StructureFormatError
2424
from diffpy.Structure.utils import isfloat
2525
from diffpy.Structure.Parsers import StructureParser
@@ -174,7 +174,6 @@ def parseLines(self, lines):
174174
xcfg_H0_set = numpy.zeros((3,3), dtype=bool)
175175
xcfg_NO_VELOCITY = False
176176
xcfg_entry_count = None
177-
xcfg_auxiliary = []
178177
p_nl = 0
179178
p_auxiliary_re = re.compile(r"^auxiliary\[(\d+)\] =")
180179
p_auxiliary = {}

diffpy/Structure/Parsers/P_xyz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import sys
2323

24-
from diffpy.Structure import Structure, Lattice, Atom
24+
from diffpy.Structure import Structure
2525
from diffpy.Structure import StructureFormatError
2626
from diffpy.Structure.Parsers import StructureParser
2727

diffpy/Structure/Parsers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def getParser(format):
4343
emsg = "no parser for '%s' format" % format
4444
raise StructureFormatError(emsg)
4545
pmod = parser_index[format]['module']
46+
pm = None
4647
import_cmd = 'from diffpy.Structure.Parsers import %s as pm' % pmod
4748
exec(import_cmd)
4849
return pm.getParser()

diffpy/Structure/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
# interface definitions
3131
##############################################################################
3232

33-
from diffpy.Structure.StructureErrors import *
33+
from diffpy.Structure.StructureErrors import (StructureFormatError,
34+
LatticeError, SymmetryError, IsotropyError)
3435
from diffpy.Structure.atom import Atom
3536
from diffpy.Structure.lattice import Lattice
3637
from diffpy.Structure.structure import Structure

diffpy/Structure/applications/transtru.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
"""
3333

3434
import sys
35-
import os
36-
import re
3735

3836
from diffpy.Structure import Structure, StructureFormatError
3937

@@ -54,7 +52,6 @@ def usage(style = None):
5452

5553
def version():
5654
from diffpy.Structure import __version__
57-
print __id__
5855
print "diffpy.Structure", __version__
5956

6057
def main():

0 commit comments

Comments
 (0)