Skip to content

Commit daaf57d

Browse files
authored
Merge pull request #70 from Tieqiong/flake8
fix Flake8
2 parents 86994f4 + f613647 commit daaf57d

26 files changed

+273
-243
lines changed

devutils/makesdist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import subprocess
1111
import sys
1212
import tarfile
1313

14+
from setup import FALLBACK_VERSION, versiondata
15+
1416
BASEDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
1517
sys.path.insert(0, BASEDIR)
1618

17-
from setup import FALLBACK_VERSION, versiondata
18-
1919
timestamp = versiondata.getint("DEFAULT", "timestamp")
2020

2121
vfb = versiondata.get("DEFAULT", "version").split(".post")[0] + ".post0"

src/diffpy/structure/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@
2929

3030
from diffpy.structure.atom import Atom
3131
from diffpy.structure.lattice import Lattice
32+
from diffpy.structure.parsers import getParser
3233
from diffpy.structure.pdffitstructure import PDFFitStructure
3334
from diffpy.structure.structure import Structure
3435
from diffpy.structure.structureerrors import LatticeError, StructureFormatError, SymmetryError
3536

36-
# obtain version information
37-
38-
"""Crystal structure container and parsers for structure formats."""
39-
4037
# package version
4138
from diffpy.structure.version import __version__
4239

40+
"""Crystal structure container and parsers for structure formats."""
41+
4342
# top level routines
4443

4544

@@ -68,7 +67,6 @@ def loadStructure(filename, fmt="auto", **kw):
6867
Return a more specific PDFFitStructure type for 'pdffit'
6968
and 'discus' formats.
7069
"""
71-
from diffpy.structure.parsers import getParser
7270

7371
p = getParser(fmt, **kw)
7472
rv = p.parseFile(filename)

src/diffpy/structure/apps/anyeye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import signal
4141
import sys
4242

43-
from diffpy.structure import StructureFormatError
43+
from diffpy.structure.structureerrors import StructureFormatError
4444

4545
# parameter dictionary
4646
pd = {

src/diffpy/structure/apps/transtru.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535

3636
import sys
3737

38-
from diffpy.structure import Structure, StructureFormatError
38+
from diffpy.structure import Structure
39+
from diffpy.structure.structureerrors import StructureFormatError
3940

4041

4142
def usage(style=None):

src/diffpy/structure/mmlibspacegroups.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
2-
## Copyright 2002 by PyMMLib Development Group, http://pymmlib.sourceforge.net/
3-
## This code is part of the PyMMLib distribution and governed by
4-
## its license. Please see the LICENSE_pymmlib file that should have been
5-
## included as part of this package.
2+
# Copyright 2002 by PyMMLib Development Group, http://pymmlib.sourceforge.net/
3+
# This code is part of the PyMMLib distribution and governed by
4+
# its license. Please see the LICENSE_pymmlib file that should have been
5+
# included as part of this package.
66
"""Space groups defined as a part of the pymmlib.
77
"""
88

@@ -107,7 +107,7 @@
107107
Tr_34_34_34,
108108
)
109109

110-
## spacegroup definitions
110+
# spacegroup definitions
111111
sg1 = SpaceGroup(
112112
number=1,
113113
num_sym_equiv=1,
@@ -7884,7 +7884,7 @@
78847884
)
78857885

78867886

7887-
## list of the space groups
7887+
# list of the space groups
78887888
mmLibSpaceGroupList = [
78897889
sg1,
78907890
sg2,

src/diffpy/structure/parsers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
outputFormats -- list of available output formats
3232
"""
3333

34-
from diffpy.structure import StructureFormatError
3534
from diffpy.structure.parsers.parser_index_mod import parser_index
3635
from diffpy.structure.parsers.structureparser import StructureParser
36+
from diffpy.structure.structureerrors import StructureFormatError
3737

3838
# silence pyflakes checker
3939
assert StructureParser

src/diffpy/structure/parsers/p_auto.py

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

2121
import os
2222

23-
from diffpy.structure import StructureFormatError
2423
from diffpy.structure.parsers import StructureParser, parser_index
24+
from diffpy.structure.structureerrors import StructureFormatError
2525

2626

2727
class P_auto(StructureParser):

src/diffpy/structure/parsers/p_cif.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
import numpy
2626
import six
2727

28-
from diffpy.structure import Atom, Lattice, Structure, StructureFormatError
28+
from diffpy.structure import Atom, Lattice, Structure
2929
from diffpy.structure.parsers import StructureParser
30+
from diffpy.structure.structureerrors import StructureFormatError
3031

3132
# ----------------------------------------------------------------------------
3233

@@ -460,7 +461,7 @@ def _parse_atom_site_aniso_label(self, block):
460461
break
461462
idx = self.labelindex[lb]
462463
a = self.stru[idx]
463-
if not lb in self.anisotropy:
464+
if lb not in self.anisotropy:
464465
a.anisotropy = True
465466
self.anisotropy[lb] = True
466467
for fset, val in zip(prop_setters, values):
@@ -544,7 +545,7 @@ def _expandAsymmetricUnit(self, block):
544545
# setup anisotropy according to symmetry requirements
545546
# unless it was already explicitly set
546547
for ca, uisotropy in zip(self.stru, self.eau.Uisotropy):
547-
if not ca.label in self.anisotropy:
548+
if ca.label not in self.anisotropy:
548549
ca.anisotropy = not uisotropy
549550
self.anisotropy[ca.label] = ca.anisotropy
550551
# build a nested list of new atoms:

src/diffpy/structure/parsers/p_discus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
import six
2323

24-
from diffpy.structure import Lattice, PDFFitStructure, StructureFormatError
24+
from diffpy.structure import Lattice, PDFFitStructure
2525
from diffpy.structure.parsers import StructureParser
26+
from diffpy.structure.structureerrors import StructureFormatError
2627

2728

2829
class P_discus(StructureParser):

src/diffpy/structure/parsers/p_pdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
import six
2828
from numpy import pi
2929

30-
from diffpy.structure import Structure, StructureFormatError
30+
from diffpy.structure import Structure
3131
from diffpy.structure.parsers import StructureParser
32+
from diffpy.structure.structureerrors import StructureFormatError
3233

3334

3435
class P_pdb(StructureParser):

0 commit comments

Comments
 (0)