-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
101 lines (85 loc) · 3.26 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
import os
import sys
if sys.version_info < (3, 0, 0):
sys.stderr.write("Error: itcsimlib requires Python 3.0 or newer.\n")
sys.exit(-1)
from setuptools import setup, find_packages
from distutils.core import Extension
from distutils.version import LooseVersion
from distutils.command import build
from distutils.cmd import Command
import scipy
if LooseVersion(scipy.__version__) < LooseVersion("0.11"):
print("Error: itcsimlib requires scipy 0.11 or higher.")
import matplotlib
if LooseVersion(matplotlib.__version__) < LooseVersion("1.3"):
print("Error: itcsimlib requires matplotlib 1.3 or higher.")
import sympy
if LooseVersion(sympy.__version__) < LooseVersion("0.7"):
print("Error: itcsimlib requires sympy 0.7.0 or higher.")
import pyx
if LooseVersion(pyx.__version__) < LooseVersion("0.13"):
print("Error: itcsimlib requires pyx 0.13 or higher.")
import itcsimlib
model_sources = ["src/model_trap/itc_model.c","src/model_trap/itc_sim.c","src/model_trap/itc_calc.c"]
model_libraries = ['m','gsl','gslcblas']
model_sk = Extension("itcsimlib.model_trap_sk",
libraries = model_libraries, extra_compile_args=['-std=c99'],
sources=["src/model_trap/energies_sk.c"]+model_sources,
)
model_ik = Extension("itcsimlib.model_trap_ik",
libraries = model_libraries, extra_compile_args=['-std=c99'],
sources=["src/model_trap/energies_ik.c"]+model_sources,
)
model_nn = Extension("itcsimlib.model_trap_nn",
libraries = model_libraries, extra_compile_args=['-std=c99'],
sources=["src/model_trap/energies_nn.c"]+model_sources,
)
class check_c_build(build.build):
user_options=build.build.user_options + [("build-c-models",None,"Compile TRAP+Tryptophan models written in C")]
def initialize_options(self, *args, **kwargs):
self.build_c_models = None
build.build.initialize_options(self, *args, **kwargs)
def run(self, *args, **kwargs):
if self.build_c_models :
self.distribution.ext_modules = [model_sk,model_ik,model_nn]
build.build.run(self, *args, **kwargs)
class run_tests(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
raise SystemExit( subprocess.call([
sys.executable,
os.path.join( os.path.dirname(os.path.abspath(__file__)), "test" ),
]))
setup(
name = 'itcsimlib',
version = itcsimlib.__version__,
license = itcsimlib.__license__,
author = itcsimlib.__author__,
author_email = itcsimlib.__author_email__,
description = u'itcsimlib: isothermal titration calorimetry simulation using statistical thermodynamics',
long_description = u'itcsimlib uses statistical thermodynamics models to simulate and fit binding data, in particular those obtained from isothermal titration calorimetry (ITC).',
url = u'https://github.com/elihuihms/itcsimlib',
download_url = u'https://github.com/elihuihms/itcsimlib/archive/master.zip',
platforms = 'any',
classifiers = [
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
''
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)'
],
packages=find_packages(),
ext_modules = [],
cmdclass={
'build':check_c_build,
'test':run_tests,
},
)