-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from rickecon/tests
Testing, Package, and Documentation updates
- Loading branch information
Showing
20 changed files
with
280,408 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Thanks for filing an issue! Please remove any top-level headers that do not apply. | ||
|
||
# Problem or Error | ||
Please characterize the problem concisely and precisely. You may want to include error message output, other terminal output, your environment characteristics, and a way to replicate the issue. Let us know what solutions you have tried. | ||
|
||
# Question | ||
Please ask the question with clear context and any potential answer directions you can think of. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Thanks for contributing! Please remove any top-level sections that do not apply to your changes. | ||
|
||
- [ ] `make format` and `make documentation` has been run. (You may also want to run `make test`.) | ||
|
||
## What's changed | ||
|
||
Description of the changes here. | ||
|
||
# Bug fix | ||
|
||
- [ ] Continuous integration test added | ||
- [ ] Continuous integration test passing | ||
|
||
## What this fixes and how it's fixed | ||
|
||
Description of how this fix works goes here. Link any issues this PR fixes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and test [Python 3.9, 3.10] | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda using Python ${{ matrix.python-version }} | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
auto-update-conda: true | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: false | ||
|
||
- name: Build | ||
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 | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true |
6 changes: 3 additions & 3 deletions
6
.github/workflows/check_black.yml → .github/workflows/check_format.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Deploy Jupyter Book documentation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-deploy: | ||
if: github.repository == 'EAPD-DRB/OG-ZAF' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: "3.10" | ||
auto-activate-base: false | ||
|
||
- name: Build # Build Jupyter Book | ||
shell: bash -l {0} | ||
run: | | ||
pip install jupyter-book>=0.11.3 | ||
pip install sphinxcontrib-bibtex>=2.0.0 | ||
pip install -e . | ||
python -m ipykernel install --user --name=ogzaf-dev | ||
jb build ./docs/book | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: docs/book/_build/html # The folder the action should deploy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check that docs build | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
activate-environment: ogzaf-dev | ||
environment-file: environment.yml | ||
python-version: "3.10" | ||
auto-activate-base: false | ||
|
||
- name: Build # Build Jupyter Book | ||
shell: bash -l {0} | ||
run: | | ||
pip install jupyter-book>=0.11.3 | ||
pip install sphinxcontrib-bibtex>=2.0.0 | ||
pip install -e . | ||
python -m ipykernel install --user --name=ogzaf-dev | ||
jb build ./docs/book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish package to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: Publish to PyPI | ||
if: github.repository == 'EAPD-DRB/OG-ZAF' | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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.0.1] - 2023-10-30 8:00:00 | ||
|
||
### Added | ||
|
||
- Adds CI tests `check_format.yml`, `build_and_test.yml`, `docs_build.yml`, `deploy_docs.yml`, `publish_to_pypi.yml` | ||
- Adds `/tests/` directory with test files in it | ||
- Added `Makefile` | ||
- Updated `environment.yml` and `setup.py` | ||
- Updated `pyproject.toml` | ||
- Updates the `README.md` | ||
|
||
## [0.0.0] - 2022-10-15 12:00:00 | ||
|
||
### Added | ||
|
||
- This version is a pre-release alpha. The example run script OG-ZAF/examples/run_og_zaf.py runs, but the model is not currently calibrated to represent the South African economy and population. | ||
|
||
|
||
|
||
[0.0.1]: https://github.com/EAPD-DRB/OG-ZAF/compare/v0.0.0...v0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
all: build | ||
format: | ||
black . -l 79 | ||
linecheck . --fix | ||
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 | ||
jupyter-book build docs/book | ||
pip-package: | ||
pip install wheel | ||
python setup.py sdist bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
import setuptools | ||
"""This file contains the OG-ZAF 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="ogzaf", | ||
version="0.0.0", | ||
author="Marcelo LaFleur and Richard W. Evans", | ||
version="0.0.1", | ||
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", | ||
long_description=longdesc, | ||
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", | ||
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": [ | ||
"ogzaf_default_parameters.json", | ||
"data/*", | ||
] | ||
}, | ||
package_data={"ogzaf": ["ogusa_default_parameters.json", "data/*"]}, | ||
include_packages=True, | ||
python_requires=">=3.7.7", | ||
install_requires=[ | ||
"psutil", | ||
"numpy", | ||
"psutil", | ||
"scipy>=1.7.1", | ||
"pandas>=1.2.5", | ||
"matplotlib", | ||
"dask>=2.30.0", | ||
"distributed>=2.30.1", | ||
"paramtools>=0.15.0", | ||
"requests", | ||
"pandas-datareader", | ||
"xlwt", | ||
"openpyxl", | ||
"openpyxl>=3.1.2", | ||
"statsmodels", | ||
"linearmodels", | ||
"black", | ||
"pandas-datareader", | ||
"linecheck", | ||
"ogcore", | ||
], | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Developers", | ||
"Natural Language :: English", | ||
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
], | ||
tests_require=["pytest"], | ||
) |
Oops, something went wrong.