Skip to content

Commit

Permalink
Merge pull request EAPD-DRB#1 from rickecon/init
Browse files Browse the repository at this point in the history
Merging
  • Loading branch information
rickecon authored Sep 26, 2024
2 parents 0df96ff + 42b8531 commit f668ad4
Show file tree
Hide file tree
Showing 96 changed files with 13,843 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
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.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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. Link any issues this PR fixes.
47 changes: 47 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and test [Python 3.10, 3.11]

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
auto-update-conda: true
activate-environment: un-og-training-dev
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Build
shell: bash -l {0}
run: |
pip install -e .
- name: Test
shell: bash -l {0}
working-directory: ./
run: |
pytest -m pytest -m 'not local' --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && contains(github.repository, 'EAPD-DRB/UN-OG-Training')
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
15 changes: 15 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

name: Check code formatting

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
with:
options: "-l 79 --check"
src: "."
38 changes: 38 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Deploy Jupyter Book documentation
on:
push:
branches:
- main
jobs:
build-and-deploy:
if: github.repository == 'EAPD-DRB/UN-OG-Training'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
activate-environment: un-og-training-dev
environment-file: environment.yml
python-version: "3.11"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=un-og-training-dev
cd docs
jb build ./book
- name: Deploy
uses: JamesIves/github-pages-deploy-action@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.
28 changes: 28 additions & 0 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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@v3
with:
miniforge-variant: Mambaforge
activate-environment: un-og-training-dev
environment-file: environment.yml
python-version: "3.11"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=un-og-training-dev
cd docs
jb build ./book
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
*.pyc
MANIFEST
build/*
dist/*
*.egg-info/*
*.aux
*.bbl
*.blg
*.fdb_latexmk
*.idx
*.ilg
*.ind
*.lof
*.log
*.lot
*.out
*.pdfsync
*.synctex.gz
*.toc
*.swp
*.asv
*.nav
*.snm
*.gz
*.bib.bak
*.fls
*.m~
*.sublime*
.DS_Store
*puf.csv
*/OUTPUT/*
*/__pycache__/*
*.coverage*
*.pytest*
Icon?
.ipynb_checkpoints/*

# Built Jupyter-book documentation
docs/book/_build

# Backup docs
pdfs/*

47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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.4] - 2024-09-26 12:00:00

### Added

- Updated remaining OpenRG GitHub org references to EAPD-DRB
- Added CODECOV_TOKEN repository secret to repository settings

## [0.0.3] - 2023-11-06 09:30:00

### Added

- Adds chapter numbering
- Fixed typo in `glossary.md`

## [0.0.2] - 2023-10-26 23:50:00

### Added

- Updated Glossary
- Fixed typos
- Updated figures in the OG chapters

## [0.0.1] - 2023-10-26 23:50:00

### Added

- Updated chapters in Jupyter Book.

## [0.0.0] - 2023-07-25 15:00:00

### Added

- Created UN-OG-Training repository at GitHub.com/OpenRG/UN-OG-Training.



<!-- [0.0.4]: https://github.com/EAPD-DRB/UN-OG-Training/compare/v0.0.3...v0.0.4
[0.0.3]: https://github.com/EAPD-DRB/UN-OG-Training/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/EAPD-DRB/UN-OG-Training/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/EAPD-DRB/UN-OG-Training/compare/v0.0.0...v0.0.1 -->
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# How to contribute to UN-OG-Training.

The UN-OG-Training project follows the [GitHub workflow](https://guides.github.com/introduction/flow/) and [semantic versioning protocol](http://semver.org/).

## Pull requests

We follow the [GitHub Flow](https://guides.github.com/introduction/flow/). All code contributions are submitted via a pull request towards the `main` branch.

Opening a Pull Request means you want that code to be merged. If you want to only discuss it, send a link to your branch along with your questions through whichever communication channel you prefer.

### Peer reviews

All pull requests must be reviewed by someone else than their original author, with few exceptions of pull requests from the main model maintainer.

To help reviewers, make sure to add to your PR a **clear text explanation** of your changes.

In case of changes that break past functionality and connections, you **must** give details about what features were deprecated. You must also provide guidelines to help users adapt their code to be compatible with the new version of the package.

## Advertising changes

### Version number

We follow the [semantic versioning protocol](http://semver.org/). Any change impacts the version number, and the version number conveys API compatibility information **only**.

Every pull request submitted to the main branch of the repository should have a `changelog_entry.yaml` file that has the following structure and format:
```yaml
- bump: {major, minor, patch}
changes:
{added, removed, changed, fixed}:
- <variable or program>
```
Examples:
#### Patch bump
- Fixing or improving an already existing calculation.
#### Minor bump
- Adding a new state's tax logic or a major tax or benefit program (multiple variables and multiple parameters).
#### Major bump
- Major update, refactor, or compatibility change.
### Changelog
UN-OG-Training changes must be understood by users who don't necessarily work on the code. The Changelog must therefore be as explicit as possible.
Each change must be documented with the following elements:
- On the first line appears as a title the version number, as well as a link towards the Pull Request introducing the change. The title level must match the incrementation level of the version.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
format:
black . -l 79
linecheck . --fix
install:
pip install -e .
test:
pytest -m 'not local'
documentation:
jupyter-book clean docs/book
jupyter-book build docs/book
changelog:
build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.0.0 --append-file changelog_entry.yaml
build-changelog changelog.yaml --org EAPD-DRB --repo UN-OG-Training --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py
rm changelog_entry.yaml || true
touch changelog_entry.yaml
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# UN-OG-Training
Training materials for United Nations country-specific overlapping generations model

| | |
| --- | --- |
| Org | [![United Nations DESA](https://img.shields.io/badge/United%20Nations%20DESA-blue)](https://www.un.org/en/desa) [![OSE Lab cataloged](https://img.shields.io/badge/OSE%20Lab-catalogued-critical)](https://github.com/OpenSourceEcon) [![OS License: AGPL-3.0](https://img.shields.io/badge/OS%20License-AGPL%203.0-yellow)](https://github.com/EAPD-DRB/UN-OG-Training/blob/main/LICENSE) [![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://eapd-drb.github.io/UN-OG-Training/) |
| 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-3115/) |
| Testing | ![example event parameter](https://github.com/EAPD-DRB/UN-OG-Training/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/UN-OG-Training/actions/workflows/deploy_docs.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/UN-OG-Training/actions/workflows/check_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/UN-OG-Training/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/UN-OG-Training) |

Training materials for United Nations country-specific overlapping generations model. The online rendered Jupyter Book for these training materials is at https://eapd-drb.github.io/UN-OG-Training/.
Loading

0 comments on commit f668ad4

Please sign in to comment.