Skip to content

Commit

Permalink
Merge pull request #1 from jdebacker/initial_files
Browse files Browse the repository at this point in the history
Initial files
  • Loading branch information
jdebacker authored Jun 20, 2024
2 parents 32798db + 1f11833 commit 1498bb5
Show file tree
Hide file tree
Showing 71 changed files with 286,400 additions and 5 deletions.
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.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
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.
63 changes: 63 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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, 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: ogidn-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: |
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-IDN')
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
14 changes: 14 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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: "."
48 changes: 48 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Deploy Jupyter Book documentation
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'
- './ogidn/**.py'
jobs:
build-and-deploy:
if: github.repository == 'EAPD-DRB/OG-IDN'
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: ogidn-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 jupyter-book>=0.11.3
pip install sphinxcontrib-bibtex>=2.0.0
pip install -e .
python -m ipykernel install --user --name=ogidn-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.
39 changes: 39 additions & 0 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check that docs build
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'
- './ogidn/**.py'

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: ogidn-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 jupyter-book>=0.11.3
pip install sphinxcontrib-bibtex>=2.0.0
pip install -e .
python -m ipykernel install --user --name=ogidn-dev
jb build ./docs/book
30 changes: 30 additions & 0 deletions .github/workflows/publish_to_pypi.yml
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-IDN'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- 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
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
*.pyc
MANIFEST
build/*
dist/*
*.cache/
.coverage
.coveragerc
htmlcov/*
*.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
*tax_func_loop_inputs_large.pkl
*/OUTPUT/*
envs/
*.egg-info/
*dask-worker-space*
.ipynb_checkpoints*
*/__pycache__/*
*.coverage*
*coverage.xml*
docs/book/_build/*
*/OG-ZAF_example_plots/*
*ogzaf_example_output.csv
*/OG-ZAF-Example/*
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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.0] - 2024-06-20 12:00:00

### Added

- This version is a pre-release alpha. The example run script OG-IDN/examples/run_og_idn.py runs, but the model is not currently calibrated to represent the Indonesian economy and population.

Loading

0 comments on commit 1498bb5

Please sign in to comment.