Skip to content

Commit 0927c7a

Browse files
authored
Merge pull request #76 from bobleesj/cookie-flake8-E402
Fix flake8 error of importing modules at the top (E402)
2 parents 12507e8 + bf1fcaf commit 0927c7a

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
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"

doc/manual/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import sys
1717
import time
1818

19+
from setup import versiondata
20+
1921
# If extensions (or modules to document with autodoc) are in another directory,
2022
# add these directories to sys.path here. If the directory is relative to the
2123
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -61,7 +63,7 @@
6163
# |version| and |release|, also used in various other places throughout the
6264
# built documents.
6365
sys.path.insert(0, os.path.abspath("../../.."))
64-
from setup import versiondata
66+
6567

6668
fullversion = versiondata.get("DEFAULT", "version")
6769
# The short X.Y version.

src/diffpy/srfit/equation/builder.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@
9393
# right-side over its arguments. This results in an array of BaseBuilder
9494
# instances, not an BaseBuilder that contains an array.
9595

96-
_builders = {}
97-
98-
9996
import inspect
10097
import numbers
10198

@@ -106,6 +103,8 @@
106103
from diffpy.srfit.equation.equationmod import Equation
107104
from diffpy.srfit.equation.literals.literal import Literal
108105

106+
_builders = {}
107+
109108

110109
class EquationFactory(object):
111110
"""A Factory for equations.
@@ -364,16 +363,9 @@ def _getUndefinedArgs(self, eqstr):
364363
# generated.
365364
for tok in set(args):
366365
# Move genuine varibles to the eqargs dictionary
367-
if (
368-
# Check registered builders
369-
tok in self.builders
370-
or
371-
# Check symbols
372-
tok in EquationFactory.symbols
373-
or
374-
# Check ignored characters
375-
tok in EquationFactory.ignore
376-
):
366+
if (tok in self.builders or # Check registered builders
367+
tok in EquationFactory.symbols or # Check symbols
368+
tok in EquationFactory.ignore): # Check ignored characters
377369
args.remove(tok)
378370

379371
return args

0 commit comments

Comments
 (0)