-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
128 lines (111 loc) · 3.56 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
from __future__ import print_function
import argparse
import os
import sys
import numpy
from setuptools import find_packages, setup, Extension
from setuptools.command.test import test as test_command
def get_compile_args():
compiler = ''
compile_args = []
try:
compiler = os.environ["CC"]
except KeyError:
pass
if compiler.endswith("icc"):
compile_args += ['-fast']
compile_args += ['-march=native']
elif compiler.endswith("gcc"):
compile_args += ['-Ofast']
compile_args += ['-march=native']
elif compiler.endswith("clang"):
compile_args += ['-Ofast']
else:
compile_args += ['-Ofast']
return compile_args
class PyTest(test_command):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
test_command.initialize_options(self)
self.pytest_args = []
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
ENTRY_POINTS = {
'readers': [
'SAC = mtuq.io.readers.SAC:read',
],
'greens_tensor_clients': [
'AXISEM = mtuq.io.clients.AxiSEM_NetCDF:Client',
'AXISEM_NETCDF = mtuq.io.clients.AxiSEM_NetCDF:Client',
'FK = mtuq.io.clients.FK_SAC:Client',
'FK_SAC = mtuq.io.clients.FK_SAC:Client',
'CPS = mtuq.io.clients.CPS_SAC:Client',
'CPS_SAC = mtuq.io.clients.CPS_SAC:Client',
'SPECFEM3D = mtuq.io.clients.SPECFEM3D_SAC:Client',
'SPECFEM3D_GLOBE = mtuq.io.clients.SPECFEM3D_SAC:Client',
'SPECFEM3D_SAC = mtuq.io.clients.SPECFEM3D_SAC:Client',
'SPECFEM3D_SGT = mtuq.io.clients.SPECFEM3D_SGT:Client',
'SPECFEM3D_PKL = mtuq.io.clients.SPECFEM3D_SGT:Client',
'SEISCLOUD = mtuq.io.clients.seiscloud:Client',
'SYNGINE = mtuq.io.clients.syngine:Client',
]
}
setup(
name="mtuq",
version="0.2.0",
license='BSD2',
description="moment tensor (mt) uncertainty quantification (uq)",
author="Ryan Modrak",
url="https://github.com/uafgeotools/mtuq",
packages=find_packages(),
zip_safe=False,
classifiers=[
# complete classifier list:
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
],
keywords=[
"seismology"
],
entry_points=ENTRY_POINTS,
python_requires='>=3.7.0',
# NOTE
# instaseis Fortran extension modules sometimes fail to compile via pip
# (consider using a conda based installation instead)
install_requires=[
"numpy",
"scipy<1.13.0",
"pandas",
"xarray",
"netCDF4",
"h5py",
"tables",
"obspy",
"seisgen",
"seisclient",
"seishmc",
"retry",
"flake8",
"pytest",
"nose",
#"instaseis"
],
ext_modules = [
Extension(
'mtuq.misfit.waveform.c_ext_L2', ['mtuq/misfit/waveform/c_ext_L2.c'],
include_dirs=[numpy.get_include()],
extra_compile_args=get_compile_args()),
],
)