forked from nilmtk/nilmtk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_max.py
More file actions
62 lines (46 loc) · 1.75 KB
/
setup_max.py
File metadata and controls
62 lines (46 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'''
This is the central cython setup file, which compiles all the cython .pyx files of the project.
It has to be run whenever a change has been made to the files.
Targeted files:
- nilmtk/disaggregate/accelerators.pyx
- nilmtk/stats/accelerators_stat.pyx
'''
# python setup.py build_ext --inplace
from distutils.core import setup
from Cython.Build import cythonize
import numpy
setup(
ext_modules = cythonize(["nilmtk/disaggregate/accelerators.pyx", "nilmtk/stats/accelerators_stat.pyx"], language="c++"),
include_dirs=[numpy.get_include()]
)
##Use this setup.py if you want setup to automatically cythonize all pyx in the codeRootFolder
##To run this setup do exefile('pathToThisSetup.py')
#import os
#from distutils.core import setup
#from distutils.extension import Extension
#from Cython.Distutils import build_ext
#def scandir(dir, files=[]):
# for file in os.listdir(dir):
# path = os.path.join(dir, file)
# if os.path.isfile(path) and path.endswith(".pyx"):
# files.append(path.replace(os.path.sep, ".")[:-4])
# elif os.path.isdir(path):
# scandir(path, files)
# return files
#def makeExtension(extName):
# extPath = extName.replace(".", os.path.sep)+".pyx"
# return Extension(
# extName,
# [extPath],
# include_dirs = ['.'] #your include_dirs must contains the '.' for setup to search all the subfolder of the codeRootFolder
# )
#extNames = scandir('codeRootFolder')
#extensions = [makeExtension(name) for name in extNames]
#setup(
# name="workingCythonMultiPackageProject",
# ext_modules=extensions,
# cmdclass = {'build_ext': build_ext},
# script_args = ['build_ext'],
# options = {'build_ext':{'inplace':True, 'force':True}}
#)
#print '********CYTHON COMPLETE******'