From 5f0901f0f63b175bfe5f431f49082c579b0afc46 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:15:06 -0600 Subject: [PATCH 01/13] Updated pyproject.toml --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9bc01d56..a1a5b79d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=42"] +build-backend = "setuptools.build_meta" + # Configuration for Black. # NOTE: you have to use single-quoted strings in TOML for regular expressions. @@ -7,5 +11,5 @@ [tool.black] line-length = 79 -target-version = ['py36', 'py37', 'py38'] +target-version = ["py39", "py310", "py311"] include = '\.pyi?$' From 9cedb19df30d1db5afcd71793b54464639e5b7bf Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:37:13 -0600 Subject: [PATCH 02/13] Updated README.md --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 10874dd7..97649674 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ -[![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) -[![Python 3.7+](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://www.python.org/downloads/release/python-377/) -[![Codecov](https://codecov.io/gh/PSLmodels/OG-USA/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-USA) - # OG-USA + +| | | +| --- | --- | +| Org | [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CC0-1.0](https://img.shields.io/badge/OS%20License-CC0%201.0-yellow)](https://github.com/PSLmodels/OG-USA/blob/master/LICENSE) | +| Package | [![Python 3.9](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3917/) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3116/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogusa.svg)](https://pypi.org/project/ogusa/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogusa.svg?label=PyPI%20downloads)](https://pypi.org/project/fiscalsim-us/) | +| Testing | ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/build_and_test.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/deploy_docs.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/OG-USA/actions/workflows/check_format.yml/badge.svg?branch=master) [![Codecov](https://codecov.io/gh/PSLmodels/OG-USA/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/OG-USA) | + OG-USA is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for the United States. OG-USA is built on the [OG-Core](https://github.com/PSLmodels/OG-Core) framework. 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 at [https://pslmodels.github.io/OG-Core](https://pslmodels.github.io/OG-Core) and documentation of the specific United States calibration of the model is available at [https://pslmodels.github.io/OG-USA](https://pslmodels.github.io/OG-USA). +## Disclaimer + +The model is constantly under development, and model components could change significantly. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release! + + ## Using/contributing to OG-USA @@ -47,16 +55,15 @@ c = Calibration(p) updated_params = c.get_dict() p.update_specifications({'initial_debt_ratio': updated_params['initial_debt_ratio']}) ``` -## Disclaimer -The organization of this repository will be changing rapidly, but the `OG-USA/examples/run_og_usa.py` script will be kept up to date to run with the master branch of this repo. + ## Core Maintainers The core maintainers of the OG-Core repository are: * [Jason DeBacker](https://www.jasondebacker.com/) (GitHub handle: [jdebacker](https://github.com/jdebacker)), Associate Professor, Department of Economics, Darla Moore School of Business, University of South Carolina; President, PSL Foundation; Vice President of Research and Co-founder, Open Research Group, Inc. -* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [rickecon](https://github.com/rickecon)), Advisory Board Visiting Fellow, Center for Public Finance, Baker Institute for Public Policy at Rice University; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory +* [Richard W. Evans](https://sites.google.com/site/rickecon/) (GitHub handle: [rickecon](https://github.com/rickecon)), Senior Research Fellow and Director of Open Policy, Center for Growth and Opportunity at Utah State University; President, Open Research Group, Inc.; Director, Open Source Economics Laboratory. ## Citing OG-USA -OG-USA (Version 0.0.0)[Source code], https://github.com/PSLmodels/OG-USA +OG-USA (Version #.#.#)[Source code], https://github.com/PSLmodels/OG-USA. From 05296e6ada92794a35543c7238c4e715af533a88 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:53:56 -0600 Subject: [PATCH 03/13] Updated version --- cs-config/cs_config/functions.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cs-config/cs_config/functions.py b/cs-config/cs_config/functions.py index f775868b..719310b6 100644 --- a/cs-config/cs_config/functions.py +++ b/cs-config/cs_config/functions.py @@ -75,7 +75,7 @@ class MetaParams(paramtools.Parameters): def get_version(): - return "0.1.0" + return "0.1.1" def get_inputs(meta_param_dict): diff --git a/setup.py b/setup.py index 8b86fc7d..69f42ac4 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="ogusa", - version="0.1.0", + version="0.1.1", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="USA calibration for OG-Core", From 677bf48a4fa5b13b0a6479a8ab4ce3257f1d27ec Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:54:23 -0600 Subject: [PATCH 04/13] Added CHANGELOG.md --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..13e2e867 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,40 @@ +# 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.1.1] - 2023-10-23 16:00:00 + +### Added + +- Updated `README.md` +- + +## [0.1.0] - 2023-07-19 12:00:00 + +### Added + +- Restarts the release numbering to follow semantic versioning and the OG-USA version numbering as separate from the OG-Core version numbering. +- Adds restriction `python<3.11` to `environment.yml` and `setup.py`. +- Changes the format of `setup.py`. +- Updates `build_and_test.yml` to test Python 3.9 and 3.10. +- Updates some GH Action script versions in `check_black.yml`. +- Updates the Python version to 3.10 in `docs_check.yml` and `deploy_docs.yml`. +- Updated the `LICENSE` file to one that GitHub recognizes. +- Updates the `run_og_usa.py` run script. +- Updates some tests and associated data. +- Pins the version of `rpy2` package in `environment.yml` and `setup.py` + + +## 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.1.1]: https://github.com/PSLmodels/OG-USA/compare/v0.1.0...v0.1.1 From dfc8cba91c5775b3db15571fbb01cb289180a4bb Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:56:17 -0600 Subject: [PATCH 05/13] Changed check_black.yml to check_format.yml --- .github/workflows/{check_black.yml => check_format.yml} | 0 CHANGELOG.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{check_black.yml => check_format.yml} (100%) diff --git a/.github/workflows/check_black.yml b/.github/workflows/check_format.yml similarity index 100% rename from .github/workflows/check_black.yml rename to .github/workflows/check_format.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e2e867..8bf1f817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Updated `README.md` -- +- Changed `check_black.yml` to `check_format.yml` ## [0.1.0] - 2023-07-19 12:00:00 From 6be4233893e7069e6acc55950ffc9fdc1f72c193 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 12:59:24 -0600 Subject: [PATCH 06/13] Updated actions in check_format.yml --- .github/workflows/check_format.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_format.yml b/.github/workflows/check_format.yml index 07d476ef..a261c259 100644 --- a/.github/workflows/check_format.yml +++ b/.github/workflows/check_format.yml @@ -1,4 +1,4 @@ -name: Check Black formatting +name: Check code formatting on: [push, pull_request] @@ -6,9 +6,9 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 - uses: psf/black@stable with: - args: ". -l 79 --check" + options: "-l 79 --check" src: "." From dbfea9e62ba4cbf4863d6f175979b7b17424fe6c Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 13:26:53 -0600 Subject: [PATCH 07/13] Updated build_and_test.yml --- .github/workflows/build_and_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c220888c..076d84be 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -12,11 +12,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - - name: Setup Python + - name: Setup Python using Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 0f82ce946b906aa865f04a9ed71c49afc4a2e513 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 13:29:02 -0600 Subject: [PATCH 08/13] Updated docs_check.yml --- .github/workflows/docs_check.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index 6ee81ab3..e8831784 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false @@ -26,5 +26,4 @@ jobs: pip install sphinxcontrib-bibtex>=2.0.0 pip install -e . python -m ipykernel install --user --name=ogusa-dev - cd docs - jb build ./book + jb build ./docs/book From d36742f4306a9c3aa04d31267221cf553304c260 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 13:30:40 -0600 Subject: [PATCH 09/13] Updated deploy_docs.yml --- .github/workflows/deploy_docs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 826818a3..874560e0 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false @@ -29,11 +29,10 @@ jobs: pip install sphinxcontrib-bibtex>=2.0.0 pip install -e . python -m ipykernel install --user --name=ogusa-dev - cd docs - jb build ./book + jb build ./docs/book - name: Deploy - uses: JamesIves/github-pages-deploy-action@releases/v3 + uses: JamesIves/github-pages-deploy-action@releases/v4 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. From 2f944686a668fa3ba4b4020cc62c701ac2b4c178 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 18:07:58 -0600 Subject: [PATCH 10/13] Updated publish_to_pypi.yml --- .github/workflows/publish_to_pypi.yml | 30 +++++++++++++++++++ pyproject.toml | 2 +- setup.py | 42 ++++++++++++++------------- 3 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/publish_to_pypi.yml diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 00000000..5c1ff791 --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,30 @@ +name: Publish package to PyPI + +on: + push: + branches: + - master + +jobs: + deploy: + name: Publish to PyPI + if: github.repository == 'PSLmodels/OG-USA' + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Build package + shell: bash -l {0} + run: | + pip install wheel + python setup.py sdist bdist_wheel + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI }} + skip_existing: true diff --git a/pyproject.toml b/pyproject.toml index a1a5b79d..0da40b0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" # Configuration for Black. diff --git a/setup.py b/setup.py index 69f42ac4..2d09d5e0 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,31 @@ -import setuptools +"""This file contains the OG-USA package's metadata and dependencies.""" -with open("README.md", "r", encoding="utf-8") as fh: - longdesc = fh.read() +from setuptools import find_packages, setup -setuptools.setup( +with open("README.md", "r") as readme_file: + readme = readme_file.read() + +setup( name="ogusa", version="0.1.1", author="Jason DeBacker and Richard W. Evans", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="USA calibration for OG-Core", + long_description=readme, long_description_content_type="text/markdown", - long_description=longdesc, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: CC0 1.0 Universal public domain dedication", + "Operating System :: POSIX", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Information Analysis", + ], + keywords="USA calibration of large scale overlapping generations model of fiscal policy", url="https://github.com/PSLmodels/OG-USA/", download_url="https://github.com/PSLmodels/OG-USA/", project_urls={ @@ -19,7 +34,7 @@ packages=["ogusa"], package_data={"ogusa": ["ogusa_default_parameters.json", "data/PSID/*"]}, include_packages=True, - python_requires=">=3.7.7, <3.11", + python_requires=">=3.7.7, <3.12", install_requires=[ "numpy", "psutil", @@ -37,21 +52,8 @@ "openpyxl>=3.1.2", "statsmodels", "linearmodels", + "wheel", "ogcore", ], - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "Natural Language :: English", - "License :: OSI Approved :: CC0 1.0 Universal public domain dedication", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Topic :: Software Development :: Libraries :: Python Modules", - ], tests_require=["pytest"], ) From b5c42eeb2c0c6c12c96461fb311088da408376b4 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 18:09:02 -0600 Subject: [PATCH 11/13] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bf1f817..8cbb1037 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Updated `README.md` -- Changed `check_black.yml` to `check_format.yml` +- Updates `README.md` +- Changes `check_black.yml` to `check_format.yml` +- Updates other GH Action files: `build_and_test.yml`, `docs_check.yml`, and `deploy_docs.yml` +- Updates `publish_to_pypi.yml` ## [0.1.0] - 2023-07-19 12:00:00 From f57da3de609d8f52c235ca4a525f2d8eac6f38ac Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Mon, 23 Oct 2023 19:29:55 -0600 Subject: [PATCH 12/13] Subbed in Mambaforge to build section of build_and_test.yml --- .github/workflows/build_and_test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 076d84be..569c9f3b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -16,17 +16,19 @@ jobs: with: persist-credentials: false - - name: Setup Python using Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Setup Miniconda using Python ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 with: + miniforge-variant: Mambaforge + auto-update-conda: true + activate-environment: ogusa-dev + environment-file: environment.yml python-version: ${{ matrix.python-version }} + auto-activate-base: false - name: Build shell: bash -l {0} run: | - conda init bash - conda env create - conda activate ogusa-dev pip install -e . pip install pytest-cov pip install pytest-pycodestyle From ed5c0286d018179e33197756d457685c91e373a8 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Wed, 25 Oct 2023 15:15:14 -0600 Subject: [PATCH 13/13] Updated CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cbb1037..aa913aec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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.1.1] - 2023-10-23 16:00:00 +## [0.1.1] - 2023-10-25 17:00:00 ### Added @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changes `check_black.yml` to `check_format.yml` - Updates other GH Action files: `build_and_test.yml`, `docs_check.yml`, and `deploy_docs.yml` - Updates `publish_to_pypi.yml` +- Adds changes from PRs [#73](https://github.com/PSLmodels/OG-USA/pull/73) and [#67](https://github.com/PSLmodels/OG-USA/pull/67) ## [0.1.0] - 2023-07-19 12:00:00