Skip to content

Commit

Permalink
PEP8: Fix E401 multiple imports on one line
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Apr 12, 2013
1 parent 7184be0 commit e4b28cf
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 12 deletions.
4 changes: 3 additions & 1 deletion scipy/lib/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

__all__ = ["decorator", "FunctionMaker", "partial"]

import sys, re, inspect
import sys
import re
import inspect

from scipy.lib.six import exec_

Expand Down
9 changes: 6 additions & 3 deletions scipy/misc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def lena():
>>> plt.show()
"""
import pickle, os
import pickle
import os
fname = os.path.join(os.path.dirname(__file__),'lena.dat')
f = open(fname,'rb')
lena = array(pickle.load(f))
Expand Down Expand Up @@ -522,7 +523,8 @@ def ascent():
>>> plt.show()
"""
import pickle, os
import pickle
import os
fname = os.path.join(os.path.dirname(__file__),'ascent.dat')
with open(fname, 'rb') as f:
ascent = array(pickle.load(f))
Expand Down Expand Up @@ -561,7 +563,8 @@ def face(gray=False):
>>> plt.show()
"""
import bz2, os
import bz2
import os
with open(os.path.join(os.path.dirname(__file__), 'face.dat'), 'rb') as f:
rawdata = f.read()
data = bz2.decompress(rawdata)
Expand Down
3 changes: 2 additions & 1 deletion scipy/sparse/linalg/dsolve/tests/test_linsolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def test_lu_refcount(self):
lu = splu(a_)

# And now test that we don't have a refcount bug
import gc, sys
import gc
import sys
rc = sys.getrefcount(lu)
for attr in ('perm_r', 'perm_c'):
perm = getattr(lu, attr)
Expand Down
4 changes: 3 additions & 1 deletion scipy/sparse/linalg/dsolve/umfpack/tests/try_umfpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

from optparse import OptionParser
import time
import urllib.request, urllib.parse, urllib.error
import urllib.request
import urllib.parse
import urllib.error
import gzip

import numpy as np
Expand Down
5 changes: 4 additions & 1 deletion scipy/weave/examples/md5_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
"""
from __future__ import absolute_import, print_function

import random, md5, time, cStringIO
import random
import md5
import time
import cStringIO

def speed(n,m):
s = 'a'*n
Expand Down
3 changes: 2 additions & 1 deletion scipy/weave/ext_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ def indent(st,spaces):

def format_error_msg(errors):
#minimum effort right now...
import pprint,cStringIO
import pprint
import cStringIO
msg = cStringIO.StringIO()
pprint.pprint(errors,msg)
return msg.getvalue()
4 changes: 3 additions & 1 deletion scipy/weave/platform_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"""
from __future__ import absolute_import, print_function

import os, sys, subprocess
import os
import sys
import subprocess

import distutils
from distutils.sysconfig import customize_compiler
Expand Down
5 changes: 4 additions & 1 deletion scipy/weave/tests/test_build_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# tests for MingW32Compiler
# don't know how to test gcc_exists() and msvc_exists()...

import os, sys, tempfile, warnings
import os
import sys
import tempfile
import warnings

from numpy.testing import TestCase, assert_

Expand Down
3 changes: 2 additions & 1 deletion scipy/weave/tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class TestGetCatalog(TestCase):

def get_test_dir(self,erase = 0):
# make sure tempdir catalog doesn't exist
import tempfile, glob
import tempfile
import glob
#temp = tempfile.gettempdir()
pardir = tempfile.mktemp(suffix='cat_test')
if not os.path.exists(pardir):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ commands=python {toxinidir}/tools/test-installed-scipy.py {posargs:}
[pep8]
max_line_length=200
statistics = True
ignore = E12,E20,E21,E22,E23,E24,E25,E26,E271,E3,E4,E5,E701,E702,E71,E72
ignore = E12,E20,E21,E22,E23,E24,E25,E26,E271,E3,E5,E701,E702,E71,E72
exclude = scipy/sparse/linalg/dsolve/umfpack/_umfpack.py,scipy/sparse/sparsetools/bsr.py,scipy/sparse/sparsetools/coo.py,scipy/sparse/sparsetools/csc.py,scipy/sparse/sparsetools/csgraph.py,scipy/sparse/sparsetools/csr.py,scipy/sparse/sparsetools/dia.py

0 comments on commit e4b28cf

Please sign in to comment.