Skip to content

Commit

Permalink
Merge pull request #3 from rickecon/jdebacker-updates_for_ogcore
Browse files Browse the repository at this point in the history
Updates to Jason's PR branch from Rick
  • Loading branch information
jdebacker authored Jun 18, 2024
2 parents 7a54015 + bd22d18 commit cfa3ff7
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 47 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
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@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Build package
shell: bash -l {0}
run: |
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions docs/book/content/intro/intro.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
10 changes: 5 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -28,9 +29,8 @@ dependencies:
- black
- jupyter
- ipython
- setuptools
- pip
- pip:
- jupyter-book>=0.9.1
- openpyxl>=3.1.2
- pandas-datareader
- linecheck
Expand Down
11 changes: 11 additions & 0 deletions ogzaf/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 20 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
"""This file contains the OG-ZAF package's metadata and dependencies."""

from setuptools import find_packages, setup
import setuptools

Check warning on line 1 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L1

Added line #L1 was not covered by tests

with open("README.md", "r") as readme_file:
readme = readme_file.read()
longdesc = readme_file.read()

Check warning on line 4 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L4

Added line #L4 was not covered by tests

setup(
setuptools.setup(

Check warning on line 6 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L6

Added line #L6 was not covered by tests
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",
Expand All @@ -51,9 +36,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"],
)

0 comments on commit cfa3ff7

Please sign in to comment.