Skip to content

Commit

Permalink
Merge branch 'master' into MoveAddStablePointsRedo
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwhite authored Mar 5, 2024
2 parents 441318b + b2dccab commit 44fee0d
Show file tree
Hide file tree
Showing 76 changed files with 4,938 additions and 1,305 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/chatops-binder.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ jobs:
pytest --cov=./ --cov-report=xml
- name: upload coverage report
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
130 changes: 65 additions & 65 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,73 +26,73 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10" # Interpolation.py doesn't support Python 3.11 [2023-07]
cache: 'pip'
cache-dependency-path: |
requirements/base.txt
requirements/doc.txt
- name: Install Pandoc
run: sudo apt-get install --yes pandoc

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install HARK
run: python -m pip install .[doc]

- name: Run Sphinx
run: >
sphinx-build
-M html Documentation HARK-docs
-T
-W
-j auto
- name: Set up git for deployment
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config --local --unset-all http.https://github.com/.extraheader
- name: Commit all rendered HTML files
run: |
git switch --orphan gh-pages
git add --all HARK-docs/html
git commit -qm "Documentation from @ ${{ github.repository }}@${{ github.sha }}"
- name: Deploy to GitHub Pages
# Only deploy to Pages on pushes to HEAD
if: (github.repository_owner == 'Econ-ARK') && (github.event_name == 'push') && (github.ref_name == 'master')
run: >
git push
--force
https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}
`git subtree split --prefix HARK-docs/html gh-pages`:refs/heads/gh-pages
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10" # Interpolation.py doesn't support Python 3.11 [2023-07]
cache: "pip"
cache-dependency-path: |
requirements/base.txt
requirements/doc.txt
- name: Install Pandoc
run: sudo apt-get install --yes pandoc

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install HARK
run: python -m pip install .[doc]

- name: Run Sphinx
run: >
sphinx-build
-M html Documentation HARK-docs
-T
-W
-j 1
- name: Set up git for deployment
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config --local --unset-all http.https://github.com/.extraheader
- name: Commit all rendered HTML files
run: |
git switch --orphan gh-pages
git add --all HARK-docs/html
git commit -qm "Documentation from @ ${{ github.repository }}@${{ github.sha }}"
- name: Deploy to GitHub Pages
# Only deploy to Pages on pushes to HEAD
if: (github.repository_owner == 'Econ-ARK') && (github.event_name == 'push') && (github.ref_name == 'master')
run: >
git push
--force
https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}
`git subtree split --prefix HARK-docs/html gh-pages`:refs/heads/gh-pages
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade sphinx-lint
- name: Lint documentation with sphinx-lint
run: >
sphinx-lint
--ignore Documentation/example_notebooks/GenIncProcessModel.py
--enable all
--max-line-length 85
README.md
Documentation/
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade sphinx-lint
- name: Lint documentation with sphinx-lint
run: >
sphinx-lint
--ignore Documentation/example_notebooks/GenIncProcessModel.py
--enable all
--max-line-length 85
README.md
Documentation/
82 changes: 41 additions & 41 deletions .github/workflows/execute-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
# 6.49 am (GMT) every Monday; time chosen at random
schedule:
- cron: "49 6 * * MON"
- cron: "49 6 * * MON"

# Limit workflow permissions
permissions:
Expand All @@ -29,47 +29,47 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10" # Numba doesn't support Python 3.11 [2023-05]
cache: 'pip'
cache-dependency-path: |
requirements/base.txt
.github/workflows/execute-notebooks.yml
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10" # Numba doesn't support Python 3.11 [2023-05]
cache: "pip"
cache-dependency-path: |
requirements/base.txt
.github/workflows/execute-notebooks.yml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
# For LabeledModels.ipynb
python -m pip install estimagic
# For nbstripout
python -m pip install nbstripout
# For nb_exec.py
python -m pip install ipykernel nbclient nbformat
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
# For LabeledModels.ipynb
python -m pip install estimagic
# For nbstripout
python -m pip install nbstripout
# For nb_exec.py
python -m pip install ipykernel nbclient nbformat
- name: Strip output
run: nbstripout examples/**/*.ipynb
- name: Strip output
run: nbstripout examples/**/*.ipynb

# This step takes c. 20 minutes
- name: Execute notebooks
run: python tools/nb_exec.py examples/**/*.ipynb
env:
PYTHONUNBUFFERED: "1"
# This step takes c. 20 minutes
- name: Execute notebooks
run: python tools/nb_exec.py examples/**/*.ipynb
env:
PYTHONUNBUFFERED: "1"

- name: Open PR
uses: peter-evans/create-pull-request@v5
with:
author: "Econ-ARK Bot <[email protected]>"
branch: "bot/update-notebooks"
commit-message: "[bot] updated notebooks"
delete-branch: true
title: "[bot] Execute example notebooks"
# language=Markdown
body: >
This PR was [automatically generated] to re-execute
the example notebooks for use in the documentation.
[automatically generated]: https://github.com/Econ-ARK/HARK/actions/workflows/execute-notebooks.yml
- name: Open PR
uses: peter-evans/create-pull-request@v5
with:
author: "Econ-ARK Bot <[email protected]>"
branch: "bot/update-notebooks"
commit-message: "[bot] updated notebooks"
delete-branch: true
title: "[bot] Execute example notebooks"
# language=Markdown
body: >
This PR was [automatically generated] to re-execute
the example notebooks for use in the documentation.
[automatically generated]: https://github.com/Econ-ARK/HARK/actions/workflows/execute-notebooks.yml
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pre-commit

on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install packages
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
pip list
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure --color always
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
exclude: Documentation/example_notebooks/

repos:
- repo: https://github.com/mwouts/jupytext
rev: v1.14.5
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: jupytext
args:
[--sync, --set-formats, "ipynb,py:percent", --pipe, black, --execute]
additional_dependencies: [jupytext, black, nbconvert]
files: ^examples/.*\.ipynb$
- id: ruff
types_or: [jupyter]
- id: ruff-format
args: [--check]
types_or: [jupyter]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
exclude: ^examples/

- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.10.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]
exclude: ^examples/

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.15.0
hooks:
- id: blacken-docs
exclude: ^examples/
Expand All @@ -38,7 +38,7 @@ repos:
exclude: ^examples/

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.0.1
hooks:
- id: prettier
exclude: ^examples/
Expand Down
Loading

0 comments on commit 44fee0d

Please sign in to comment.