Skip to content

Commit a96dbd3

Browse files
author
Bill Ladwig
committed
PEP 8
1 parent 7c2b7d1 commit a96dbd3

File tree

2 files changed

+109
-106
lines changed

2 files changed

+109
-106
lines changed

chey_intel.py

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
def intel_version_match(type):
1515
# Match against the important stuff in the version string
16-
return simple_version_match(start=r'Intel.*?Fortran.*?(?:%s).*?Version' % (type,))
16+
return simple_version_match(
17+
start=r'Intel.*?Fortran.*?(?:%s).*?Version'.format(type,))
1718

1819

1920
class BaseIntelFCompiler(FCompiler):
@@ -36,13 +37,13 @@ class IntelFCompiler(BaseIntelFCompiler):
3637
possible_executables = ['ifort', 'ifc']
3738

3839
executables = {
39-
'version_cmd' : None, # set by update_executables
40-
'compiler_f77' : [None, "-72", "-w90", "-w95"],
41-
'compiler_f90' : [None],
42-
'compiler_fix' : [None, "-FI"],
43-
'linker_so' : ["<F90>", "-shared"],
44-
'archiver' : ["ar", "-cr"],
45-
'ranlib' : ["ranlib"]
40+
'version_cmd': None, # set by update_executables
41+
'compiler_f77': [None, "-72", "-w90", "-w95"],
42+
'compiler_f90': [None],
43+
'compiler_fix': [None, "-FI"],
44+
'linker_so': ["<F90>", "-shared"],
45+
'archiver': ["ar", "-cr"],
46+
'ranlib': ["ranlib"]
4647
}
4748

4849
pic_flags = ['-fPIC']
@@ -89,13 +90,13 @@ class IntelItaniumFCompiler(IntelFCompiler):
8990
possible_executables = ['ifort', 'efort', 'efc']
9091

9192
executables = {
92-
'version_cmd' : None,
93-
'compiler_f77' : [None, "-FI", "-w90", "-w95"],
94-
'compiler_fix' : [None, "-FI"],
95-
'compiler_f90' : [None],
96-
'linker_so' : ['<F90>', "-shared"],
97-
'archiver' : ["ar", "-cr"],
98-
'ranlib' : ["ranlib"]
93+
'version_cmd': None,
94+
'compiler_f77': [None, "-FI", "-w90", "-w95"],
95+
'compiler_fix': [None, "-FI"],
96+
'compiler_f90': [None],
97+
'linker_so': ['<F90>', "-shared"],
98+
'archiver': ["ar", "-cr"],
99+
'ranlib': ["ranlib"]
99100
}
100101

101102

@@ -104,18 +105,19 @@ class IntelEM64TFCompiler(IntelFCompiler):
104105
compiler_aliases = ()
105106
description = 'Intel Fortran Compiler for 64-bit apps'
106107

107-
version_match = intel_version_match('EM64T-based|Intel\\(R\\) 64|64|IA-64|64-bit')
108+
version_match = intel_version_match(
109+
'EM64T-based|Intel\\(R\\) 64|64|IA-64|64-bit')
108110

109111
possible_executables = ['ifort', 'efort', 'efc']
110112

111113
executables = {
112-
'version_cmd' : None,
113-
'compiler_f77' : [None, "-FI"],
114-
'compiler_fix' : [None, "-FI"],
115-
'compiler_f90' : [None],
116-
'linker_so' : ['<F90>', "-shared"],
117-
'archiver' : ["ar", "-cr"],
118-
'ranlib' : ["ranlib"]
114+
'version_cmd': None,
115+
'compiler_f77': [None, "-FI"],
116+
'compiler_fix': [None, "-FI"],
117+
'compiler_f90': [None],
118+
'linker_so': ['<F90>', "-shared"],
119+
'archiver': ["ar", "-cr"],
120+
'ranlib': ["ranlib"]
119121
}
120122

121123
def get_flags(self):
@@ -147,13 +149,13 @@ def update_executables(self):
147149
possible_executables = ['ifort', 'ifl']
148150

149151
executables = {
150-
'version_cmd' : None,
151-
'compiler_f77' : [None],
152-
'compiler_fix' : [None],
153-
'compiler_f90' : [None],
154-
'linker_so' : [None],
155-
'archiver' : [ar_exe, "/verbose", "/OUT:"],
156-
'ranlib' : None
152+
'version_cmd': None,
153+
'compiler_f77': [None],
154+
'compiler_fix': [None],
155+
'compiler_f90': [None],
156+
'linker_so': [None],
157+
'archiver': [ar_exe, "/verbose", "/OUT:"],
158+
'ranlib': None
157159
}
158160

159161
compile_switch = '/c '
@@ -163,7 +165,8 @@ def update_executables(self):
163165
module_include_switch = '/I'
164166

165167
def get_flags(self):
166-
opt = ['/nologo', '/MD', '/nbs', '/names:lowercase', '/assume:underscore']
168+
opt = ['/nologo', '/MD', '/nbs', '/names:lowercase',
169+
'/assume:underscore']
167170
return opt
168171

169172
def get_flags_free(self):
@@ -192,13 +195,13 @@ class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
192195
ar_exe = IntelVisualFCompiler.ar_exe
193196

194197
executables = {
195-
'version_cmd' : None,
196-
'compiler_f77' : [None, "-FI", "-w90", "-w95"],
197-
'compiler_fix' : [None, "-FI", "-4L72", "-w"],
198-
'compiler_f90' : [None],
199-
'linker_so' : ['<F90>', "-shared"],
200-
'archiver' : [ar_exe, "/verbose", "/OUT:"],
201-
'ranlib' : None
198+
'version_cmd': None,
199+
'compiler_f77': [None, "-FI", "-w90", "-w95"],
200+
'compiler_fix': [None, "-FI", "-4L72", "-w"],
201+
'compiler_f90': [None],
202+
'linker_so': ['<F90>', "-shared"],
203+
'archiver': [ar_exe, "/verbose", "/OUT:"],
204+
'ranlib': None
202205
}
203206

204207

setup.py

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import chey_intel
1818
import numpy.distutils.core
1919
import numpy.distutils.fcompiler.intel
20-
20+
2121
numpy.distutils.fcompiler.intel.IntelFCompiler = chey_intel.IntelFCompiler
2222
numpy.distutils.fcompiler.intel.IntelVisualFCompiler = (
2323
chey_intel.IntelVisualFCompiler)
@@ -31,33 +31,33 @@
3131
chey_intel.IntelEM64TFCompiler)
3232

3333
ext1 = numpy.distutils.core.Extension(
34-
name = "wrf._wrffortran",
35-
sources = ["fortran/wrf_constants.f90",
36-
"fortran/wrf_testfunc.f90",
37-
"fortran/wrf_user.f90",
38-
"fortran/rip_cape.f90",
39-
"fortran/wrf_cloud_fracf.f90",
40-
"fortran/wrf_fctt.f90",
41-
"fortran/wrf_user_dbz.f90",
42-
"fortran/wrf_relhl.f90",
43-
"fortran/calc_uh.f90",
44-
"fortran/wrf_user_latlon_routines.f90",
45-
"fortran/wrf_pvo.f90",
46-
"fortran/eqthecalc.f90",
47-
"fortran/wrf_rip_phys_routines.f90",
48-
"fortran/wrf_pw.f90",
49-
"fortran/wrf_vinterp.f90",
50-
"fortran/wrf_wind.f90",
51-
"fortran/omp.f90"]
34+
name="wrf._wrffortran",
35+
sources=["fortran/wrf_constants.f90",
36+
"fortran/wrf_testfunc.f90",
37+
"fortran/wrf_user.f90",
38+
"fortran/rip_cape.f90",
39+
"fortran/wrf_cloud_fracf.f90",
40+
"fortran/wrf_fctt.f90",
41+
"fortran/wrf_user_dbz.f90",
42+
"fortran/wrf_relhl.f90",
43+
"fortran/calc_uh.f90",
44+
"fortran/wrf_user_latlon_routines.f90",
45+
"fortran/wrf_pvo.f90",
46+
"fortran/eqthecalc.f90",
47+
"fortran/wrf_rip_phys_routines.f90",
48+
"fortran/wrf_pw.f90",
49+
"fortran/wrf_vinterp.f90",
50+
"fortran/wrf_wind.f90",
51+
"fortran/omp.f90"]
5252
)
5353

54-
with open("src/wrf/version.py") as f:
54+
with open("src/wrf/version.py") as f:
5555
exec(f.read())
5656

5757
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
58-
#on_rtd=True
58+
# on_rtd=True
5959
if on_rtd:
60-
if sys.version_info < (3,3):
60+
if sys.version_info < (3, 3):
6161
requirements = ["mock"] # for python2 and python < 3.3
6262
else:
6363
requirements = [] # for >= python3.3
@@ -67,53 +67,53 @@
6767
# Place install_requires into the text file "requirements.txt"
6868
with open("requirements.txt") as f2:
6969
requirements = f2.read().strip().splitlines()
70-
71-
#if sys.version_info < (3,3):
72-
# requirements.append("mock")
70+
71+
# if sys.version_info < (3,3):
72+
# requirements.append("mock")
7373
ext_modules = [ext1]
7474

7575

76-
numpy.distutils.core.setup(
77-
author = "Bill Ladwig",
78-
author_email = "[email protected]",
79-
description = "Diagnostic and interpolation routines for WRF-ARW data.",
80-
long_description = ("A collection of diagnostic and interpolation routines "
81-
"to be used with WRF-ARW data.\n\n"
82-
"GitHub Repository:\n\n"
83-
"https://github.com/NCAR/wrf-python\n\n"
84-
"Documentation:\n\n"
85-
"http://wrf-python.rtfd.org\n"),
86-
url = "https://github.com/NCAR/wrf-python",
87-
keywords = ["python", "wrf-python", "wrf", "forecast", "model",
88-
"weather research and forecasting", "interpolation",
89-
"plotting", "plots", "meteorology", "nwp",
90-
"numerical weather prediction", "diagnostic",
91-
"science", "numpy"],
92-
install_requires = requirements,
93-
classifiers = ["Development Status :: 5 - Production/Stable",
94-
"Intended Audience :: Science/Research",
95-
"Intended Audience :: Developers",
96-
"License :: OSI Approved :: Apache Software License",
97-
"Programming Language :: Fortran",
98-
"Programming Language :: Python :: 2.7",
99-
"Programming Language :: Python :: 3.4",
100-
"Programming Language :: Python :: 3.5",
101-
"Programming Language :: Python :: 3.6",
102-
"Programming Language :: Python :: 3.7",
103-
"Topic :: Scientific/Engineering :: Atmospheric Science",
104-
"Topic :: Software Development",
105-
"Operating System :: POSIX",
106-
"Operating System :: Unix",
107-
"Operating System :: MacOS",
108-
"Operating System :: Microsoft :: Windows"],
109-
name = "wrf-python",
110-
platforms = ["any"],
111-
license = "Apache License 2.0",
112-
version = __version__,
113-
packages = setuptools.find_packages("src"),
114-
ext_modules = ext_modules,
115-
package_dir = {"" : "src"},
116-
download_url = "http://python.org/pypi/wrf-python",
117-
package_data={"wrf" : ["data/psadilookup.dat"]},
76+
numpy.distutils.core.setup(
77+
author="Bill Ladwig",
78+
author_email="[email protected]",
79+
description="Diagnostic and interpolation routines for WRF-ARW data.",
80+
long_description=("A collection of diagnostic and interpolation "
81+
"routines to be used with WRF-ARW data.\n\n"
82+
"GitHub Repository:\n\n"
83+
"https://github.com/NCAR/wrf-python\n\n"
84+
"Documentation:\n\n"
85+
"http://wrf-python.rtfd.org\n"),
86+
url="https://github.com/NCAR/wrf-python",
87+
keywords=["python", "wrf-python", "wrf", "forecast", "model",
88+
"weather research and forecasting", "interpolation",
89+
"plotting", "plots", "meteorology", "nwp",
90+
"numerical weather prediction", "diagnostic",
91+
"science", "numpy"],
92+
install_requires=requirements,
93+
classifiers=["Development Status :: 5 - Production/Stable",
94+
"Intended Audience :: Science/Research",
95+
"Intended Audience :: Developers",
96+
"License :: OSI Approved :: Apache Software License",
97+
"Programming Language :: Fortran",
98+
"Programming Language :: Python :: 2.7",
99+
"Programming Language :: Python :: 3.4",
100+
"Programming Language :: Python :: 3.5",
101+
"Programming Language :: Python :: 3.6",
102+
"Programming Language :: Python :: 3.7",
103+
"Topic :: Scientific/Engineering :: Atmospheric Science",
104+
"Topic :: Software Development",
105+
"Operating System :: POSIX",
106+
"Operating System :: Unix",
107+
"Operating System :: MacOS",
108+
"Operating System :: Microsoft :: Windows"],
109+
name="wrf-python",
110+
platforms=["any"],
111+
license="Apache License 2.0",
112+
version=__version__,
113+
packages=setuptools.find_packages("src"),
114+
ext_modules=ext_modules,
115+
package_dir={"": "src"},
116+
download_url="http://python.org/pypi/wrf-python",
117+
package_data={"wrf": ["data/psadilookup.dat"]},
118118
scripts=[]
119-
)
119+
)

0 commit comments

Comments
 (0)