-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
126 lines (120 loc) · 4.03 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
import io
import os
import platform
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Build import cythonize
import numpy
except:
raise SystemExit(
"Cython>=0.28 and numpy are required. Please install before proceeding"
)
REQUIRED = ["numpy>=1.14", "Cython>=0.28", "scipy>=1.1", "numdifftools>=0.9"]
EXTRA_REQUIRED = {"test": ["mock", "nose"], "docs": ["Sphinx", "sphinx-rtd-theme>=0.4"]}
DESCRIPTION = "parameter estimation for simple Hawkes (self-exciting) processes"
CLASSIFIERS = [
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Cython",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
]
# make description
try:
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, "README.markdown"), encoding="utf-8") as f:
LONG_DESCRIPTION = "\n" + f.read()
except:
LONG_DESCRIPTION = DESCRIPTION
# cythonize extensions
ext_mods = None
if platform.system() == "Windows":
ext_mods = cythonize(
[
Extension(
"hawkeslib.model.c.c_uv_exp",
["hawkeslib/model/c/c_uv_exp.pyx"],
include_dirs=[numpy.get_include()],
language="c++",
),
Extension(
"hawkeslib.model.c.c_mv_exp",
["hawkeslib/model/c/c_mv_exp.pyx"],
include_dirs=[numpy.get_include()],
language="c++",
),
Extension(
"hawkeslib.model.c.c_uv_bayes",
["hawkeslib/model/c/c_uv_bayes.pyx"],
include_dirs=[numpy.get_include()],
),
Extension(
"hawkeslib.model.c.c_mv_samp",
["hawkeslib/model/c/c_mv_samp.pyx"],
include_dirs=[numpy.get_include()],
language="c++",
),
]
)
else:
ext_mods = cythonize(
[
Extension(
"hawkeslib.model.c.c_uv_exp",
["hawkeslib/model/c/c_uv_exp.pyx"],
include_dirs=[numpy.get_include()],
libraries=["m"],
language="c++",
extra_compile_args=["-O3", "-march=native"],
),
Extension(
"hawkeslib.model.c.c_mv_exp",
["hawkeslib/model/c/c_mv_exp.pyx"],
include_dirs=[numpy.get_include()],
libraries=["m"],
language="c++",
extra_compile_args=["-O3", "-march=native"],
),
Extension(
"hawkeslib.model.c.c_uv_bayes",
["hawkeslib/model/c/c_uv_bayes.pyx"],
include_dirs=[numpy.get_include()],
libraries=["m"],
extra_compile_args=["-O3", "-march=native"],
),
Extension(
"hawkeslib.model.c.c_mv_samp",
["hawkeslib/model/c/c_mv_samp.pyx"],
include_dirs=[numpy.get_include()],
libraries=["m"],
language="c++",
extra_compile_args=["-O3", "-march=native"],
),
]
)
setup(
name="hawkeslib",
version="0.2.2",
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
author="Caner Turkmen",
author_email="caner.turkmen@boun.edu.tr",
url="http://hawkeslib.rtfd.io",
ext_modules=ext_mods,
packages=["hawkeslib", "hawkeslib.model", "hawkeslib.model.c", "hawkeslib.util"],
install_requires=REQUIRED,
extras_require=EXTRA_REQUIRED,
setup_requires=["numpy", "cython", "scipy"],
license="MIT",
python_requires=">=2.7.5",
classifiers=CLASSIFIERS,
)