Skip to content

Commit

Permalink
Merge pull request Revenue-Academy#15 from jdebacker/demog
Browse files Browse the repository at this point in the history
Use `demographics.py` module from OG-Core
  • Loading branch information
jdebacker authored Mar 18, 2024
2 parents 8edf11a + 35bef74 commit 8618062
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 860 deletions.
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

0 comments on commit 8618062

Please sign in to comment.