forked from mattjj/pyhsmm-autoregressive
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
53 lines (49 loc) · 1.72 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
from distutils.core import setup
from Cython.Build import cythonize
import numpy as np
from os.path import join, exists
from os import mkdir
from shutil import move
import tarfile
from urllib.request import Request, urlopen
from glob import glob
# make dependency directory
if not exists('deps'):
mkdir('deps')
# download Eigen if we don't have it in deps
eigenurl = 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz'
eigentarpath = join('deps', 'Eigen.tar.gz')
eigenpath = join('deps', 'Eigen')
if not exists(eigenpath):
print('Downloading Eigen...')
req = Request(eigenurl, headers={'User-Agent': 'XYZ/3.0'})
tar_data = webpage = urlopen(req, timeout=10).read()
with open(eigentarpath, 'wb') as f:
f.write(tar_data)
with tarfile.open(eigentarpath, 'r') as tar:
tar.extractall('deps')
thedir = glob(join('deps', 'eigen-*'))[0]
move(join(thedir, 'Eigen'), eigenpath)
print('...done!')
setup(
name='autoregressive',
version='0.1.2',
description='Extension for switching vector autoregressive models with pyhsmm',
author='Matthew James Johnson',
author_email='[email protected]',
url='https://github.com/mattjj/pyhsmm-autoregressive',
license='GPL',
packages=['autoregressive'],
keywords=[
'bayesian', 'inference', 'mcmc', 'time-series',
'autoregressive', 'var', 'svar'],
install_requires=[
'Cython >= 0.20.1',
'numpy', 'scipy', 'matplotlib', 'pybasicbayes >= 0.2.1', 'pyhsmm'],
classifiers=[
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: C++'],
ext_modules=cythonize('**/*.pyx'),
include_dirs=[np.get_include(), 'deps']
)