diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8222b88a6..1b4a321ed 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.11", "3.12"] + python-version: ["3.12", "3.13"] steps: - name: Checkout diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index dfa60e56e..dc91edc73 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -27,7 +27,7 @@ jobs: miniconda-version: "latest" activate-environment: ogcore-dev environment-file: environment.yml - python-version: "3.12" + python-version: "3.13" auto-activate-base: false - name: Build # Build Jupyter Book diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index e82946d93..15a4dd55e 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -25,7 +25,7 @@ jobs: miniconda-version: "latest" activate-environment: ogcore-dev environment-file: environment.yml - python-version: "3.12" + python-version: "3.13" auto-activate-base: false - name: Build # Build Jupyter Book diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml index ea1acb773..8c66f73de 100644 --- a/.github/workflows/publish_to_pypi.yml +++ b/.github/workflows/publish_to_pypi.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Build package run: make pip-package - name: Publish a Python distribution to PyPI diff --git a/CHANGELOG.md b/CHANGELOG.md index 88ec98a8e..895e5187c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ 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.14.6] - 2025-08-15 14:00:00 + +### Added + +- Removes `initial_guess_w_SS` in `default_parameters.json` +- Updates environment and testing to cover Python 3.13 + ## [0.14.5] - 2025-07-08 22:00:00 ### Added @@ -396,6 +403,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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.14.6]: https://github.com/PSLmodels/OG-Core/compare/v0.14.5...v0.14.6 [0.14.5]: https://github.com/PSLmodels/OG-Core/compare/v0.14.4...v0.14.5 [0.14.4]: https://github.com/PSLmodels/OG-Core/compare/v0.14.3...v0.14.4 [0.14.3]: https://github.com/PSLmodels/OG-Core/compare/v0.14.2...v0.14.3 diff --git a/README.md b/README.md index 61950a5ea..2e0917dcb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ | | | | --- | --- | | 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.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31111/) [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/) [![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) | +| Package | [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/) [![Python 3.13](https://img.shields.io/badge/python-3.13-blue.svg)](https://www.python.org/downloads/release/python-3137/) [![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) | diff --git a/docs/book/content/intro/intro.md b/docs/book/content/intro/intro.md index 214452b2d..a6cbd4aba 100644 --- a/docs/book/content/intro/intro.md +++ b/docs/book/content/intro/intro.md @@ -4,7 +4,7 @@ | | | | --- | --- | | 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.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-31111/) [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/) [![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) | +| Package | [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3129/) [![Python 3.13](https://img.shields.io/badge/python-3.13-blue.svg)](https://www.python.org/downloads/release/python-3137/) [![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. diff --git a/docs/book/content/intro/parameters.md b/docs/book/content/intro/parameters.md index a9b60ad1f..e0b3fb1b5 100644 --- a/docs/book/content/intro/parameters.md +++ b/docs/book/content/intro/parameters.md @@ -851,13 +851,6 @@ _Valid Range:_ min = 0.01 and max = 0.25 _Out-of-Range Action:_ error -#### `initial_guess_w_SS` -_Description:_ Initial guess of w for the SS solution. -_Value Type:_ float -_Valid Range:_ min = 0.01 and max = 5.15 -_Out-of-Range Action:_ error - - #### `initial_guess_TR_SS` _Description:_ Initial guess of TR for the SS solution. _Value Type:_ float diff --git a/environment.yml b/environment.yml index b89fb92ce..707cb8623 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: ogcore-dev channels: - conda-forge dependencies: -- python>=3.7.7, <3.13 +- python>3.11, <3.14 - numpy - ipython - setuptools diff --git a/ogcore/__init__.py b/ogcore/__init__.py index bacb12542..b865208fa 100644 --- a/ogcore/__init__.py +++ b/ogcore/__init__.py @@ -20,4 +20,4 @@ from ogcore.txfunc import * from ogcore.utils import * -__version__ = "0.14.5" +__version__ = "0.14.6" diff --git a/ogcore/default_parameters.json b/ogcore/default_parameters.json index 407b0b53a..787948d04 100644 --- a/ogcore/default_parameters.json +++ b/ogcore/default_parameters.json @@ -4415,24 +4415,6 @@ } } }, - "initial_guess_w_SS": { - "title": "Initial guess of w for the SS solution", - "description": "Initial guess of w for the SS solution.", - "section_1": "Model Solution Parameters", - "notes": "", - "type": "float", - "value": [ - { - "value": 1.1617041226785383 - } - ], - "validators": { - "range": { - "min": 0.01, - "max": 5.15 - } - } - }, "initial_guess_TR_SS": { "title": "Initial guess of TR for the SS solution", "description": "Initial guess of TR for the SS solution. This value is in model units and can therefore be any large positive number. We may have to adjust the maximum for this parameter from time to time.", diff --git a/setup.py b/setup.py index 61710b551..f8d273b9d 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ogcore", - version="0.14.5", + version="0.14.6", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="A general equilibrium overlapping generations model for fiscal policy analysis", @@ -25,7 +25,7 @@ ] }, include_packages=True, - python_requires=">=3.7.7, <3.13", + python_requires=">=3.11, <3.14", install_requires=[ "numpy", "scipy>=1.7.1", @@ -34,7 +34,7 @@ "matplotlib", "dask>=2.30.0", "distributed>=2.30.1", - "paramtools>=0.15.0", + "paramtools>=0.20.0", "requests", "pip", "pygam", @@ -47,8 +47,9 @@ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Libraries :: Python Modules", ], tests_require=["pytest"], diff --git a/tests/test_SS.py b/tests/test_SS.py index 9d40d9cc7..27c52a68a 100644 --- a/tests/test_SS.py +++ b/tests/test_SS.py @@ -1135,7 +1135,6 @@ def test_euler_equation_solver(input_tuple, ubi_j, p, expected): "initial_guess_TR_SS": 0.04, # "initial_guess_r_SS": 0.033092316727737416, # "initial_guess_TR_SS": 0.06323878350496814, - # "initial_guess_w_SS": 1.3320748594894016, "initial_guess_factor_SS": 111267.90426318572, } filename4 = "run_SS_baseline_small_open_use_zeta.pkl" diff --git a/tests/test_io_data/model_params_baseline.pkl b/tests/test_io_data/model_params_baseline.pkl index 6b5e0c366..17cf2103e 100644 Binary files a/tests/test_io_data/model_params_baseline.pkl and b/tests/test_io_data/model_params_baseline.pkl differ diff --git a/tests/test_io_data/model_params_baseline_v312.pkl b/tests/test_io_data/model_params_baseline_v312.pkl index d9e0c1bd9..a7c3c3746 100644 Binary files a/tests/test_io_data/model_params_baseline_v312.pkl and b/tests/test_io_data/model_params_baseline_v312.pkl differ diff --git a/tests/test_io_data/model_params_reform.pkl b/tests/test_io_data/model_params_reform.pkl index 1285f79d5..53f5e9f8f 100644 Binary files a/tests/test_io_data/model_params_reform.pkl and b/tests/test_io_data/model_params_reform.pkl differ diff --git a/tests/test_io_data/model_params_reform_v312.pkl b/tests/test_io_data/model_params_reform_v312.pkl new file mode 100644 index 000000000..8fc3ba5af Binary files /dev/null and b/tests/test_io_data/model_params_reform_v312.pkl differ diff --git a/tests/test_output_plots.py b/tests/test_output_plots.py index 49eef8eb3..fcbe19ab8 100644 --- a/tests/test_output_plots.py +++ b/tests/test_output_plots.py @@ -19,42 +19,46 @@ base_tpi = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl") ) -if sys.version_info[1] < 11: - base_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") - ) -elif sys.version_info[1] == 11: +if sys.version_info[1] == 11: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl" ) ) -else: +elif sys.version_info[1] == 12: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" ) ) +elif sys.version_info[1] == 13: + base_params = utils.safe_read_pickle( + os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") + ) +else: + # Raise assertion error + assert False, "Unsupported Python version" reform_ss = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "SS_vars_reform.pkl") ) reform_tpi = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TPI_vars_reform.pkl") ) -if sys.version_info[1] < 11: +if sys.version_info[1] == 11: reform_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl") + os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl") ) -elif sys.version_info[1] == 11: +elif sys.version_info[1] == 12: reform_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl") + os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v312.pkl") ) -else: +elif sys.version_info[1] == 13: reform_params = utils.safe_read_pickle( - os.path.join( - CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" - ) + os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl") ) +else: + # Raise assertion error + assert False, "Unsupported Python version" reform_taxfunctions = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_reform.pkl") ) diff --git a/tests/test_output_tables.py b/tests/test_output_tables.py index 0de8bf161..5db16d99d 100644 --- a/tests/test_output_tables.py +++ b/tests/test_output_tables.py @@ -18,42 +18,46 @@ base_tpi = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl") ) -if sys.version_info[1] < 11: - base_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") - ) -elif sys.version_info[1] == 11: +if sys.version_info[1] == 11: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl" ) ) -else: +elif sys.version_info[1] == 12: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" ) ) +elif sys.version_info[1] == 13: + base_params = utils.safe_read_pickle( + os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") + ) +else: + # Raise assertion error + assert False, "Unsupported Python version" reform_ss = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "SS_vars_reform.pkl") ) reform_tpi = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TPI_vars_reform.pkl") ) -if sys.version_info[1] < 11: +if sys.version_info[1] == 11: reform_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl") + os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl") ) -elif sys.version_info[1] == 11: +elif sys.version_info[1] == 12: reform_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl") + os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v312.pkl") ) -else: +elif sys.version_info[1] == 13: reform_params = utils.safe_read_pickle( - os.path.join( - CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" - ) + os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl") ) +else: + # Raise assertion error + assert False, "Unsupported Python version" # add investment tax credit parameter that not in cached parameters base_params.inv_tax_credit = np.zeros( (base_params.T + base_params.S, base_params.M) diff --git a/tests/test_parameter_plots.py b/tests/test_parameter_plots.py index 12c9eb694..ef7741c4a 100644 --- a/tests/test_parameter_plots.py +++ b/tests/test_parameter_plots.py @@ -14,22 +14,26 @@ # Load in test results and parameters CUR_PATH = os.path.abspath(os.path.dirname(__file__)) -if sys.version_info[1] < 11: - base_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") - ) -elif sys.version_info[1] == 11: +if sys.version_info[1] == 11: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl" ) ) -else: +elif sys.version_info[1] == 12: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" ) ) +elif sys.version_info[1] == 13: + base_params = utils.safe_read_pickle( + os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") + ) +else: + # Raise assertion error + assert False, "Unsupported Python version" + base_taxfunctions = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl") ) diff --git a/tests/test_parameter_tables.py b/tests/test_parameter_tables.py index 30a4f6543..082e02d30 100644 --- a/tests/test_parameter_tables.py +++ b/tests/test_parameter_tables.py @@ -12,22 +12,25 @@ # Load in test results and parameters CUR_PATH = os.path.abspath(os.path.dirname(__file__)) -if sys.version_info[1] < 11: - base_params = utils.safe_read_pickle( - os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") - ) -elif sys.version_info[1] == 11: +if sys.version_info[1] == 11: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl" ) ) -else: +elif sys.version_info[1] == 12: base_params = utils.safe_read_pickle( os.path.join( CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl" ) ) +elif sys.version_info[1] == 13: + base_params = utils.safe_read_pickle( + os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl") + ) +else: + # Raise assertion error + assert False, "Unsupported Python version" base_taxfunctions = utils.safe_read_pickle( os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl") )