Skip to content

Commit dd1c6e3

Browse files
authored
Merge branch 'main' into cons_smoothing
2 parents 305d77b + 685b5dc commit dd1c6e3

20 files changed

+4843
-0
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: /
10+
commit-message:
11+
prefix: ⬆️
12+
schedule:
13+
interval: weekly

.github/workflows/cache.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Cache [using jupyter-book]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Anaconda
13+
uses: conda-incubator/setup-miniconda@v3
14+
with:
15+
auto-update-conda: true
16+
auto-activate-base: true
17+
miniconda-version: 'latest'
18+
python-version: "3.11"
19+
environment-file: environment.yml
20+
activate-environment: quantecon
21+
- name: graphviz Support # TODO: required?
22+
run: |
23+
sudo apt-get -qq update && sudo apt-get install -y graphviz
24+
- name: Install latex dependencies
25+
run: |
26+
sudo apt-get -qq update
27+
sudo apt-get install -y \
28+
texlive-latex-recommended \
29+
texlive-latex-extra \
30+
texlive-fonts-recommended \
31+
texlive-fonts-extra \
32+
texlive-xetex \
33+
latexmk \
34+
xindy \
35+
dvipng \
36+
cm-super
37+
- name: Build HTML
38+
shell: bash -l {0}
39+
run: |
40+
jb build lectures --path-output ./ -W --keep-going
41+
- name: Upload Execution Reports (HTML)
42+
uses: actions/upload-artifact@v4
43+
if: failure()
44+
with:
45+
name: execution-reports
46+
path: _build/html/reports
47+
- name: Upload "_build" folder (cache)
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: build-cache
51+
path: _build

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build HTML [using jupyter-book]
2+
on: [pull_request]
3+
jobs:
4+
preview:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v4
9+
- name: Setup Anaconda
10+
uses: conda-incubator/setup-miniconda@v3
11+
with:
12+
auto-update-conda: true
13+
auto-activate-base: true
14+
miniconda-version: 'latest'
15+
python-version: "3.11"
16+
environment-file: environment.yml
17+
activate-environment: quantecon
18+
- name: Graphics Support #TODO: Review if graphviz is needed
19+
run: |
20+
sudo apt-get -qq update && sudo apt-get install -y graphviz
21+
- name: Install latex dependencies
22+
run: |
23+
sudo apt-get -qq update
24+
sudo apt-get install -y \
25+
texlive-latex-recommended \
26+
texlive-latex-extra \
27+
texlive-fonts-recommended \
28+
texlive-fonts-extra \
29+
texlive-xetex \
30+
latexmk \
31+
xindy \
32+
dvipng \
33+
cm-super
34+
- name: Display Conda Environment Versions
35+
shell: bash -l {0}
36+
run: conda list
37+
- name: Display Pip Versions
38+
shell: bash -l {0}
39+
run: pip list
40+
- name: Download "build" folder (cache)
41+
uses: dawidd6/action-download-artifact@v6
42+
with:
43+
workflow: cache.yml
44+
branch: main
45+
name: build-cache
46+
path: _build
47+
# Build Assets (Download Notebooks and PDF via LaTeX)
48+
- name: Build PDF from LaTeX
49+
shell: bash -l {0}
50+
run: |
51+
jb build lectures --builder pdflatex --path-output ./ -n --keep-going
52+
mkdir -p _build/html/_pdf
53+
cp -u _build/latex/*.pdf _build/html/_pdf
54+
- name: Upload Execution Reports (LaTeX)
55+
uses: actions/upload-artifact@v4
56+
if: failure()
57+
with:
58+
name: execution-reports
59+
path: _build/latex/reports
60+
- name: Build Download Notebooks (sphinx-tojupyter)
61+
shell: bash -l {0}
62+
run: |
63+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
64+
mkdir -p _build/html/_notebooks
65+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
66+
# Build HTML (Website)
67+
# BUG: rm .doctress to remove `sphinx` rendering issues for ipywidget mimetypes
68+
# and clear the sphinx cache for building final HTML documents.
69+
- name: Build HTML
70+
shell: bash -l {0}
71+
run: |
72+
rm -r _build/.doctrees
73+
jb build lectures --path-output ./ -nW --keep-going
74+
- name: Upload Execution Reports (HTML)
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: execution-reports
79+
path: _build/html/reports
80+
- name: Preview Deploy to Netlify
81+
uses: nwtgck/[email protected]
82+
with:
83+
publish-dir: '_build/html/'
84+
production-branch: main
85+
github-token: ${{ secrets.GITHUB_TOKEN }}
86+
deploy-message: "Preview Deploy from GitHub Actions"
87+
env:
88+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
89+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

.github/workflows/collab.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build Project on Google Collab (Execution)
2+
on: [pull_request]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest-m
7+
container:
8+
image: us-docker.pkg.dev/colab-images/public/runtime:latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: ${{ github.event.pull_request.head.sha }}
13+
- name: Check for dockerenv file
14+
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
15+
- name: Check python version
16+
shell: bash -l {0}
17+
run: |
18+
python --version
19+
- name: Display Pip Versions
20+
shell: bash -l {0}
21+
run: pip list
22+
- name: Download "build" folder (cache)
23+
uses: dawidd6/action-download-artifact@v6
24+
with:
25+
workflow: cache.yml
26+
branch: main
27+
name: build-cache
28+
path: _build
29+
# Install build software
30+
- name: Install Build Software
31+
shell: bash -l {0}
32+
run: |
33+
pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx_proof==0.2.0
34+
# Build of HTML (Execution Testing)
35+
- name: Build HTML
36+
shell: bash -l {0}
37+
run: |
38+
jb build lectures --path-output ./ -n -W --keep-going
39+
- name: Upload Execution Reports
40+
uses: actions/upload-artifact@v4
41+
if: failure()
42+
with:
43+
name: execution-reports
44+
path: _build/html/reports
45+
- name: Preview Deploy to Netlify
46+
uses: nwtgck/[email protected]
47+
with:
48+
publish-dir: '_build/html/'
49+
production-branch: main
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
deploy-message: "Preview Deploy from GitHub Actions"
52+
env:
53+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
54+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

.github/workflows/linkcheck.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Link Checker [Anaconda, Linux]
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
schedule:
6+
# UTC 12:00 is early morning in Australia
7+
- cron: '0 12 * * *'
8+
jobs:
9+
link-check-linux:
10+
name: Link Checking (${{ matrix.python-version }}, ${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: ["ubuntu-latest"]
16+
python-version: ["3.11"]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Setup Anaconda
21+
uses: conda-incubator/setup-miniconda@v3
22+
with:
23+
auto-update-conda: true
24+
auto-activate-base: true
25+
miniconda-version: 'latest'
26+
python-version: "3.11"
27+
environment-file: environment.yml
28+
activate-environment: quantecon
29+
- name: Download "build" folder (cache)
30+
uses: dawidd6/action-download-artifact@v6
31+
with:
32+
workflow: cache.yml
33+
branch: main
34+
name: build-cache
35+
path: _build
36+
- name: Link Checker
37+
shell: bash -l {0}
38+
run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck
39+
- name: Upload Link Checker Reports
40+
uses: actions/upload-artifact@v4
41+
if: failure()
42+
with:
43+
name: linkcheck-reports
44+
path: _build/linkcheck

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
lectures/_build
3+
.ipynb_checkpoints/
4+
.virtual_documents/
5+
_build/*

lectures/_config.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
title: A First Course in Quantitative Economics with Python
2+
author: Thomas J. Sargent & John Stachurski
3+
logo: _static/qe-logo.png
4+
description: This website presents introductory lectures on computational economics, designed and written by Thomas J. Sargent and John Stachurski.
5+
6+
parse:
7+
myst_enable_extensions: # default extensions to enable in the myst parser. See https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html
8+
- amsmath
9+
- colon_fence
10+
- deflist
11+
- dollarmath
12+
- html_admonition
13+
- html_image
14+
- linkify
15+
- replacements
16+
- smartquotes
17+
- substitution
18+
- tasklist
19+
20+
only_build_toc_files: true
21+
execute:
22+
execute_notebooks: "cache"
23+
timeout: 600 # 10 minutes
24+
exclude_patterns:
25+
- '_static/*'
26+
27+
html:
28+
baseurl: https://intro.quantecon.org/
29+
30+
bibtex_bibfiles:
31+
- _static/quant-econ.bib
32+
33+
latex:
34+
latex_documents:
35+
targetname: quantecon-python-intro.tex
36+
37+
sphinx:
38+
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx.ext.intersphinx, sphinx_proof, sphinx_tojupyter]
39+
config:
40+
# false-positive links
41+
linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116', 'https://math.stackexchange.com/*', 'https://stackoverflow.com/*']
42+
# myst-nb config
43+
nb_render_image_options:
44+
width: 80%
45+
nb_code_prompt_show: "Show {type}"
46+
# -------------
47+
html_favicon: _static/lectures-favicon.ico
48+
html_theme: quantecon_book_theme
49+
html_static_path: ['_static']
50+
html_theme_options:
51+
authors:
52+
- name: Thomas J. Sargent
53+
url: http://www.tomsargent.com/
54+
- name: John Stachurski
55+
url: https://johnstachurski.net/
56+
dark_logo: quantecon-logo-transparent.png
57+
header_organisation_url: https://quantecon.org
58+
header_organisation: QuantEcon
59+
repository_url: https://github.com/QuantEcon/lecture-python-intro
60+
nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
61+
twitter: quantecon
62+
twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
63+
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
64+
description: This website presents introductory lectures on computational economics, designed and written by Thomas J. Sargent and John Stachurski.
65+
keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
66+
analytics:
67+
google_analytics_id: G-QDS1YRJNGM
68+
launch_buttons:
69+
notebook_interface : classic # The interface interactive links will activate ["classic", "jupyterlab"]
70+
binderhub_url : https://mybinder.org # The URL of the BinderHub (e.g., https://mybinder.org)
71+
colab_url : https://colab.research.google.com
72+
thebe : false # Add a thebe button to pages (requires the repository to run on Binder)
73+
intersphinx_mapping:
74+
pyprog:
75+
- https://python-programming.quantecon.org/
76+
- null
77+
intro:
78+
- https://intro.quantecon.org/
79+
- null
80+
dle:
81+
- https://quantecon.github.io/lecture-dle/
82+
- null
83+
dps:
84+
- https://quantecon.github.io/lecture-dps/
85+
- null
86+
eqm:
87+
- https://quantecon.github.io/lecture-eqm/
88+
- null
89+
stats:
90+
- https://quantecon.github.io/lecture-stats/
91+
- null
92+
tools:
93+
- https://quantecon.github.io/lecture-tools-techniques/
94+
- null
95+
dynam:
96+
- https://quantecon.github.io/lecture-dynamics/
97+
- null
98+
mathjax3_config:
99+
tex:
100+
macros:
101+
"argmax" : "arg\\,max"
102+
"argmin" : "arg\\,min"
103+
mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
104+
rediraffe_redirects:
105+
index_toc.md: intro.md
106+
tojupyter_static_file_path: ["_static"]
107+
tojupyter_target_html: true
108+
tojupyter_urlpath: "https://intro.quantecon.org/" #TODO: update
109+
tojupyter_image_urlpath: "https://intro.quantecon.org/_static/" #TODO: update
110+
tojupyter_lang_synonyms: ["ipython", "ipython3", "python"]
111+
tojupyter_kernels:
112+
python3:
113+
kernelspec:
114+
display_name: "Python"
115+
language: python3
116+
name: python3
117+
file_extension: ".py"
118+
tojupyter_images_markdown: true
161 KB
Loading
1.8 KB
Loading
1.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)