Skip to content

Commit

Permalink
Run tois v0.2.0 test (#22)
Browse files Browse the repository at this point in the history
* Fix missing notebook issue

* add batch of completed notebooks
  • Loading branch information
avivajpeyi committed Sep 10, 2020
1 parent 1c832b2 commit 570ec3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions run_toi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ def create_toi_notebook_from_template_notebook(
txt = txt.replace("{{{VERSIONNUMBER}}}", f"'{version}'")
txt = re.sub(r"toi_num = [0-9]+", f"toi_num = {toi_number}", txt)
if quickrun:
txt = re.sub(r"TUNE = [0-9]+", f"TUNE = {200}", txt)
txt = re.sub(r"DRAWS = [0-9]+", f"DRAWS = {200}", txt)
txt = re.sub(r"TUNE = [0-9]+", f"TUNE = {2}", txt)
txt = re.sub(r"DRAWS = [0-9]+", f"DRAWS = {2}", txt)
txt = re.sub(r"CHAINS = [0-9]+", f"CHAINS = {1}", txt)
else:
txt = re.sub(r"TUNE = [0-9]+", f"TUNE = {2000}", txt)
txt = re.sub(r"DRAWS = [0-9]+", f"DRAWS = {2000}", txt)
txt = re.sub(r"CHAINS = [0-9]+", f"CHAINS = {1}", txt)

with open(notebook_filename, "w") as f:
Expand Down Expand Up @@ -87,12 +91,13 @@ def execute_toi_notebook(notebook_filename, version=__version__):
msg += e.traceback
msg += f"removing: {notebook_filename}\n\n"
print(msg)
# os.remove(notebook_filename)
os.remove(notebook_filename)
success = False
else:
with open(notebook_filename, mode="wt") as f:
nbformat.write(notebook, f)
subprocess.check_call(f"git add {notebook_filename} -f", shell=True)
print(f"Success analysing {notebook_filename}!! ")

return success

Expand Down
1 change: 0 additions & 1 deletion run_tois.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def main():
np.array(tois.groupby("TIC ID").first().sort_values("TOI").TOI)
).astype(int)
np.random.shuffle(toi_ids)

with Pool(8) as pool:
pool.map(run_toi, toi_ids)

Expand Down

0 comments on commit 570ec3e

Please sign in to comment.