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

Use demographics.py module from OG-Core #15

Merged
merged 6 commits into from
Mar 18, 2024
Merged
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
5 changes: 3 additions & 2 deletions examples/run_og_mys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import json
import time
import numpy as np
import copy
from ogmys.calibrate import Calibration
from ogcore.parameters import Specifications
Expand All @@ -17,8 +18,8 @@

def main():
# Define parameters to use for multiprocessing
client = Client()
num_workers = min(multiprocessing.cpu_count(), 7)
client = Client(n_workers=num_workers)
print("Number of workers = ", num_workers)

# Directories to save data
Expand Down Expand Up @@ -56,7 +57,7 @@ def main():
"omega": d["omega"],
"g_n_ss": d["g_n_ss"],
"omega_SS": d["omega_SS"],
"rho": d["rho"],
"rho": np.array(d["rho"])[0, :, :],
"g_n": d["g_n"],
"imm_rates": d["imm_rates"],
"omega_S_preTP": d["omega_S_preTP"],
Expand Down
14 changes: 7 additions & 7 deletions ogmys/calibrate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ogmys import demographics, macro_params, income
from ogmys import macro_params, income
import os
import numpy as np
from ogcore import txfunc
from ogcore import demographics, txfunc
from ogcore.utils import safe_read_pickle, mkdirs
import pkg_resources

Expand Down Expand Up @@ -55,11 +55,11 @@ def __init__(
p.E,
p.S,
p.T,
1,
100,
p.start_year - 1,
p.start_year,
GraphDiag=True,
0,
99,
country_id="458", # UN code for MYS
initial_data_year=p.start_year - 1,
final_data_year=p.start_year,
)

# earnings profiles
Expand Down
Loading
Loading