-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
89 lines (78 loc) · 3.58 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
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RPMDrate - Bimolecular reaction rates via ring polymer molecular dynamics
#
# Copyright (c) 2013 by Yury V. Suleimanov (ysuleyma@mit.edu, ysuleyma@princeton.edu)
# Joshua W. Allen (jwallen@mit.edu)
# William H. Green (whgreen@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
################################################################################
try:
import numpy
from numpy.distutils.core import setup, Extension, Command
except ImportError:
print('The numpy package is required to install RPMDrate.')
quit()
################################################################################
class test(Command):
"""
Run the unit test suite. All files in the `tests` directory and its
subdirectories that match the pattern ``*test.py`` will have their unit
test suites executed.
"""
description = "Run the unit test suite"
user_options = []
def initialize_options(self):
self.verbosity = 2
def finalize_options(self):
try:
self.verbosity = int(self.verbosity)
except ValueError:
raise ValueError('Verbosity must be an integer.')
def run(self):
import sys
if sys.version.startswith('2.6') or sys.version.startswith('3.1'):
import unittest2 as unittest
else:
import unittest
suite = unittest.TestLoader().discover('tests', pattern='*test.py', top_level_dir='.')
unittest.TextTestRunner(verbosity=self.verbosity).run(suite)
################################################################################
# The Fortran extension modules to build using f2py
ext_modules = [
Extension('rpmdrate._surface', ['rpmdrate/_surface.f90']),
Extension('rpmdrate._main', ['rpmdrate/_main.pyf', 'rpmdrate/_math.f90', 'rpmdrate/_surface.f90', 'rpmdrate/_main.f90', 'rpmdrate/blas_lapack.f90'], libraries=['fftw3']),
]
setup(
name = 'RPMDrate',
version = '2.0',
description = 'Bimolecular reaction rates via ring polymer molecular dynamics',
author = 'Joshua W. Allen, William H. Green, Yury V. Suleimanov',
author_email = 'jwallen@mit.edu, whgreen@mit.edu, ysuleyma@mit.edu, ysuleyma@princeton.edu',
url = 'http://github.com/GreenGroup/RPMDrate',
packages = ['rpmdrate'],
cmdclass = {'test': test},
ext_modules = ext_modules,
requires = ['numpy (>=1.5.0)'],
provides = ['rpmdrate'],
)