forked from SMTorg/smt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
133 lines (120 loc) · 3.93 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"""
Author: John T. Hwang <[email protected]>
Mohamed A. Bouhlel <[email protected]>
Remi Lafage <[email protected]>
Lucas Alber <[email protected]>
Paul Saves <[email protected]>
This package is distributed under New BSD license.
"""
import sys
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, setup
from smt import __version__
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Programming Language :: C++
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: Unix
Operating System :: MacOS
"""
LONG_DESCRIPTION = """
The surrogate modeling toolbox (SMT) is a Python package that contains \
a collection of surrogate modeling methods, sampling techniques, and \
benchmarking functions. This package provides a library of surrogate \
models that is simple to use and facilitates the implementation of additional methods. \
SMT is different from existing surrogate modeling libraries because of \
its emphasis on derivatives, including training derivatives used for \
gradient-enhanced modeling, prediction derivatives, and derivatives \
with respect to the training data. It also includes new surrogate models \
that are not available elsewhere: kriging by partial-least squares reduction \
and energy-minimizing spline interpolation.
SMT 2.0 adds the capability to handle mixed-variable surrogate models \
and hierarchical variables.
"""
extra_compile_args = []
if not sys.platform.startswith("win"):
extra_compile_args.append("-std=c++11")
ext = (
cythonize(
Extension(
"smt.surrogate_models.rbfclib",
sources=["smt/src/rbf/rbf.cpp", "smt/src/rbf/rbfclib.pyx"],
language="c++",
extra_compile_args=extra_compile_args,
include_dirs=[np.get_include()],
)
)
+ cythonize(
Extension(
"smt.surrogate_models.idwclib",
sources=["smt/src/idw/idw.cpp", "smt/src/idw/idwclib.pyx"],
language="c++",
extra_compile_args=extra_compile_args,
include_dirs=[np.get_include()],
)
)
+ cythonize(
Extension(
"smt.surrogate_models.rmtsclib",
sources=[
"smt/src/rmts/rmtsclib.pyx",
"smt/src/rmts/utils.cpp",
"smt/src/rmts/rmts.cpp",
"smt/src/rmts/rmtb.cpp",
"smt/src/rmts/rmtc.cpp",
],
language="c++",
extra_compile_args=extra_compile_args,
include_dirs=[np.get_include()],
)
)
)
metadata = dict(
name="smt",
version=__version__,
description="The Surrogate Modeling Toolbox (SMT)",
long_description=LONG_DESCRIPTION,
author="Remi Lafage et al.",
author_email="[email protected]",
license="BSD-3",
classifiers=[_f for _f in CLASSIFIERS.split("\n") if _f],
packages=[
"smt",
"smt.surrogate_models",
"smt.problems",
"smt.sampling_methods",
"smt.utils",
"smt.applications",
"smt.applications.tests",
"smt.design_space",
"smt.kernels",
],
install_requires=[
"scikit-learn",
"pyDOE3",
"scipy",
"jenn",
],
extras_require={
"numba": [ # pip install smt[numba]
"numba~=0.56.4",
],
"gpx": ["egobox~=0.23"], # pip install smt[gpx]
},
python_requires=">=3.9",
zip_safe=False,
ext_modules=ext,
url="https://github.com/SMTorg/smt", # use the URL to the github repo
download_url="https://github.com/SMTorg/smt/releases",
)
setup(**metadata)