Skip to content

Commit

Permalink
zenodo+showyourwork working version
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayBritavskiy committed Jan 18, 2024
1 parent 76d0995 commit 43ca544
Show file tree
Hide file tree
Showing 15 changed files with 138 additions and 25 deletions.
32 changes: 32 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
rule unzip_MESA_output:
input:
"src/data/data.zip"
script:
"src/scripts/unzip_MESA_output.py"

rule plot_save_mesa_comparison_panels_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/age_vsurf_comparison_resolution_test.pdf"
"src/tex/figures/HR_primary.pdf"
Expand All @@ -8,25 +16,33 @@ rule plot_save_mesa_comparison_panels_fin:
"src/scripts/plot_save_mesa_comparison_panels_fin.py"

rule plot_save_mesa_comparison_panels_acc_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/age_vsurf_acceleration_panel.pdf"
"src/tex/figures/age_omega_comparison_panel.pdf"
script:
"src/scripts/plot_save_mesa_comparison_panels_acc_fin.py"

rule plot_e_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/age_e_comparison_panel.pdf"
script:
"src/scripts/plot_e_fin.py"

rule hr_plot_paper2023_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/HR_REAL_ROT_Paper2023.pdf"
script:
"src/scripts/hr_plot_paper2023_fin.py"

rule plot_save_mesa_comparison_wind_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/age_vsurf_comparison_onestar.pdf"
"src/tex/figures/age_vsurf_comparison_onestar_resolution_vrot.pdf"
Expand All @@ -35,12 +51,16 @@ rule plot_save_mesa_comparison_wind_fin:
"src/scripts/plot_save_mesa_comparison_wind_fin.py"

rule all_hr_fin:
input:
"src/data/data.zip"
output:
"src/tex/figures/age_vsurf_hr_all.pdf"
script:
"src/scripts/all_hr_fin.py"

rule plot_save_mesa_ce:
input:
"src/data/data.zip"
output:
"src/tex/figures/r_alpha_HD25631.pdf"
"src/tex/figures/r_alpha_HD191495.pdf"
Expand All @@ -49,6 +69,8 @@ rule plot_save_mesa_ce:
"src/scripts/plot_save_mesa_ce.py"

rule plot_save_mesa_individual_fin1p25:
input:
"src/data/data.zip"
output:
"src/tex/figures/p_q_1p25days.pdf"
"src/tex/figures/p_q_3days.pdf"
Expand All @@ -60,12 +82,16 @@ rule plot_save_mesa_individual_fin1p25:
"src/scripts/plot_save_mesa_individual_fin1p25.py"

rule plot_save_mesa_eta:
input:
"src/data/data.zip"
output:
"src/tex/figures/eta_omega.pdf"
script:
"src/scripts/plot_save_mesa_eta.py"

rule plot_min_a_in:
input:
"src/data/data.zip"
output:
"src/tex/figures/a_min_RL_24_1_7.pdf"
"src/tex/figures/a_min_RL_15_1p5_3p5.pdf"
Expand All @@ -74,18 +100,24 @@ rule plot_min_a_in:
"src/scripts/plot_min_a_in.py"

rule plot_P_unstable:
input:
"src/data/data.zip"
output:
"src/tex/figures/P_unstable.pdf"
script:
"src/scripts/plot_P_unstable.py"

rule plot_save_mesa_individual_pos_res:
input:
"src/data/data.zip"
output:
"src/tex/figures/hr_panel_res.pdf"
script:
"src/scripts/plot_save_mesa_individual_pos_res.py"

rule plot_save_mesa_pos_eta_res:
input:
"src/data/data.zip"
output:
"src/tex/figures/eta_omega_res.pdf"
script:
Expand Down
46 changes: 21 additions & 25 deletions showyourwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,80 +26,76 @@ dag:
# Externally-hosted datasets, e.g. on Zenodo
datasets:
10.5281/zenodo.10479754:
content:
- data.zip: src/data/
destination: src/data/
contents:
data.zip:

# Custom file dependencies
dependencies:
src/scripts/unzip_MESA_output.py:
- src/data/data.zip

src/scripts/plot_save_mesa_comparison_panels_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/HD25631/
- data/HD46485/
- data/HD191495/
- src/data/data.zip

src/scripts/plot_save_mesa_comparison_wind_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/one_star/
- src/data/data.zip

src/scripts/plot_save_mesa_comparison_panels_acc_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/acceleration/
- src/data/data.zip

src/scripts/all_hr_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/HR_HD25631/
- src/data/data.zip

src/scripts/hr_plot_paper2023_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/sample_tracks/
- data/FINAL_TABLE_TO_PLOTS_mar2023.txt
- src/scripts/unzip_MESA_output.py
- src/data/FINAL_TABLE_TO_PLOTS_mar2023.txt

src/scripts/plot_e_fin.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/eccentricity/
- src/data/data.zip

src/scripts/plot_min_a_in.py:
- src/scripts/matplotlibrc
- src/scripts/ML_stability.py
- src/scripts/Eggleton83.py
- src/scripts/get_sep_from_P_masses.py
- src/scripts/mlp_model_trip_ghost.pkl

- src/data/data.zip
src/scripts/plot_P_unstable.py:
- src/scripts/matplotlibrc
- data/triples/

- src/data/data.zip
src/scripts/plot_save_mesa_ce.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/CE/

- src/data/data.zip
src/scripts/plot_save_mesa_eta.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/mass_transfer_efficiency/

- src/data/data.zip
src/scripts/plot_save_mesa_pos_eta_res.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/mass_transfer_efficiency/

- src/data/data.zip
src/scripts/plot_save_mesa_individual_fin1p25.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/post_interaction/

- src/data/data.zip
src/scripts/plot_save_mesa_individual_pos_res.py:
- src/scripts/matplotlibrc
- src/scripts/mesaPlot/file_reader.py
- data/post_interaction/

- src/data/data.zip

# Name of the `.tex` manuscript and corresponding `.pdf` article
ms_name: ms
Expand All @@ -126,7 +122,7 @@ overleaf:
require_inputs: false

# Allow cacheable rules to run on GitHub Actions?
run_cache_rules_on_ci: false
run_cache_rules_on_ci: True

# Mapping of script file extensions to instructions for executing them
scripts:
Expand Down
9 changes: 9 additions & 0 deletions src/scripts/all_hr_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
import mesaPlot as mp
plt.style.use(paths.scripts / "matplotlibrc")

if os.path.exists(os.path.join(paths.data,'HR_HD25631/LOGS1_0/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')





def find_nearest(array, value):
array = np.asarray(array)
idx = (np.abs(array - value)).argmin()
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/hr_plot_paper2023_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'FINAL_TABLE_TO_PLOTS_mar2023.txt')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')

plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
7 changes: 7 additions & 0 deletions src/scripts/plot_P_unstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
import matplotlib.gridspec as gridspec
import paths
plt.style.use(paths.scripts / "matplotlibrc")
if os.path.exists(os.path.join(paths.data,'triples/')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')




def read_data(file_path, N_skip=None, convert = True):
with open(file_path, 'r') as f:
Expand Down
8 changes: 8 additions & 0 deletions src/scripts/plot_e_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
import mesaPlot as mp
plt.style.use(paths.scripts / "matplotlibrc")

if os.path.exists(os.path.join(paths.data,'eccentricity/HD191495/LOGS3/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')




m_200_191=mp.MESA()
m2_200_191=mp.MESA()
m3_200_191=mp.MESA()
Expand Down
4 changes: 4 additions & 0 deletions src/scripts/plot_save_mesa_ce.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import os
import mesaPlot as mp
plt.style.use(paths.scripts / "matplotlibrc")
if os.path.exists(os.path.join(paths.data,'CE/LOGS3_HD46485/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')


def find_nearest(array, value):
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/plot_save_mesa_comparison_panels_acc_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'acceleration/HD191495_mesa/LOGS1/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')

plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
5 changes: 5 additions & 0 deletions src/scripts/plot_save_mesa_comparison_panels_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

plt.style.use(paths.scripts / "matplotlibrc")

if os.path.exists(os.path.join(paths.data,'HD191495/LOGS1_mesa/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')


rsun=696000 #km

Expand Down
7 changes: 7 additions & 0 deletions src/scripts/plot_save_mesa_comparison_wind_fin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'one_star/M24_ST/LOGS50/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')



plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
7 changes: 7 additions & 0 deletions src/scripts/plot_save_mesa_eta.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'mass_transfer_efficiency/p3/LOGS3/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')



plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
6 changes: 6 additions & 0 deletions src/scripts/plot_save_mesa_individual_fin1p25.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'post_interaction/30_20_1p25_g1_new/LOGS3/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')


plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
5 changes: 5 additions & 0 deletions src/scripts/plot_save_mesa_individual_pos_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
import os
import mesaPlot as mp

if os.path.exists(os.path.join(paths.data,'post_interaction/30_20_10_res/LOGS1/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')

plt.style.use(paths.scripts / "matplotlibrc")


Expand Down
5 changes: 5 additions & 0 deletions src/scripts/plot_save_mesa_pos_eta_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

plt.style.use(paths.scripts / "matplotlibrc")

if os.path.exists(os.path.join(paths.data,'mass_transfer_efficiency/p3_pos/LOGS3/history.data')):
pass
else:
os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}')



def find_nearest(array, value):
Expand Down
12 changes: 12 additions & 0 deletions src/scripts/unzip_MESA_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

from showyourwork.paths import user as Paths
paths = Paths()
from zipfile import ZipFile

if __name__ == "__main__":
# loading the temp.zip and creating a zip object
with ZipFile(paths.data / "data.zip", 'r') as zObject:

# Extracting all the members of the zip
# into a specific location.
zObject.extractall(path=paths.src)

0 comments on commit 43ca544

Please sign in to comment.