diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..a6ee68707 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,196 @@ +# Changelog + +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.11.0] - 2024-02-06 15:00:00 + +### Added + +- Allow `chi_n` parameter to vary over the time path (PR #897) +- Create a demographics module in OG-Core (PR #896) +- Create a time varying ability matrix (PR # 895) +- Simplify the extrapolation of arrays over the time path (PR #891) +- Update the copyright year of documentation to 2024 + + +## [0.10.10] - 2023-10-25 17:00:00 + +### Added + +- Remove `surve_rate` parameter (PR #886) +- Updates to `plot_2D_taxfunc` (PR #881) + + +## [0.10.9] - 2023-09-08 12:00:00 + +### Added + +- PR #880 standardize the time path output length +- PR #878 fix tax function indexing, dimensions, and plotting. This PR also enables Python 3.11. +- PR #875 remove unused dependency + + +## [0.10.8] - 2023-04-22 12:00:00 + +### Added + +- Adds a 2D monotonic smoothing spline tax function estimation to `txfunc.py` +- Changes the tax function parameters objects from NumPy arrays to lists in order to accomodate the nonparametric functions that get passed with the `mono` and `mono2D` options + + +## [0.10.7] - 2023-03-31 12:00:00 + +### Added + +- Uses lists to pass and access effective tax rate objects `etr_params` and marginal tax rate objects `mtrx_params` and `mtry_params` + + +## [0.10.6] - 2023-02-15 12:00:00 + +### Added + +- Uses 300 dpi when saving plots to disk +- Better labels of the `plot_industry_aggregates` plots + + +## [0.10.5] - 2023-02-14 12:00:00 + +### Added + +- Fix to `SS.py` to use baseline solution on reform run if dimensions match +- Fix to `test_basic.py` dimensions for `r_gov_scale` + + +## [0.10.4] - 2023-02-06 12:00:00 + +### Added + +- New calibration section to documentation (PR #850) +- Allow government risk premia to vary across time path for parameters `r_gov_shift` and `r_gov_scale` (PR #852) + + +## [0.10.3] - 2023-01-21 12:00:00 + +### Added + +- Bug fixes for new tax function parameter estimation + + +## [0.10.2] - 2023-01-12 12:00:00 + +### Added + +- Adds a new minimum value to the `r_gov_shift` parameter of -0.3 + + +## [0.10.1] - 2023-01-05 12:00:00 + +### Added + +- Removes hard coded year label in parameter_plots.plot_population_path() (PR #825) +- Fixes documentation (PR # 827) +- Adds "mono" specification to default_parameter.json and test_parameters.py (PR #830) +- Restricts Python version to be < 3.11 and removes the mkl dependency in environment.yml and setup.py (PR #833 and #840) +- Updates CI testing to include Mac, Windows, and Linux operating systems and Python 3.9 and 3.10, and solves some CI test issues (PR #836) +- Increases the maximum values for r_gov_shift and r_gov_scale in default_parameters.json (PR #838) +- Removes the mkl dependency from environment.yml and setup.py (PR #840) + + +## [0.10.0] - 2022-09-27 12:00:00 + +### Added + +- Adds matrix of tax noncompliance parameters to households (PR #816) +- Incorporate input/output matrix mapping production goods to consumption goods (PR #818) +- Adds a new monotonic tax function estimation method to txfunc.py (PR #819) + + +## [0.9.2] - 2022-08-21 12:00:00 + +### Added + +- Updates the form of the investments tax credit to be on a proxy for investment (depreciated capital) in order to satisfy theoretical requirements of static firms in each industry. +- Update the documentation +- Update the requirement for the m_wealth parameter in the wealth tax function to be strictly greater than zero. + + +## [0.9.1] - 2022-07-22 12:00:00 + +### Added + +- Adds an investment tax credit parameter to the model +- Adds a boolean that allows the option to compute a reform using a stored baseline solution rather than recomputing the baseline + + +## [0.9.0] - 2022-06-30 12:00:00 + +### Added + +- Adds multiple production industries to the model + + +## [0.8.2] - 2022-06-01 12:00:00 + +### Added + +- Formatting of source code with black +- Last tag before extension of model to include multiple industries + + +## [0.8.1] - 2022-04-01 12:00:00 + +### Added + +- Updates PyPI.org packaging setup and includes auto-publishing GH Action (PRs #790, #795, and #797) +- Cleans up documentation issues and old erroneous references to ogusa package (PR #797) + + +## [0.8.0] - 2022-02-18 12:00:00 + +### Added + +- Adds a public capital good (i.e., infrastructure) used to produce private goods and services +- Adds a financial intermediary that links domestic and foreign savings to investment +- Improves multiprocessing with Dask +- Updates documentation +- Moves testing files outside of the ogcore package source files directory +- Tests functionality with Python 3.10. + + +## [0.7.0] - 2021-08-30 12:00:00 + +### Added + +- This is the first release of the OG-Core model (formerly the OG-USA model) + + +## Previous versions + +### Summary + +- 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.11.0]: https://github.com/PSLmodels/OG-Core/compare/v0.10.10...v0.11.0 +[0.10.10]: https://github.com/PSLmodels/OG-Core/compare/v0.10.9...v0.10.10 +[0.10.9]: https://github.com/PSLmodels/OG-Core/compare/v0.10.8...v0.10.9 +[0.10.8]: https://github.com/PSLmodels/OG-Core/compare/v0.10.7...v0.10.8 +[0.10.7]: https://github.com/PSLmodels/OG-Core/compare/v0.10.6...v0.10.7 +[0.10.6]: https://github.com/PSLmodels/OG-Core/compare/v0.10.5...v0.10.6 +[0.10.5]: https://github.com/PSLmodels/OG-Core/compare/v0.10.4...v0.10.5 +[0.10.4]: https://github.com/PSLmodels/OG-Core/compare/v0.10.3...v0.10.4 +[0.10.3]: https://github.com/PSLmodels/OG-Core/compare/v0.10.2...v0.10.3 +[0.10.2]: https://github.com/PSLmodels/OG-Core/compare/v0.10.1...v0.10.2 +[0.10.1]: https://github.com/PSLmodels/OG-Core/compare/v0.10.0...v0.10.1 +[0.10.0]: https://github.com/PSLmodels/OG-Core/compare/v0.9.2...v0.10.0 +[0.9.2]: https://github.com/PSLmodels/OG-Core/compare/v0.9.1...v0.9.2 +[0.9.1]: https://github.com/PSLmodels/OG-Core/compare/v0.9.0...v0.9.1 +[0.9.0]: https://github.com/PSLmodels/OG-Core/compare/v0.8.2...v0.9.0 +[0.8.2]: https://github.com/PSLmodels/OG-Core/compare/v0.8.1...v0.8.2 +[0.8.1]: https://github.com/PSLmodels/OG-Core/compare/v0.8.0...v0.8.1 +[0.8.0]: https://github.com/PSLmodels/OG-Core/compare/v0.7.0...v0.8.0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..0e259d42c --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index f06099e2d..000000000 --- a/LICENSE.md +++ /dev/null @@ -1,31 +0,0 @@ -This project is in the -public domain within the United States. - -Additionally, we waive copyright and related rights in the work -worldwide through the CC0 1.0 Universal public domain dedication. - -## CC0 1.0 Universal Summary - -This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode). - -### No Copyright - -The person who associated a work with this deed has dedicated the work to -the public domain by waiving all of his or her rights to the work worldwide -under copyright law, including all related and neighboring rights, to the -extent allowed by law. - -You can copy, modify, distribute and perform the work, even for commercial -purposes, all without asking permission. - -### Other Information - -In no way are the patent or trademark rights of any person affected by CC0, -nor are the rights that other persons may have in the work or in how the -work is used, such as publicity or privacy rights. - -Unless expressly stated otherwise, the person who associated a work with -this deed makes no warranties about the work, and disclaims liability for -all uses of the work, to the fullest extent permitted by applicable law. -When using or citing the work, you should not imply endorsement by the -author or the affirmer. diff --git a/README.md b/README.md index b2af3b196..ae96b2ae1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ -[![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) -[![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/PSLmodels/OG-Core/actions/workflows/build_and_test.yml/badge.svg?branch=master) -![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/deploy_docs.yml/badge.svg?branch=master) -![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/check_black.yml/badge.svg?branch=master) -[![Codecov](https://codecov.io/gh/PSLmodels/OG-Core/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-Core) - # OG-Core +| | | +| --- | --- | +| Org | [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CCO-1.0](https://img.shields.io/badge/OS%20License-CCO%201.0-yellow)](https://github.com/PSLmodels/OG-Core/blob/master/LICENSE) [![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://pslmodels.github.io/OG-Core/) | +| Package | [![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/) [![Python 3.11](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3118/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogcore.svg)](https://pypi.org/project/ogcore/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogcore.svg?label=PyPI%20downloads)](https://pypi.org/project/ogcore/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | +| Testing | ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/build_and_test.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/deploy_docs.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/check_black.yml/badge.svg?branch=master) [![Codecov](https://codecov.io/gh/PSLmodels/OG-Core/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-Core) | + + OG-Core is an overlapping-generations (OG) model core theory, logic, and solution method algorithms that allow for dynamic general equilibrium analysis of fiscal policy. OG-Core provides a general framework and is a dependency of several country-specific OG models, such as [OG-USA](https://github.com/PSLmodels/OG-USA) and [OG-UK](https://github.com/PSLmodels/OG-UK). The model output includes changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. Regularly updated documentation of the model theory--its output, and solution method--and the Python API is available [here](https://pslmodels.github.io/OG-Core). diff --git a/docs/book/_config.yml b/docs/book/_config.yml index dd200c9d4..bebd85ef3 100644 --- a/docs/book/_config.yml +++ b/docs/book/_config.yml @@ -2,7 +2,7 @@ # Book settings title : OG-Core author : Jason DeBacker and Richard W. Evans -copyright : '2022' +copyright : '2024' logo : '..//OG-Core_logo.png' #################################################### diff --git a/docs/book/content/intro/intro.md b/docs/book/content/intro/intro.md index 47f54d9bc..6903b1430 100644 --- a/docs/book/content/intro/intro.md +++ b/docs/book/content/intro/intro.md @@ -1,6 +1,12 @@ (Chap_Intro)= # OG-Core +| | | +| --- | --- | +| Org | [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CCO-1.0](https://img.shields.io/badge/OS%20License-CCO%201.0-yellow)](https://github.com/PSLmodels/OG-Core/blob/master/LICENSE) [![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://pslmodels.github.io/OG-Core/) | +| Package | [![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/) [![Python 3.11](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3118/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogcore.svg)](https://pypi.org/project/ogcore/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogcore.svg?label=PyPI%20downloads)](https://pypi.org/project/ogcore/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | +| Testing | ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/build_and_test.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/deploy_docs.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-Core/actions/workflows/check_black.yml/badge.svg?branch=master) [![Codecov](https://codecov.io/gh/PSLmodels/OG-Core/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-Core) | + `OG-Core` is the core logic for a country-agnostic overlapping-generations (OG) model of an economy that allows for dynamic general equilibrium analysis of fiscal policy. The source code is openly available for download or collaboration at the GitHub repository [www.github.com/PSLmodels/OG-Core](https://github.com/PSLmodels/OG-Core), or you can click on the GitHub icon at the top right of this page. The model output focuses changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. Although `OG-Core` can be run independently based on default parameter values (currently representing something similar to the United States), it is meant to be a dependency of a country-specific calibration. This documentation contains the following major sections, which are regularly updated. diff --git a/environment.yml b/environment.yml index e90cd8f2b..e88c809fa 100644 --- a/environment.yml +++ b/environment.yml @@ -18,8 +18,7 @@ dependencies: - coverage - requests - openpyxl -- black +- black>=24.1.1 - pip - pip: - pygam - diff --git a/ogcore/__init__.py b/ogcore/__init__.py index fee4d8cbb..a31f23e4f 100644 --- a/ogcore/__init__.py +++ b/ogcore/__init__.py @@ -20,4 +20,4 @@ from ogcore.txfunc import * from ogcore.utils import * -__version__ = "0.10.10" +__version__ = "0.11.0" diff --git a/run_examples/run_ogcore_example.py b/run_examples/run_ogcore_example.py index 878da9e2b..d905b3bfc 100644 --- a/run_examples/run_ogcore_example.py +++ b/run_examples/run_ogcore_example.py @@ -25,9 +25,9 @@ def main(): # Define parameters to use for multiprocessing - client = Client() num_workers = min(multiprocessing.cpu_count(), 7) print("Number of workers = ", num_workers) + client = Client(n_workers=num_workers) run_start_time = time.time() # Directories to save data diff --git a/setup.py b/setup.py index 724ff9f8c..d91ad4607 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ogcore", - version="0.10.10", + version="0.11.0", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibribum overlapping generations model for fiscal policy analysis",