-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
70 lines (58 loc) · 2.36 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
from setuptools import setup
from distutils.extension import Extension
import os
import subprocess
from bs4 import BeautifulSoup
import urllib.request
cpu_extensions=dict(
libraries=["gsl", "gslcblas"],
language="c++",
runtime_library_dirs=[],
extra_compile_args=["-O3", "-shared", "-std=c++11", "-fPIC"],
include_dirs=["/usr/lib64",
"/mnt/Data_Volume/Documents/software/Anaconda/envs/few_env/include/python3.7m",
"/home/shaunf/Documents/Computer/Code/projects/Massive_Vector_Field_Dynamical_Friction/ProcaAroundKerr/GWGenerator/include",
"include"
],
library_dirs=None
)
frequency_ext = Extension(
"pyKerrFreqs",
sources=["src/Utility.cc", "src/UtilityFuncs.pyx"],
**cpu_extensions
)
flux_ext = Extension(
"pyAnalyticFluxes",
sources=["src/dIdt8H_5PNe10.cc", "src/dIdt.pyx"],
**cpu_extensions
)
extensions = [flux_ext, frequency_ext]
##Verify proca data directory exists. If not, download from Zenodo
ProcaDataPath = os.path.abspath(os.path.dirname(__file__))+"/GWGen/ProcaData"
if not os.path.exists(ProcaDataPath):
print("Download data from Zenodo repository. This will take some time...")
os.mkdir(ProcaDataPath)
ZenodoURL = "https://zenodo.org/record/7590391"
page = urllib.request.urlopen(ZenodoURL)
soup = BeautifulSoup(page, "html.parser")
hreflinks = [link.get("href") for link in soup.findAll("link")]
datasetUrls = [str for str in hreflinks if "Mode_1_Overtone_0" in str] #take only m=1, n=0 datasets
basefilenames = [os.path.basename(i) for i in datasetUrls]
datasetTargetFilenames = [ProcaDataPath+"/"+i for i in basefilenames]
for i in range(len(datasetUrls)):
subprocess.run(["wget", "--quiet", "--no-check-certificate", "--output-document="+datasetTargetFilenames[i], datasetUrls[i]])
setup(
name="GWGen",
version="0.1",
description="Calculating modified waveform due to precense of Proca cloud around spinning black hole",
author="Shaun Fell",
packages=["GWGen",
"GWGen.WFGenerator",
"GWGen.Utils",
"GWGen.UndressedFluxes",
"GWGen.DressedFluxes",
"GWGen.ProcaData"
],
package_data={"GWGen": ['ProcaData/*.npz']},
ext_modules=extensions,
)