forked from lofar-astron/RMextract
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
128 lines (118 loc) · 4.37 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
128
import os
import sys
import warnings
import numpy
from numpy.distutils.core import Extension, setup
from setuptools import find_packages
def read(rel_path):
"""Function read() was copied from setup.py in Pip package."""
here = os.path.abspath(os.path.dirname(__file__))
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
with open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
packages = find_packages() # exclude=["RMextract.LOFAR_TOOLS"])
ext_modules = []
ext_modules.append(
Extension(
"RMextract.EMM._EMM_Model",
sources=[
os.path.join("RMextract", "EMM", f)
for f in ("EMM_Model.cc", "GeomagnetismLibrary.c", "EMM_Model_wrap.cc")
],
extra_compile_args=["-Wno-format-security"],
)
)
ext_modules.append(
Extension(
"RMextract.pyiri._iri",
sources=[
os.path.join("RMextract", "pyiri", f)
for f in (
"iri.pyf",
"cira.for",
"igrf.for",
"iridreg.for",
"iriflip.for",
"irifun.for",
"irisub.for",
"iritec.for",
"iriget.for",
)
],
include_dirs=[numpy.get_include()],
)
)
ext_modules.append(
Extension(
"RMextract.pyiriplas._iriplas",
sources=[
os.path.join("RMextract", "pyiriplas", f)
for f in (
"iriplas.pyf",
"igrf.for",
"irif2019.for",
"iriplas_main.for",
"Iris2017.for",
"indx2017.for",
)
],
include_dirs=[numpy.get_include()],
)
)
# For backward compatibility for those who (still) use `python setup.py` to
# install the optional LOFAR utilities.
if "--add-lofar-utils" in sys.argv:
packages.append("RMextract.LOFAR_TOOLS")
sys.argv.remove("--add-lofar-utils")
warnings.warn(
"Use of 'python setup.py install --add-lofar-utils' is deprecated. "
"Use 'pip install RMextract[lofar-utils]' instead."
)
setup(
name="RMextract",
version="0.4.4",
url="https://github.com/lofar-astron/RMextract",
project_urls={"Source": "https://github.com/lofar-astron/RMextract"},
author="Maaijke Mevius",
author_email="[email protected]",
description="Extract TEC, vTEC, Earthmagnetic field and Rotation Measures from GPS "
"and WMM data for radio interferometry observations",
long_description=read("README.md"),
long_description_content_type="text/markdown",
maintainer="Marcel Loose",
maintainer_email="[email protected]",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Software Development :: Libraries :: Python Modules",
],
ext_modules=ext_modules,
packages=packages,
install_requires=["numpy", "scipy", "astropy", "python-casacore", "PySocks"],
extras_require={
# Note that "lofar-utils" also depends on the python bindings to the LOFAR ParmDB.
# Since these have never been published on PyPI, we cannot specify this dependency.
"lofar-utils": ["losoto"]
},
entry_points={
"console_scripts": [
"createRMParmdb = RMextract.LOFAR_TOOLS.createRMParmdb:main [lofar-utils]",
"createRMh5parm.py = RMextract.LOFAR_TOOLS.createRMh5parm:main [lofar-utils]",
"download_IONEX.py = RMextract.LOFAR_TOOLS.download_IONEX:main [lofar-utils]",
]
},
package_data={
"RMextract.EMM": ["*.COF"],
# Add *.pyf files. These files are _not_ treated as source files by Numpy's setup(),
# because, normally, they are (re)generated by f2py from the Fortran source files.
# However, since these files needed to be tweaked a bit, they _must_ be treated as source
# files now. So, we have to manually add them to the source distribution.
"RMextract.pyiri": ["iri.pyf", "*.dat", "*.asc"],
"RMextract.pyiriplas": ["iriplas.pyf", "*.dat", "*.asc", "kp*", "*.ASC"],
},
)