-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
executable file
·117 lines (105 loc) · 3.17 KB
/
setup.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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import platform
try:
from setuptools import Extension, setup
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Build import cythonize
except ImportError:
raise ImportError('Cython must be installed.')
import numpy as np
compile_args = ['-fopenmp']
link_args = ['-fopenmp']
if platform.system().lower() == 'darwin':
compile_args.insert(0, '-Xpreprocessor')
link_args = ['-lomp']
def get_extensions():
return [
Extension(
'*',
sources=['src/satsmooth/detect/_signal.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/preprocessing/_linear_interp.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/preprocessing/_linear_interp_regrid.pyx'],
language='c++',
),
Extension(
'*',
sources=[
'src/satsmooth/preprocessing/_linear_interp_regrid_multi.pyx'
],
extra_compile_args=compile_args,
extra_link_args=link_args,
language='c++',
),
Extension(
'*',
sources=[
'src/satsmooth/preprocessing/_linear_interp_regrid_multi_indexing.pyx'
],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/preprocessing/_fill_gaps.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/preprocessing/_outlier_removal.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/anc/_dl.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/anc/_lowess_smooth.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
language='c++',
),
Extension(
'*',
sources=['src/satsmooth/smooth/_adaptive_bilateral.pyx'],
language='c++',
),
Extension('*', sources=['src/satsmooth/smooth/_rolling1d.pyx']),
Extension(
'*',
sources=['src/satsmooth/smooth/_rolling2d.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
),
Extension(
'*',
sources=['src/satsmooth/smooth/_spatial_temporal.pyx'],
extra_compile_args=compile_args,
extra_link_args=link_args,
language='c++',
),
]
def setup_package():
metadata = dict(
ext_modules=cythonize(get_extensions()),
include_dirs=[np.get_include()],
)
setup(**metadata)
if __name__ == '__main__':
setup_package()