Skip to content

Commit

Permalink
Merge pull request #14 from rickecon/demog
Browse files Browse the repository at this point in the history
Update demographics.py and other files
  • Loading branch information
SeaCelo authored Jan 12, 2023
2 parents 4f34829 + 88f4850 commit 940e111
Show file tree
Hide file tree
Showing 15 changed files with 2,626 additions and 557 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/deploy_docs.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/docs_check.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ envs/
.ipynb_checkpoints*
*/__pycache__/*
docs/book/_build/*
docs/build*
examples/OG-ZAF_example_plots/*
*/OG-ZAF_example_plots/*
*ogzaf_example_output.csv
examples/OG-ZAF-Example/*
*/OG-ZAF-Example/*
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3916/)
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3108/)
![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/deploy_docs.yml/badge.svg?branch=main)
![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/check_black.yml/badge.svg?branch=main)

# OG-ZAF
Expand Down
6 changes: 4 additions & 2 deletions docs/book/content/api/demographics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ ogzaf.demographics
------------------------------------------

.. automodule:: ogzaf.demographics
:members: get_un_data, get_fert, get_mort, pop_rebin, get_imm_resid, immsolve,
get_pop_objs
:members: get_un_fert_data, get_un_mort_data, get_wb_infmort_rate,
get_un_pop_data, get_fert, get_mort, pop_rebin, get_imm_resid,
immsolve, get_pop_objs, extrap_exp_3, extrap_arctan_3,
ab_zero_eqs_exp_func, b_zero_eq_arctan_func
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies:
- statsmodels
- linearmodels
- black
- jupyter
- pip:
- jupyter-book>=0.9.1
- pandas-datareader
Expand Down
12 changes: 6 additions & 6 deletions examples/run_og_zaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import json
import time
import copy

# from taxcalc import Calculator
from ogzaf.calibrate import Calibration
Expand Down Expand Up @@ -65,18 +66,17 @@ def main():
"""

# create new Specifications object for reform simulation
p2 = Specifications(
baseline=False,
num_workers=num_workers,
baseline_dir=base_dir,
output_base=reform_dir,
)
p2 = copy.deepcopy(p)
p2.baseline = False
p2.output_base = reform_dir

# additional parameters to change
updated_params_ref = {
"cit_rate": [[0.26]],
"debt_ratio_ss": 1.2,
}
p2.update_specifications(updated_params_ref)

# Run model
start_time = time.time()
runner(p2, time_path=True, client=client)
Expand Down
10 changes: 5 additions & 5 deletions ogzaf/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def __init__(
# self.zeta = bequest_transmission.get_bequest_matrix()

# demographics
# self.demographic_params = demographics.get_pop_objs(
# p.E, p.S, p.T, 1, 100, p.start_year
# )
self.demographic_params = demographics.get_pop_objs(
p.E, p.S, p.T, p.start_year
)
# demographics for 80 period lives (needed for getting e below)
# demog80 = demographics.get_pop_objs(20, 80, p.T, 1, 100, p.start_year)
# demog80 = demographics.get_pop_objs(20, 80, p.T, p.start_year)

# earnings profiles
# self.e = income.get_e_interp(
Expand Down Expand Up @@ -372,6 +372,6 @@ def get_dict(self):
# dict["zeta"] = self.zeta
dict.update(self.macro_params)
# dict["e"] = self.e
# dict.update(self.demographic_params)
dict.update(self.demographic_params)

return dict
105 changes: 0 additions & 105 deletions ogzaf/data/demographic/india_pop_data.csv

This file was deleted.

Loading

0 comments on commit 940e111

Please sign in to comment.