Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into debt_inflation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Jan 27, 2025
2 parents 3201f6e + 76bd6e6 commit 794cfee
Show file tree
Hide file tree
Showing 90 changed files with 6,986 additions and 962 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
python-version: ["3.11", "3.12"]

steps:
- name: Checkout
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniconda-version: "latest"
auto-update-conda: true
activate-environment: ogcore-dev
environment-file: environment.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ jobs:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniconda-version: "latest"
activate-environment: ogcore-dev
environment-file: environment.yml
python-version: "3.11"
python-version: "3.12"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=ogcore-dev
jb build ./docs/book
make build-docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniconda-version: "latest"
activate-environment: ogcore-dev
environment-file: environment.yml
python-version: "3.11"
python-version: "3.12"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=ogcore-dev
jb build ./docs/book
make build-docs
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Build package
run: make pip-package
- name: Publish a Python distribution to PyPI
Expand Down
107 changes: 106 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,102 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.2] - 2024-12-08 12:00:00

### Added

- Adds KOR, THA, BRA to the list of countries in the `demographics.py` module.

## [0.13.1] - 2024-10-02 12:00:00

### Added

- Three new parameters to adjust government spending amounts in the case of `baseline_spending=True`:
- `alpha_bs_G`: the proportional adjustment to the level of baseline spending on government consumption (time varying, default value is 1.0 for each model period)
- `alpha_bs_T`: the proportional adjustment to the level of baseline spending on non-pension transfers (time varying, default value is 1.0 for each model period)
- `alpha_bs_I`: the proportional adjustment to the level of baseline spending on infrastructure investment (time varying, default value is 1.0 for each model period)

## [0.13.0] - 2024-09-26 12:00:00

### Added

- Updates all of the documentation.
- Adds remittances to all instances of the household budget constraint
- Rewrites bequests and transfers components of household budget constraint in terms of individual variables in all instances
- Adds a household transfers section to `households.md` with subsections on bequests, remittances, government transfers, and universal basic income
- Changes all instances of $p_t Y_t$ to $Y_t
- Updates the steady-state equilibrium algorithm description in `equilibrium.md`
- Added updates to the government pensions descriptions in `government.md` and added `pensions` to all instances of the household budget constraint.
- Updates the docstrings in `tax.py` for the wealth tax ETR and MTR functions. The code is right. I just thought there was a clearer specification of the equations in LaTeX.
- Adds remittances to the OG-Core code
- Adds aggregate remittances function `get_RM()` to `aggregates.py`
- Adds household remittances function `get_rm()` to `household.py`
- Adds four new remittance parameters: `alpha_RM_1`, `g_RM`, `alpha_RM_T`, `eta_RM`
- We model aggregate remittances as a percent of GDP in the first period, then growing at a specified rate that can deviate from the country growth rate until the cutoff rule period, after which the remittance growth rate trends back to the long-run model growth rate (growth rate in population and productivity). We also model remittances in reforms as being a percentage of baseline GDP. In this way, if remittance parameters are not changed in the reform, remittances remain at their baseline levels. The only way they change is if their parameter values are changed.
- Adds 3 tests using the `test_get_RM()` function in `test_aggregates.py`
- Adds 4 tests using the `test_get_rm()` function in `test_household.py`
- Changes the `initial_guess_r_SS` in two tests in `test_SS.py` because they were not solving with their current values
- Increases `RC_SS` steady-state resource constraint tolerance from 1e-9 to 1e-8 because two `test_run_SS()` tests were failing in `test_SS.py` with resource constraints errors just bigger than 1e-9 (-2.29575914e-09 for [Baseline, small open] and -2.29575914e-09 for [Reform, small open]).
- Increases `RC_TPI` transition path resource constraint tolerance from 1e-5 to 1e-4 in because one `test_run_TPI_full_run()` test was failing in `test_TPI.py` with a resource constraint error just bigger than 1e-5 (1.4459913381864586e-05 for `[Baseline, M=3 non-zero Kg]`).
- Updated two directory path references that were out of date in `test_run_example.py`.
- Updated expected value tuples and dictionaries in `test_txfunc.py`.

## [0.12.0] - 2024-08-20 12:00:00

### Added

- Support for Python 3.12

## [0.11.17] - 2024-08-18 12:00:00

### Added

- Description of `alpha_I` in docs
- Updates valid range of the nominal UBI parameters

### Bug Fix

- Extrapolate `alpha_I` in `parameters.py`
- Ensure `alpha_I` shape conforms in `TPI.py`
- Fix formatting of labels in `constants.py`

## [0.11.16] - 2024-08-10 12:00:00

### Added

- Added parameter script `make_params.py` that generates a markdown file for the documentation `parameters.md`. Updates `Makefile`, and GitHub Actions ([PR #963](https://github.com/PSLmodels/OG-Core/pull/963))
- Updated debt-to-GDP plot labels ([PR #962](https://github.com/PSLmodels/OG-Core/pull/962))

## [0.11.15] - 2024-07-30 12:00:00

### Bug Fix

- Make `OGcorePlots.mplstyle` importable from the package by adding it to `setup.py`

## [0.11.14] - 2024-07-30 12:00:00

### Added

- Aesthetic updates to plotting functions in `parameter_plots.py` and `demographics.py`

## [0.11.13] - 2024-07-28 12:00:00

### Added

- Added three new pension types to the model: (i) defined benefits system, (ii) notional defined contribution system, and (iii) points system.

## [0.11.12] - 2024-07-26 01:00:00

### Bug Fix

- Fixes extrapolation of nested lists of tax function parameters.

## [0.11.11] - 2024-06-24 01:00:00

### Added

- Add new parameters for resource constraint tolerances for steady state and time path solution.

## [0.11.10] - 2024-06-17 01:00:00

### Added
Expand Down Expand Up @@ -252,7 +348,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Version [0.7.0] on August 30, 2021 was the first time that the OG-USA repository was detached from all of the core model logic, which was named OG-Core. Before this version, OG-USA was part of what is now the [`OG-Core`](https://github.com/PSLmodels/OG-Core) repository. In the next version of OG-USA, we adjusted the version numbering to begin with 0.1.0. This initial version of 0.7.0, was sequential from what OG-USA used to be when the OG-Core project was called OG-USA.
- Any earlier versions of OG-USA can be found in the [`OG-Core`](https://github.com/PSLmodels/OG-Core) repository [release history](https://github.com/PSLmodels/OG-Core/releases) from [v.0.6.4](https://github.com/PSLmodels/OG-Core/releases/tag/v0.6.4) (Jul. 20, 2021) or earlier.


[0.13.2]: https://github.com/PSLmodels/OG-Core/compare/v0.13.1...v0.13.2
[0.13.1]: https://github.com/PSLmodels/OG-Core/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/PSLmodels/OG-Core/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/PSLmodels/OG-Core/compare/v0.11.17...v0.12.0
[0.11.17]: https://github.com/PSLmodels/OG-Core/compare/v0.11.16...v0.11.17
[0.11.16]: https://github.com/PSLmodels/OG-Core/compare/v0.11.15...v0.11.16
[0.11.15]: https://github.com/PSLmodels/OG-Core/compare/v0.11.14...v0.11.15
[0.11.14]: https://github.com/PSLmodels/OG-Core/compare/v0.11.13...v0.11.14
[0.11.13]: https://github.com/PSLmodels/OG-Core/compare/v0.11.11...v0.11.13
[0.11.11]: https://github.com/PSLmodels/OG-Core/compare/v0.11.10...v0.11.11
[0.11.10]: https://github.com/PSLmodels/OG-Core/compare/v0.11.9...v0.11.10
[0.11.9]: https://github.com/PSLmodels/OG-Core/compare/v0.11.8...v0.11.9
[0.11.8]: https://github.com/PSLmodels/OG-Core/compare/v0.11.7...v0.11.8
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ help:
@echo "coverage : generate test coverage report"
@echo "git-sync : synchronize local, origin, and upstream Git repos"
@echo "git-pr N=n : create local pr-n branch containing upstream PR"
@echo "make-docs : build new Jupyter Book documentation files"

.PHONY=clean
clean:
Expand Down Expand Up @@ -65,6 +66,15 @@ git-sync:
git-pr:
@./gitpr $(N)

.PHONY=build-docs
build-docs:
@cd ./docs ; python make_params.py; jb build ./book

format:
black . -l 79
linecheck . --fix

pip-package:
pip install wheel
pip install setuptools
python setup.py sdist bdist_wheel
1 change: 1 addition & 0 deletions docs/book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ parts:
- caption: Appendix
chapters:
- file: content/theory/derivations
- file: content/intro/parameters
- caption: References
chapters:
- file: content/OGCore_references
Expand Down
2 changes: 1 addition & 1 deletion docs/book/content/api/aggregates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ ogcore.aggregates
------------------------------------------

.. automodule:: ogcore.aggregates
:members: get_L, get_I, get_B, get_BQ, get_C, revenue, get_r_p,
:members: get_L, get_I, get_B, get_BQ, get_RM, get_C, revenue, get_r_p,
resource_constraint, get_K_splits, get_ptilde
13 changes: 13 additions & 0 deletions docs/book/content/api/demographics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _demographics:

Demographics Functions
=======================

**demographics.py modules**

ogcore.demographics
------------------------------------------

.. automodule:: ogcore.demographics
:members: get_un_data, get_fert, get_mort, get_pop, pop_rebin, get_imm_rates,
immsolve, get_pop_objs, pre_pop_solve
4 changes: 2 additions & 2 deletions docs/book/content/api/household.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ogcore.household
------------------------------------------

.. automodule:: ogcore.household
:members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_cons, get_ci,
FOC_savings, FOC_labor, get_y, constraint_checker_SS,
:members: marg_ut_cons, marg_ut_labor, get_bq, get_tr, get_rm, get_cons,
get_ci, FOC_savings, FOC_labor, get_y, constraint_checker_SS,
constraint_checker_TPI
16 changes: 16 additions & 0 deletions docs/book/content/api/pensions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _pensions:

Pension Functions
=================================================

**pensions.py modules**

ogcore.pensions
------------------------------------------

.. automodule:: ogcore.pensions
:members: replacement_rate_vals, pension_amount, SS_amount, DB_amount,
NDC_amount, PS_amount, deriv_theta, deriv_NDC, deriv_DB, deriv_PS,
delta_point, g_ndc, g_dir, delta_ret, deriv_DB_loop, deriv_PS_loop,
deriv_NDC_loop, delta_ret_loop, PS_1dim_loop, PS_2dim_loop, DB_1dim_loop,
DB_2dim_loop, NDC_1dim_loop, NDC_2dim_loop
2 changes: 2 additions & 0 deletions docs/book/content/api/public_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ There is also a link to the source code for each documented member.
:maxdepth: 1

aggregates
demographics
elliptical_u_est
execute
firm
Expand All @@ -22,6 +23,7 @@ There is also a link to the source code for each documented member.
parameter_plots
parameter_tables
parameters
pensions
tax
txfunc
utils
4 changes: 2 additions & 2 deletions docs/book/content/api/tax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ogcore.tax
------------------------------------------

.. automodule:: ogcore.tax
:members: replacement_rate_vals, ETR_wealth, MTR_wealth, ETR_income,
MTR_income, get_biz_tax, net_taxes, income_tax_liab, pension_amount,
:members: ETR_wealth, MTR_wealth, ETR_income,
MTR_income, get_biz_tax, net_taxes, income_tax_liab,
wealth_tax_liab, bequest_tax_liab
1 change: 1 addition & 0 deletions docs/book/content/contributing/contributor_guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

(Chap_ContribGuide)=
# Contributor Guide

Expand Down
Loading

0 comments on commit 794cfee

Please sign in to comment.