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

Update demographics.py and other files #14

Merged
merged 50 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
10e655c
Added two demographic data .csv files
rickecon Oct 31, 2022
8462ad3
Updated get_un_fert_data() in demographics.py
rickecon Nov 3, 2022
d24a136
Update .gitignore
rickecon Nov 3, 2022
3395488
Updated demographics data .csv files
rickecon Nov 3, 2022
0ad70d1
Added mortality rates .csv files to ogzaf/data/demographics/
rickecon Nov 3, 2022
45d7826
Updated get_un_fert and mort data funcs in demographics.py
rickecon Nov 3, 2022
644b1b9
Added for functions for extrapolation at end of demographics.py
rickecon Nov 3, 2022
1f819d3
Updated get_fert and get_mort functions in demographics.py
rickecon Nov 3, 2022
fcf953c
Updated get_pop_objs() in demographics.py
rickecon Nov 3, 2022
0d0eb47
Updated run_og_zaf.py script
rickecon Nov 3, 2022
0df0653
Updated ogzaf/calibrate.py
rickecon Nov 3, 2022
de95646
Updated macro_params.py
rickecon Nov 3, 2022
00295bf
Fixed typo in macro_params.py
rickecon Nov 3, 2022
477ab25
Black formatted macro_params.py
rickecon Nov 3, 2022
d8b2ad6
Made Marcelo's updates to demographics.py and fixed ending mortality …
rickecon Nov 7, 2022
5719e13
Fixed typos in demographics.py
rickecon Nov 7, 2022
7a5041d
Updated demographics.rst
rickecon Nov 8, 2022
259a85e
Updated get_fert to exclude min_yr and max_yr args and allow for totp…
rickecon Nov 8, 2022
7c31cb5
Added un_xaf_deaths.csv data
rickecon Nov 8, 2022
057ddee
Updated get_un_mort_data() in demographics.py
rickecon Nov 9, 2022
ee95c49
Remove min_yr, max_yr arguments from demographics in calibrate.py
rickecon Nov 9, 2022
4b00269
Updated the get_mort() func in demographics.py
rickecon Nov 9, 2022
24aaae9
Updated the get_fert() func in demographics.py
rickecon Nov 9, 2022
7e22b53
Updated demographics.py
rickecon Nov 9, 2022
c620ef9
Removed dependency from demographics.py
rickecon Nov 10, 2022
d2a8271
Updated pop_rebin() in demographics.py
rickecon Nov 10, 2022
b7eace8
Updated get_pop_objs() in demographics.py
rickecon Nov 10, 2022
28b50b8
Fixed error in get_imm_resid() in demographics.py
rickecon Nov 10, 2022
2a4c0e4
Fixed small change in get_imm_resid() in demographics.py
rickecon Nov 10, 2022
07c1d2f
Black formatted demographics.py
rickecon Nov 10, 2022
4bde2aa
Added jupyter to environment.yml
rickecon Nov 10, 2022
4ec3fe5
Fixed error in get_imm_resid() in demographics.py
rickecon Nov 11, 2022
df5ad10
Updated initial_guess_r_SS in ogzaf_default_parameters.json
rickecon Nov 11, 2022
eecbcec
Updated demographics.py and initial guesses for SS
rickecon Nov 12, 2022
fc46eff
Updated initial guesses for SS in ogzaf_default_parameters.json
rickecon Nov 12, 2022
fee2dc2
Updated demographics.py
rickecon Nov 23, 2022
8adf733
Merge remote-tracking branch 'origin' into demog
rickecon Nov 23, 2022
2e2720a
Black formatted demographics.py
rickecon Dec 5, 2022
b9827df
Fixed omega_S_preTP issue
rickecon Dec 5, 2022
cd65461
Added World Bank infant mortality rate to demographics.py
rickecon Dec 5, 2022
f67b702
Updated demographics.rst
rickecon Dec 5, 2022
4c9419c
Fixed specification in reform
rickecon Dec 5, 2022
2c1da71
Updated docstrings in demographics.py
rickecon Dec 5, 2022
780f5ff
Black formatted demographics.py
rickecon Dec 5, 2022
ff56043
Merged changes from previous PR
rickecon Dec 21, 2022
79361a8
Merge remote-tracking branch 'origin/main' into demog
rickecon Jan 9, 2023
a86e153
Updated run_og_zaf.py
rickecon Jan 11, 2023
4321b52
Updated import in run_og_zaf.py
rickecon Jan 11, 2023
18bd097
Temporarily removed documentation GitHub Action CI tests
rickecon Jan 11, 2023
88f4850
Removed documentation badge from README.md
rickecon Jan 11, 2023
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
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