-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
135 lines (128 loc) · 5.32 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
134
135
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages
import warnings
try:
from numpy.distutils.core import Extension, setup
except ImportError:
msg = ("Please install numpy (version 1.7.0 or greater) before installing "
"Amlearn. Because Amlearn uses numpy's f2py to compile the fortran "
"modules to speed up the calculation of featurizer."
" like:"
" $ conda install numpy"
" $ pip install numpy")
raise RuntimeError(msg)
def calculate_version():
initpy = open('amlearn/_version.py').read().split('\n')
version = list(filter(lambda x: '__version__' in x,
initpy))[0].split('\'')[1]
return version
package_version = calculate_version()
module_dir = os.path.dirname(os.path.abspath(__file__))
name = 'amlearn'
version = package_version
author = 'Qi Wang'
author_email = 'qwang.mse@gmail.com'
packages = find_packages()
package_data = {'amlearn.utils': ['*.yaml', '*.json']}
url = 'https://github.com/Qi-max/amlearn'
download_url = 'https://github.com/Qi-max/amlearn/archive/0.1.0.tar.gz'
license = 'modified BSD'
description = 'Machine Learning package for amorphous materials.'
long_description = open(os.path.join(module_dir, 'README.md')).read()
zip_safe = False
install_requires = ['numpy>=1.7.0',
'scipy>=0.19.0',
'scikit-learn>=0.22.0',
'imbalanced-learn==0.5.0',
'tqdm>=4.11.2',
'pandas>=0.20.2',
'six>=1.10.0',
'lockfile>=0.12.2']
ext_modules = [Extension(name = 'amlearn.featurize.src.utils',
sources = ['amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.voronoi_nn',
sources = ['amlearn/featurize/src/voronoi_nn.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.voronoi_stats',
sources = ['amlearn/featurize/src/voronoi_stats.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.boop',
sources = ['amlearn/featurize/src/boop.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.mro_stats',
sources = ['amlearn/featurize/src/mro_stats.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.neighbor_data',
sources = ['amlearn/featurize/src/neighbor_data.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.distance_stats',
sources = ['amlearn/featurize/src/distance_stats.f90',
'amlearn/featurize/src/utils.f90']),
Extension(name = 'amlearn.featurize.src.distance_nn',
sources = ['amlearn/featurize/src/distance_nn.f90',
'amlearn/featurize/src/utils.f90'])]
classifiers = [
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Fortran',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Artificial Intelligence'
]
keywords = ['amorphous materials', 'Materials Genome Initiative',
'machine learning', 'data science', 'data mining',
'AI', 'artificial intelligence',
'featurizer', 'auto featurizer'
'auto machine learning']
try:
setup(
name=name,
version=version,
author=author,
author_email=author_email,
packages=packages,
package_data=package_data,
url=url,
download_url=download_url,
license=license,
description=description,
long_description=long_description,
zip_safe=zip_safe,
install_requires=install_requires,
classifiers=classifiers,
ext_modules=ext_modules,
keywords=keywords
)
except SystemExit as ex:
if 'amlearn.fmodules' in ex.args[0]:
warnings.warn('It looks like no fortran compiler is present. Retrying '
'installation without fortran modules.')
else:
raise ex
setup(
name=name,
version=version,
author=author,
author_email=author_email,
packages=packages,
package_data=package_data,
url=url,
download_url=download_url,
license=license,
description=description,
long_description=long_description,
zip_safe=zip_safe,
install_requires=install_requires,
classifiers=classifiers,
ext_modules=[],
keywords=keywords
)
warnings.warn('Installed amlearn without fortran modules since no fortran '
'compiler was found. The code may run slow as a result.')