Skip to content

Commit 85361f6

Browse files
committed
Fix several issues reported by pyflakes.
Add assert statements for intentionally unused variables.
1 parent d8bac51 commit 85361f6

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

diffpy/Structure/Parsers/P_cif.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ def _parse_space_group_symop_operation_xyz(self, block):
438438
sym_loop_name = sym_loop_name[0]
439439
sym_loop = block.GetLoop(sym_loop_name)
440440
for eqxyz in sym_loop[sym_loop_name]:
441-
op = getSymOp(eqxyz)
442-
symop_list.append(op)
441+
opcif = getSymOp(eqxyz)
442+
symop_list.append(opcif)
443443
# determine space group number
444444
sg_nameHall = (block.get('_space_group_name_Hall', '') or
445445
block.get('_symmetry_space_group_name_Hall', ''))

diffpy/Structure/Parsers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from diffpy.Structure.Parsers.structureparser import StructureParser
3636
from diffpy.Structure.Parsers.parser_index_mod import parser_index
3737

38+
# silence pyflakes checker
39+
assert StructureParser
40+
3841
def getParser(format, **kw):
3942
"""Return Parser instance for a given structure format.
4043

diffpy/Structure/SymmetryUtilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def expandPosition(spacegroup, xyz, sgoffset=[0,0,0], eps=None):
228228
# here tpl is inside site_symops
229229
site_symops[tpl].append(symop)
230230
# pos_symops is nested list of symops associated with each position
231-
pos_symops = [ site_symops[pos2tuple(pos)] for pos in positions ]
231+
pos_symops = [site_symops[pos2tuple(p)] for p in positions]
232232
multiplicity = len(positions)
233233
return positions, pos_symops, multiplicity
234234

diffpy/Structure/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,13 @@ def loadStructure(filename, fmt='auto', **kw):
5959
rv = p.parseFile(filename)
6060
return rv
6161

62+
# silence pyflakes checker
63+
assert (StructureFormatError and
64+
LatticeError and SymmetryError and IsotropyError)
65+
assert Atom
66+
assert Lattice
67+
assert Structure
68+
assert PDFFitStructure
69+
assert __version__ or True
70+
6271
# End of file

diffpy/Structure/expansion/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@
2424

2525
from diffpy.Structure.expansion.supercell_mod import supercell
2626

27+
# silence pyflakes checker
28+
assert supercell
29+
2730
# End of file

0 commit comments

Comments
 (0)