-
Notifications
You must be signed in to change notification settings - Fork 3
/
cythonizer.py
25 lines (20 loc) · 943 Bytes
/
cythonizer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from distutils.core import Extension
from Cython.Build import cythonize
cython_directives = {
'language_level': 3,
'cdivision': True,
'wraparound': False,
'boundscheck': False,
'initializedcheck': False,
'profile': False,
}
math = Extension('spyct._math', sources=[os.path.join('spyct', '_math.pyx')])
matrix = Extension('spyct._matrix', sources=[os.path.join('spyct', '_matrix.pyx')])
data = Extension('spyct.data', sources=[os.path.join('spyct', 'data.pyx')])
grad_splitter = Extension('spyct.grad_split', sources=[os.path.join('spyct', 'grad_split.pyx')])
clustering = Extension('spyct.clustering', sources=[os.path.join('spyct', 'clustering.pyx')])
node = Extension('spyct.node', sources=[os.path.join('spyct', 'node.pyx')])
cythonize([math, matrix, data, grad_splitter, clustering, node],
compiler_directives=cython_directives,
force=True, annotate=True, build_dir='cythonized')