-
Notifications
You must be signed in to change notification settings - Fork 19
/
setup.py
98 lines (91 loc) · 3.4 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
#!/usr/bin/env python
# This file is part of pydpc.
#
# Copyright 2016 Christoph Wehmeyer
#
# pydpc is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from setuptools import setup, Extension
import versioneer
def extensions():
from numpy import get_include
from Cython.Build import cythonize
ext_core = Extension(
"pydpc.core",
sources=["ext/core.pyx", "ext/_core.c"],
include_dirs=[get_include()],
extra_compile_args=["-O3", "-std=c99"])
exts = [ext_core]
return cythonize(exts)
class lazy_cythonize(list):
"""evaluates extension list lazyly.
pattern taken from http://tinyurl.com/qb8478q"""
def __init__(self, callback):
self._list, self.callback = None, callback
def c_list(self):
if self._list is None: self._list = self.callback()
return self._list
def __iter__(self):
for e in self.c_list(): yield e
def __getitem__(self, ii): return self.c_list()[ii]
def __len__(self): return len(self.c_list())
def long_description():
ld = "Clustering by fast search and find of density peaks, designed by Alex Rodriguez"
ld += " and Alessandro Laio, is a density-peak-based clustering algorithm. The pydpc package"
ld += " aims to make this algorithm available for Python users."
return ld
setup(
cmdclass=versioneer.get_cmdclass(),
ext_modules=lazy_cythonize(extensions),
name='pydpc',
version=versioneer.get_version(),
description='Python package for Density Peak-based Clustering',
long_description=long_description(),
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: C',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Physics'],
keywords=[
'cluster',
'density'],
url='https://github.com/cwehmeyer/pydpc',
author='Christoph Wehmeyer',
author_email='christoph.wehmeyer@fu-berlin.de',
license='LGPLv3+',
setup_requires=[
'numpy>=1.7',
'cython>=0.20',
'setuptools>=0.6'],
tests_require=[
'numpy>=1.7',
'nose>=1.3'],
install_requires=[
'numpy>=1.7',
'matplotlib'],
packages=['pydpc'],
test_suite='nose.collector',
scripts=[]
)