forked from nanoomlee/HYREC-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setting the possibility to vary the energy injection as we want
- Loading branch information
1 parent
2ba906e
commit db7a5f9
Showing
16 changed files
with
755 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ build | |
__pycache__ | ||
pyhyrec.egg-info | ||
|
||
dist | ||
dist | ||
|
||
example_pmf.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
import subprocess | ||
import os | ||
|
||
# go to where the project needs to be compiled | ||
os.chdir("./src/pyhyrec/src/") | ||
from setuptools import setup, Extension | ||
from Cython.Build import cythonize | ||
|
||
try: | ||
subprocess.run(['make'], check=True) | ||
print("make executed successfully.") | ||
def main(): | ||
|
||
# Run the 'make' command with the desired target | ||
subprocess.run(['make', 'clean'], check=True) | ||
print("make clean executed successfully.") | ||
# go to where the project needs to be compiled | ||
|
||
os.chdir("./src/pyhyrec/src/") | ||
|
||
except subprocess.CalledProcessError as e: | ||
print("Error executing Makefile:", e) | ||
try: | ||
|
||
if os.path.exists("libhyrec.so"): | ||
os.remove("libhyrec.so") | ||
|
||
# go back to the main project folder | ||
os.chdir("../../../") | ||
subprocess.run(['make'], check=True) | ||
print("make executed successfully.") | ||
|
||
from setuptools import setup, Extension | ||
from Cython.Build import cythonize | ||
# Run the 'make' command with the desired target | ||
subprocess.run(['make', 'clean'], check=True) | ||
print("make clean executed successfully.") | ||
|
||
except subprocess.CalledProcessError as e: | ||
print("Error executing Makefile:", e) | ||
|
||
cythonize("./src/pyhyrec/wrapperhyrec.pyx", force = True) | ||
# go back to the main project folder | ||
os.chdir("../../../") | ||
|
||
#extensions = [Extension("pyhyrec.src.hyrec", sources = ["./src/pyhyrec/src/hyrec.c"])] | ||
extensions = [Extension("pyhyrec.wrapperhyrec", sources = ["./src/pyhyrec/wrapperhyrec.c"], libraries = ["hyrec"], library_dirs=["./src/pyhyrec/src/"], build_temp="src/pyhyrec/")] | ||
cythonize("./src/pyhyrec/wrapperhyrec.pyx", force = True) | ||
|
||
setup(ext_modules=extensions, package_dir={'' : 'src'}, packages=['pyhyrec'], package_data= {'pyhyrec' :['data/*']}, include_package_data=True) | ||
|
||
extensions = [Extension("pyhyrec.wrapperhyrec", sources = ["./src/pyhyrec/wrapperhyrec.c"], libraries = ["hyrec"], library_dirs=["./src/pyhyrec/src/"], build_temp="src/pyhyrec/")] | ||
|
||
setup(ext_modules=extensions, package_dir={'': 'src'}, packages=['pyhyrec'], package_data= {'pyhyrec' :['data/*']}, include_package_data=True) | ||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
from .wrapperhyrec import (init_INPUT_COSMOPARAMS, init_INPUT_INJ_PARAMS, call_run_hyrec) | ||
from .wrapperhyrec import ( | ||
init_INPUT_COSMOPARAMS, | ||
init_INPUT_INJ_PARAMS, | ||
call_run_hyrec, | ||
call_decay_rate_pmf_turbulences, | ||
) | ||
|
||
from .params import HyRecCosmoParams, HyRecInjectionParams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.