Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing folders bug #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/scripts/posts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Posts
Code used to generate the plots and tables used in the posts.

## Usage

There is a circular reference between these Python scripts. Therefore you must:

1. Run `python professional_programs.py`
2. This will crash, that's okay.
3. Run `python baseline_and_hypothetical_programs.py`
4. Now run `python professional_programs.py` again. It will complete successfully this time.
3 changes: 3 additions & 0 deletions src/scripts/posts/baseline_and_hypothetical_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import sys
import os

sys.path.append("src")

Expand Down Expand Up @@ -68,6 +69,8 @@
"""

# Cost-effectiveness baselines

os.makedirs('output/data/professional_programs', exist_ok = True)
with open("output/data/professional_programs/df_functions.pkl", "rb") as f:
df_functions_professional = pickle.load(f)

Expand Down
3 changes: 3 additions & 0 deletions src/scripts/posts/professional_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import sys
import os

sys.path.append("src")

Expand Down Expand Up @@ -91,6 +92,7 @@
)

# Save data
os.makedirs('output/data/professional_programs', exist_ok = True)
with open("output/data/professional_programs/df_functions.pkl", "wb") as f:
pickle.dump(df_functions, f)

Expand Down Expand Up @@ -123,6 +125,7 @@
"""

# Load data on hypothetical programs
os.makedirs('output/data/baseline_and_hypothetical_programs', exist_ok = True)
with open(
"output/data/baseline_and_hypothetical_programs/hypothetical_programs_means.pkl",
"rb",
Expand Down