8000 Merge pull request #15452 from mwtoews/E401 · numpy/numpy@29873a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29873a0

Browse files
authored
Merge pull request #15452 from mwtoews/E401
STY,MAINT: avoid 'multiple imports on one line'
2 parents e0d289c + d2f1d77 commit 29873a0

File tree

11 files changed

+41
-18
lines changed

11 files changed

+41
-18
lines changed

doc/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
import sys, os, re
2+
import os
3+
import re
4+
import sys
35

46
# Minimum version, enforced by sphinx
57
needs_sphinx = '2.2.0'

doc/summarize.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
Show a summary about which NumPy functions are documented and which are not.
66
77
"""
8-
import os, glob, re, sys, inspect, optparse
98
import collections.abc
9+
import glob
10+
import inspect
11+
import optparse
12+
import os
13+
import sys
1014

1115
sys.path.append(os.path.join(os.path.dirname(__file__), 'sphinxext'))
1216
from sphinxext.phantom_import import import_phantom_module
@@ -98,7 +102,11 @@ def check_numpy():
98102
documented = get_documented(glob.glob(SOURCE_DIR + '/*.rst'))
99103
undocumented = {}
100104

101-
import numpy, numpy.fft, numpy.linalg, numpy.random
105+
import numpy
106+
import numpy.fft
107+
import numpy.linalg
108+
import numpy.random
109+
102110
for mod in [numpy, numpy.fft, numpy.linalg, numpy.random,
103111
numpy.ctypeslib, numpy.emath, numpy.ma]:
104112
undocumented.update(get_undocumented(documented, mod, skip=SKIP_LIST))

numpy/core/code_generators/genapi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"""
99
from numpy.distutils.conv_template import process_file as process_c_file
1010

11-
import sys, os, re
1211
import hashlib
1312
import io
14-
13+
import os
14+
import re
15+
import sys
1516
import textwrap
1617

1718
from os.path import join

numpy/core/tests/test_scalarprint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
""" Test printing of scalar types.
33
44
"""
5-
import code, sys
5+
import code
66
import platform
77
import pytest
8+
import sys
89

910
from tempfile import TemporaryFile
1011
import 67F4 numpy as np

numpy/distutils/command/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
# try_compile call. try_run works but is untested for most of Fortran
33
# compilers (they must define linker_exe first).
44
# Pearu Peterson
5-
import os, signal
6-
import warnings
7-
import sys
5+
import os
6+
import signal
87
import subprocess
8+
import sys
99
import textwrap
10+
import warnings
1011

1112
from distutils.command.config import config as old_config
1213
from distutils.command.config import LANG_EXT

numpy/distutils/cpuinfo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
"""
1515
__all__ = ['cpu']
1616

17-
import sys, re, types
1817
import os
18+
import platform
19+
import re
20+
import sys
21+
import types
22+
import warnings
1923

2024
from subprocess import getstatusoutput
2125

22-
import warnings
23-
import platform
2426

2527
def getoutput(cmd, successful_status=(0,), stacklevel=1):
2628
try:

numpy/distutils/line_endings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
""" Functions for converting from DOS to UNIX line endings
22
33
"""
4-
import sys, re, os
4+
import os
5+
import re
6+
import sys
7+
58

69
def dos2unix(file):
710
"Replace CRLF with LF in argument files. Print names of changed files."

numpy/doc/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
#
1414
# Note: the docstring is autogenerated.
1515
#
16-
import textwrap, re
16+
import re
17+
import textwrap
1718

1819
# Maintain same format as in numpy.add_newdocs
1920
constants = []

numpy/linalg/lapack_lite/clapack_scrub.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
2-
import sys, os
2+
import os
33
import re
4+
import sys
45
from io import StringIO
56

67
from plex import Scanner, Str, Lexicon, Opt, Bol, State, AnyChar, TEXT, IGNORE

numpy/random/tests/test_extending.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import os, sys
1+
import os
22
import pytest
3-
import warnings
43
import shutil
54
import subprocess
5+
import sys
6+
import warnings
67

78
try:
89
import cffi

0 commit comments

Comments
 (0)
0