-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.py
More file actions
114 lines (107 loc) · 3.78 KB
/
setup.py
File metadata and controls
114 lines (107 loc) · 3.78 KB
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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
from codecs import open
from os import path, system
from re import compile as re_compile
from urllib.request import urlretrieve
# For convenience.
if sys.argv[-1] == "publish":
system("python setup.py sdist upload")
sys.exit()
def read(filename):
kwds = {"encoding": "utf-8"} if sys.version_info[0] >= 3 else {}
with open(filename, **kwds) as fp:
contents = fp.read()
return contents
# Get the version information.
here = path.abspath(path.dirname(__file__))
vre = re_compile("__version__ = \"(.*?)\"")
version = vre.findall(read(path.join(here, "smh", "__init__.py")))[0]
# External data.
if "--without-models" not in sys.argv:
data_paths = [
# Model photospheres:
# Castelli & Kurucz (2004)
("https://zenodo.org/record/14964/files/castelli-kurucz-2004.pkl",
"smh/photospheres/castelli-kurucz-2004.pkl"),
# MARCS (2008)
("https://zenodo.org/record/14964/files/marcs-2011-standard.pkl",
"smh/photospheres/marcs-2011-standard.pkl"),
# Stagger-Grid <3D> (2013)
("https://zenodo.org/record/15077/files/stagger-2013-optical.pkl",
"smh/photospheres/stagger-2013-optical.pkl"),
("https://zenodo.org/record/15077/files/stagger-2013-mass-density.pkl",
"smh/photospheres/stagger-2013-mass-density.pkl"),
("https://zenodo.org/record/15077/files/stagger-2013-rosseland.pkl",
"smh/photospheres/stagger-2013-rosseland.pkl"),
("https://zenodo.org/record/15077/files/stagger-2013-height.pkl",
"smh/photospheres/stagger-2013-height.pkl"),
]
for url, filename in data_paths:
if path.exists(filename):
print("Skipping {0} because file already exists".format(filename))
continue
print("Downloading {0} to {1}".format(url, filename))
try:
urlretrieve(url, filename)
except IOError:
raise("Error downloading file {} -- consider installing with flag "
"--without-models".format(url))
else:
sys.argv.remove("--without-models")
setup(
name="smh",
version=version,
#author="",
#author_email="", # <-- Direct complaints to this address.
description="Spectroscopy Made Harder",
long_description=read(path.join(here, "README.md")),
url="https://github.com/andycasey/smhr",
license="MIT",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics"
],
keywords="astronomy stellar spectroscopy spectra made easy hard",
packages=find_packages(exclude=["documents", "tests"]),
install_requires=[
"numpy",
"scipy>=0.14.0",
"six",
#"pyside>=1.1.2",
"astropy",
"pyyaml",
"requests"
],
extras_require={
"test": ["coverage"]
},
package_data={
"": ["LICENSE"],
"smh": ["default_session.yaml"],
"smh.gui": ["matplotlibrc"],
"smh.photospheres": [
"marcs-2011-standard.pkl",
"castelli-kurucz-2004.pkl",
"stagger-2013-optical.pkl",
"stagger-2013-mass-density.pkl",
"stagger-2013-rosseland.pkl",
"stagger-2013-height.pkl"
],
"smh.radiative_transfer.moog": [
"defaults.yaml",
"abfind.in"
]
},
include_package_data=True,
data_files=None,
entry_points=None
)