summaryrefslogtreecommitdiff
path: root/numpy/linalg/lapack_lite
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-21 13:46:43 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-21 17:14:34 +0200
commitf34b5091d855922c51254786d74c6cdd48fe9436 (patch)
tree1c04c4d57faa821c4c23dacc1a4ba7c56ee0e6dc /numpy/linalg/lapack_lite
parent7c3219a772aaa7439ad743e4091133f9f0672662 (diff)
downloadnumpy-f34b5091d855922c51254786d74c6cdd48fe9436.tar.gz
REV: aec0576
This is a Python 2 script, fstrings are implemented in Python 3 only.
Diffstat (limited to 'numpy/linalg/lapack_lite')
-rwxr-xr-xnumpy/linalg/lapack_lite/make_lite.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/numpy/linalg/lapack_lite/make_lite.py b/numpy/linalg/lapack_lite/make_lite.py
index bbebdf5b5..cc0d04653 100755
--- a/numpy/linalg/lapack_lite/make_lite.py
+++ b/numpy/linalg/lapack_lite/make_lite.py
@@ -81,7 +81,8 @@ class FortranRoutine:
return self._dependencies
def __repr__(self):
- return f'FortranRoutine({self.name!r}, filename={self.filename!r})'
+ return "FortranRoutine({!r}, filename={!r})".format(self.name,
+ self.filename)
class UnknownFortranRoutine(FortranRoutine):
"""Wrapper for a Fortran routine for which the corresponding file
@@ -193,7 +194,7 @@ class LapackLibrary(FortranLibrary):
def printRoutineNames(desc, routines):
print(desc)
for r in routines:
- print(f'\t{r.name}')
+ print('\t%s' % r.name)
def getLapackRoutines(wrapped_routines, ignores, lapack_dir):
blas_src_dir = os.path.join(lapack_dir, 'BLAS', 'SRC')
@@ -243,7 +244,7 @@ def dumpRoutineNames(library, output_dir):
with open(filename, 'w') as fo:
for r in routines:
deps = r.dependencies()
- fo.write(f"{r.name}: {' '.join(deps)}\n")
+ fo.write('%s: %s\n' % (r.name, ' '.join(deps)))
def concatenateRoutines(routines, output_file):
with open(output_file, 'w') as output_fo:
@@ -316,13 +317,13 @@ def create_name_header(output_dir):
# Rename BLAS/LAPACK symbols
for name in sorted(symbols):
- f.write(f'#define {name}_ BLAS_FUNC({name})\n')
+ f.write("#define %s_ BLAS_FUNC(%s)\n" % (name, name))
# Rename also symbols that f2c exports itself
f.write("\n"
"/* Symbols exported by f2c.c */\n")
for name in sorted(f2c_symbols):
- f.write(f'#define {name} numpy_lapack_lite_{name}\n')
+ f.write("#define %s numpy_lapack_lite_%s\n" % (name, name))
def main():
if len(sys.argv) != 3:
@@ -348,9 +349,9 @@ def main():
dumpRoutineNames(library, output_dir)
for typename in types:
- fortran_file = os.path.join(output_dir, f'f2c_{typename}.f')
+ fortran_file = os.path.join(output_dir, 'f2c_%s.f' % typename)
c_file = fortran_file[:-2] + '.c'
- print(f'creating {c_file} ...')
+ print('creating %s ...' % c_file)
routines = library.allRoutinesByType(typename)
concatenateRoutines(routines, fortran_file)
@@ -358,11 +359,11 @@ def main():
patch_file = os.path.basename(fortran_file) + '.patch'
if os.path.exists(patch_file):
subprocess.check_call(['patch', '-u', fortran_file, patch_file])
- print(f'Patched {fortran_file}')
+ print("Patched {}".format(fortran_file))
try:
runF2C(fortran_file, output_dir)
except F2CError:
- print(f'f2c failed on {fortran_file}')
+ print('f2c failed on %s' % fortran_file)
break
scrubF2CSource(c_file)