From 716e75d3be9c5b5672ddbfa6b803b45879bcbc68 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:14:26 -0600 Subject: [PATCH 01/10] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 19edd99..c4a6ccc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ | | | | --- | --- | | Org | [![United Nations DESA](https://img.shields.io/badge/United%20Nations%20DESA-blue)](https://www.un.org/en/desa) [![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/EAPD-DRB/OG-ZAF/blob/main/LICENSE) | -| Package | [![Python 3.9](https://img.shields.io/badge/python-3.9-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/ogzaf.svg)](https://pypi.org/project/ogzaf/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogzaf.svg?label=PyPI%20downloads)](https://pypi.org/project/ogzaf/) | +| Package | [![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/ogzaf.svg)](https://pypi.org/project/ogzaf/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogzaf.svg?label=PyPI%20downloads)](https://pypi.org/project/ogzaf/) | | Testing | ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![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_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/OG-ZAF/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/OG-ZAF) | OG-ZAF is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for South Africa. OG-ZAF is built on the 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 and documentation of the specific South African calibration of the model will be available soon. From a20e944c7e1f734a97f68ce2add0db4aae5fdb92 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:14:43 -0600 Subject: [PATCH 02/10] Updated intro.md --- docs/book/content/intro/intro.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/book/content/intro/intro.md b/docs/book/content/intro/intro.md index 15b9f78..93464fe 100644 --- a/docs/book/content/intro/intro.md +++ b/docs/book/content/intro/intro.md @@ -1,6 +1,12 @@ (Chap_Intro)= # OG-ZAF +| | | +| --- | --- | +| Org | [![United Nations DESA](https://img.shields.io/badge/United%20Nations%20DESA-blue)](https://www.un.org/en/desa) [![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/EAPD-DRB/OG-ZAF/blob/main/LICENSE) | +| Package | [![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/ogzaf.svg)](https://pypi.org/project/ogzaf/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogzaf.svg?label=PyPI%20downloads)](https://pypi.org/project/ogzaf/) | +| Testing | ![example event parameter](https://github.com/EAPD-DRB/OG-ZAF/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![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_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/OG-ZAF/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/OG-ZAF) | + [`OG-ZAF`](https://github.com/EAPD-DRB/OG-ZAF) is a package that provides code and data to calibrate an overlapping-generations (OG) model to the economy of South Africa (ZAF), the code of which is hosted on GitHub at https://github.com/EAPD-DRB/OG-ZAF. `OG-ZAF` uses as a dependency the [`OG-Core`](https://pslmodels.github.io/OG-Core/) package, which contains the core theory and logic of a general OG model. The `OG-ZAF` calibration package and the `OG-Core` theory and logic make the model that allows for dynamic general equilibrium analysis of federal fiscal policy in South Africa. The model output focuses on changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. This documentation of the `OG-ZAF` package contains the following major sections, which are regularly updated. * Contributing to `OG-ZAF` From c528878d0e6ed447c1cb67d705b03041817c5d8c Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:15:04 -0600 Subject: [PATCH 03/10] Updated environment.yml --- environment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/environment.yml b/environment.yml index 0a81fbf..be660a0 100644 --- a/environment.yml +++ b/environment.yml @@ -4,6 +4,8 @@ channels: dependencies: - python>=3.7.7, <3.12 - numpy +- setuptools +- wheel - numba>=0.54 - scipy>=1.7.1 - pandas>=1.2.5 @@ -14,11 +16,10 @@ dependencies: - paramtools>=0.15.0 - sphinx>=3.5.4 - sphinx-book-theme>=0.1.3 -- pip +- jupyter-book>=0.11.3 - pytest>=6.0 -- pytest-pep8 +- pytest-cov - pytest-xdist -- pycodestyle - pylint - coverage - requests @@ -28,9 +29,8 @@ dependencies: - black - jupyter - ipython -- setuptools +- pip - pip: - - jupyter-book>=0.9.1 - openpyxl>=3.1.2 - pandas-datareader - linecheck From ea057f40196a363d256a65e068128ab4aad9093d Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:15:17 -0600 Subject: [PATCH 04/10] Updated setup.py --- setup.py | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/setup.py b/setup.py index 8f8da6f..83e3e3c 100644 --- a/setup.py +++ b/setup.py @@ -1,41 +1,31 @@ -"""This file contains the OG-ZAF package's metadata and dependencies.""" - -from setuptools import find_packages, setup +import setuptools with open("README.md", "r") as readme_file: - readme = readme_file.read() + longdesc = readme_file.read() -setup( +setuptools.setup( name="ogzaf", version="0.0.2", author="Marcelo LaFleur, Richard W. Evans, and Jason DeBacker", license="CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", description="South Africa Calibration for OG-Core", - long_description=readme, long_description_content_type="text/markdown", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Natural Language :: English", - "License :: OSI Approved :: Common Public License", - "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", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - keywords="South Africa calibration of large scale overlapping generations model of fiscal policy", + long_description=longdesc, + keywords="ZAF South Africa calibration of large scale overlapping generations model of fiscal policy", url="https://github.com/EAPD-DRB/OG-ZAF/", download_url="https://github.com/EAPD-DRB/OG-ZAF/", project_urls={ "Issue Tracker": "https://github.com/EAPD-DRB/OG-ZAF/issues", }, packages=["ogzaf"], - package_data={"ogzaf": ["ogusa_default_parameters.json", "data/*"]}, + package_data={ + "ogzaf": [ + "ogzaf_default_parameters.json", + "data/*" + ] + }, include_packages=True, - python_requires=">=3.7.7", + python_requires=">=3.7.7, <3.12", install_requires=[ "numpy", "psutil", @@ -51,9 +41,22 @@ "openpyxl>=3.1.2", "statsmodels", "linearmodels", + "wheel", "black", "linecheck", "ogcore", ], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: Common Public License", + "Operating System :: POSIX", + "Programming Language :: Python", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Software Development :: Libraries :: Python Modules", + ], tests_require=["pytest"], ) From aaa4bf98f86858b0e1d86c0669bbd64c3e85846a Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:16:39 -0600 Subject: [PATCH 05/10] Updated build_and_test.yml --- .github/workflows/build_and_test.yml | 32 ++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c303a7b..8e3257b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,14 +1,30 @@ -name: Build and test [Python 3.9, 3.10] - -on: [push, pull_request] - +name: Build and test +on: + push: + paths: + - '**.yml' + - '**.toml' + - '**.ini' + - '**.py' + - '**.json' + - '**.csv' + - '**.pkl' + pull_request: + paths: + - '**.yml' + - '**.toml' + - '**.ini' + - '**.py' + - '**.json' + - '**.csv' + - '**.pkl' jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11"] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10", "3.11"] steps: - name: Checkout @@ -30,13 +46,11 @@ jobs: shell: bash -l {0} run: | pip install -e . - pip install pytest-cov - pip install pytest-pycodestyle - name: Test shell: bash -l {0} working-directory: ./ run: | - pytest -m 'not local' --cov=./ --cov-report=xml + python -m pytest -m 'not local' --cov=./ --cov-report=xml - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && contains(github.repository, 'EAPD-DRB/OG-ZAF') uses: codecov/codecov-action@v4 From f5687d88e66f0bfe472bb14fe7ac58faa9375849 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:20:10 -0600 Subject: [PATCH 06/10] Updated CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd14ec0..f29ed3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,11 @@ 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.0.2] - 2024-06-12 8:00:00 +## [0.0.2] - 2024-06-18 12:00:00 ### Added -- Updates to `Calibration` to work with OG-Core 0.11.9 +- Updates to `Calibration` to work with OG-Core 0.11.10 - Removal of unused lines of code throughout the package @@ -32,4 +32,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[0.0.2]: https://github.com/EAPD-DRB/OG-ZAF/compare/v0.0.1...v0.0.2 [0.0.1]: https://github.com/EAPD-DRB/OG-ZAF/compare/v0.0.0...v0.0.1 From a6e10fe96c08c23a449252d06f24515b8bf315c8 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:21:20 -0600 Subject: [PATCH 07/10] Updated Makefile --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 53b8343..c94c54d 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,6 @@ format: install: pip install -e . test: - pip install pytest-cov - pip install pytest-pycodestyle pytest -m 'not local' --cov=./ --cov-report=xml documentation: jupyter-book clean docs/book From d8d1bb5a02c15996a4e6be852d974d5abc521e96 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:53:22 -0600 Subject: [PATCH 08/10] Updated GH Actions --- .github/workflows/deploy_docs.yml | 13 +++++++++++-- .github/workflows/docs_check.yml | 16 +++++++++++++--- .github/workflows/publish_to_pypi.yml | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index d8c2b7e..1f15f17 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -3,6 +3,15 @@ on: push: branches: - main + paths: + - './docs/**.png' + - './docs/book/content/calibration/images/**.png' + - './docs/README.md' + - './docs/book/**.yml' + - './docs/book/**.bib' + - '**.md' + - './docs/book/content/api/**.rst' + - './ogzaf/**.py' jobs: build-and-deploy: if: github.repository == 'EAPD-DRB/OG-ZAF' @@ -14,12 +23,12 @@ jobs: persist-credentials: false - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniforge-variant: Mambaforge activate-environment: ogzaf-dev environment-file: environment.yml - python-version: "3.10" + python-version: "3.11" auto-activate-base: false - name: Build # Build Jupyter Book diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index 77b245f..eb71523 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -1,5 +1,15 @@ name: Check that docs build -on: [push, pull_request] +on: + pull_request: + paths: + - './docs/**.png' + - './docs/book/content/calibration/images/**.png' + - './docs/README.md' + - './docs/book/**.yml' + - './docs/book/**.bib' + - '**.md' + - './docs/book/content/api/**.rst' + - './ogzaf/**.py' jobs: build: @@ -11,12 +21,12 @@ jobs: persist-credentials: false - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniforge-variant: Mambaforge activate-environment: ogzaf-dev environment-file: environment.yml - python-version: "3.10" + python-version: "3.11" 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 3afbe4f..7a306f8 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@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Build package shell: bash -l {0} run: | From e92f3d49305bc9fde8bd2a52f1dc22de17e7af9a Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 10:54:26 -0600 Subject: [PATCH 09/10] Black formatted setup.py --- setup.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 83e3e3c..80f8331 100644 --- a/setup.py +++ b/setup.py @@ -18,12 +18,7 @@ "Issue Tracker": "https://github.com/EAPD-DRB/OG-ZAF/issues", }, packages=["ogzaf"], - package_data={ - "ogzaf": [ - "ogzaf_default_parameters.json", - "data/*" - ] - }, + package_data={"ogzaf": ["ogzaf_default_parameters.json", "data/*"]}, include_packages=True, python_requires=">=3.7.7, <3.12", install_requires=[ From bd22d1811abc9fff87434d4b1cd353c3852976c5 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 18 Jun 2024 11:07:40 -0600 Subject: [PATCH 10/10] Added __init__.py file --- ogzaf/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ogzaf/__init__.py diff --git a/ogzaf/__init__.py b/ogzaf/__init__.py new file mode 100644 index 0000000..75d83a6 --- /dev/null +++ b/ogzaf/__init__.py @@ -0,0 +1,11 @@ +""" +Specify what is available to import from the ogzaf package. +""" + +from ogzaf.calibrate import * +from ogzaf.income import * +from ogzaf.input_output import * +from ogzaf.macro_params import * +from ogzaf.utils import * + +__version__ = "0.0.2"