diff options
author | mattip <matti.picus@gmail.com> | 2019-05-20 16:54:55 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-05-20 19:00:38 +0300 |
commit | e058ae46f534f675bb39e521eacc5874c0149c11 (patch) | |
tree | 22b3112b1494d23744bec583499258b549d5c24b /numpy/random/_mtrand/generate_mtrand_c.py | |
parent | 720a0a9a6baa3cb0ded826933807b2be061bfe2c (diff) | |
download | numpy-e058ae46f534f675bb39e521eacc5874c0149c11.tar.gz |
MAINT: remove unused file
Diffstat (limited to 'numpy/random/_mtrand/generate_mtrand_c.py')
-rw-r--r-- | numpy/random/_mtrand/generate_mtrand_c.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/numpy/random/_mtrand/generate_mtrand_c.py b/numpy/random/_mtrand/generate_mtrand_c.py deleted file mode 100644 index ec935e6dd..000000000 --- a/numpy/random/_mtrand/generate_mtrand_c.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -from __future__ import division, absolute_import, print_function - -import sys -import re -import os - -unused_internal_funcs = ['__Pyx_PrintItem', - '__Pyx_PrintNewline', - '__Pyx_ReRaise', - #'__Pyx_GetExcValue', - '__Pyx_ArgTypeTest', - '__Pyx_SetVtable', - '__Pyx_GetVtable', - '__Pyx_CreateClass'] - -if __name__ == '__main__': - # Use cython here so that long docstrings are broken up. - # This is needed for some VC++ compilers. - os.system('cython mtrand.pyx') - mtrand_c = open('mtrand.c', 'r') - processed = open('mtrand_pp.c', 'w') - unused_funcs_str = '(' + '|'.join(unused_internal_funcs) + ')' - uifpat = re.compile(r'static \w+ \*?'+unused_funcs_str+r'.*/\*proto\*/') - linepat = re.compile(r'/\* ".*/mtrand.pyx":') - for linenum, line in enumerate(mtrand_c): - m = re.match(r'^(\s+arrayObject\w*\s*=\s*[(])[(]PyObject\s*[*][)]', - line) - if m: - line = '%s(PyArrayObject *)%s' % (m.group(1), line[m.end():]) - m = uifpat.match(line) - if m: - line = '' - m = re.search(unused_funcs_str, line) - if m: - print("%s was declared unused, but is used at line %d" % (m.group(), - linenum+1), file=sys.stderr) - line = linepat.sub(r'/* "mtrand.pyx":', line) - processed.write(line) - mtrand_c.close() - processed.close() - os.rename('mtrand_pp.c', 'mtrand.c') |