Skip to content

Commit ab84beb

Browse files
authored
Merge branch 'main' into ak_aiyagari_patch
2 parents 09d9208 + 977a93e commit ab84beb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7708
-4124
lines changed

.github/runs-on.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ images:
22
quantecon_ubuntu2404:
33
platform: "linux"
44
arch: "x64"
5-
ami: "ami-09baf66e396fa7cfd"
5+
ami: "ami-0edec81935264b6d3"
6+
region: "us-west-2"

.github/workflows/cache.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ jobs:
2020
python-version: "3.13"
2121
environment-file: environment.yml
2222
activate-environment: quantecon
23-
- name: Install JAX, Numpyro, PyTorch
23+
- name: Install JAX and Numpyro
2424
shell: bash -l {0}
2525
run: |
26-
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
27-
pip install --upgrade "jax[cuda12-local]==0.6.2"
28-
pip install numpyro
26+
pip install -U "jax[cuda13]"
27+
pip install numpyro
2928
python scripts/test-jax-install.py
3029
- name: Check nvidia drivers
3130
shell: bash -l {0}
@@ -36,13 +35,13 @@ jobs:
3635
run: |
3736
jb build lectures --path-output ./ -W --keep-going
3837
- name: Upload Execution Reports
39-
uses: actions/upload-artifact@v4
38+
uses: actions/upload-artifact@v5
4039
if: failure()
4140
with:
4241
name: execution-reports
4342
path: _build/html/reports
4443
- name: Upload "_build" folder (cache)
45-
uses: actions/upload-artifact@v4
44+
uses: actions/upload-artifact@v5
4645
with:
4746
name: build-cache
4847
path: _build

.github/workflows/ci.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
jobs:
1212
preview:
1313
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
14+
env:
15+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
16+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
1417
steps:
1518
- uses: actions/checkout@v5
1619
with:
@@ -25,17 +28,15 @@ jobs:
2528
python-version: "3.13"
2629
environment-file: environment.yml
2730
activate-environment: quantecon
28-
- name: Install JAX, Numpyro, PyTorch
29-
shell: bash -l {0}
30-
run: |
31-
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
32-
pip install pyro-ppl
33-
pip install --upgrade "jax[cuda12-local]==0.6.2"
34-
pip install numpyro pyro-ppl
35-
python scripts/test-jax-install.py
3631
- name: Check nvidia Drivers
3732
shell: bash -l {0}
3833
run: nvidia-smi
34+
- name: Install JAX and Numpyro
35+
shell: bash -l {0}
36+
run: |
37+
pip install -U "jax[cuda13]"
38+
pip install numpyro
39+
python scripts/test-jax-install.py
3940
- name: Display Conda Environment Versions
4041
shell: bash -l {0}
4142
run: conda list
@@ -57,7 +58,7 @@ jobs:
5758
mkdir -p _build/html/_notebooks
5859
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
5960
- name: Upload Execution Reports (Download Notebooks)
60-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v5
6162
if: failure()
6263
with:
6364
name: execution-reports-notebooks
@@ -69,7 +70,7 @@ jobs:
6970
mkdir -p _build/html/_pdf
7071
cp -u _build/latex/*.pdf _build/html/_pdf
7172
- name: Upload Execution Reports (LaTeX)
72-
uses: actions/upload-artifact@v4
73+
uses: actions/upload-artifact@v5
7374
if: failure()
7475
with:
7576
name: execution-reports
@@ -80,7 +81,7 @@ jobs:
8081
run: |
8182
jb build lectures --path-output ./ -n -W --keep-going
8283
- name: Upload Execution Reports (HTML)
83-
uses: actions/upload-artifact@v4
84+
uses: actions/upload-artifact@v5
8485
if: failure()
8586
with:
8687
name: execution-reports
@@ -168,6 +169,11 @@ jobs:
168169
fi
169170
- name: Preview Deploy to Netlify
170171
id: netlify-deploy
172+
if: >
173+
github.actor != 'dependabot[bot]' &&
174+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
175+
env.NETLIFY_AUTH_TOKEN != '' &&
176+
env.NETLIFY_SITE_ID != ''
171177
shell: bash -l {0}
172178
run: |
173179
if [ "${{ github.event_name }}" = "pull_request" ]; then
@@ -238,11 +244,16 @@ jobs:
238244
echo "🎯 Preview page: ${deploy_url}/${{ github.event.inputs.preview_page }}"
239245
fi
240246
fi
241-
env:
242-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
243-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
247+
- name: Skip Netlify Deploy (no secrets or untrusted actor)
248+
if: >
249+
!(github.actor != 'dependabot[bot]' &&
250+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
251+
env.NETLIFY_AUTH_TOKEN != '' &&
252+
env.NETLIFY_SITE_ID != '')
253+
run: |
254+
echo "Skipping Netlify preview deploy: secrets unavailable or actor not trusted (actor=${{ github.actor }})"
244255
- name: Post PR Comment with Preview Links
245-
if: github.event_name == 'pull_request'
256+
if: github.event_name == 'pull_request' && steps.netlify-deploy.outputs.deploy_url != ''
246257
uses: actions/github-script@v7
247258
with:
248259
script: |

.github/workflows/collab.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
jb build lectures --path-output ./ -n -W --keep-going
4747
- name: Upload Execution Reports
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@v5
4949
if: failure()
5050
with:
5151
name: execution-reports
@@ -85,7 +85,7 @@ jobs:
8585
EOF
8686
- name: Create Issue on Execution Failure
8787
if: failure()
88-
uses: peter-evans/create-issue-from-file@v5
88+
uses: peter-evans/create-issue-from-file@v6
8989
with:
9090
title: "Weekly Colab Execution Check Failed - ${{ github.run_id }}"
9191
content-filepath: execution-failure-report.md

.github/workflows/linkcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
args: --accept 200,403,503 *.html
2525
- name: Create Issue From File
2626
if: steps.lychee.outputs.exit_code != 0
27-
uses: peter-evans/create-issue-from-file@v5
27+
uses: peter-evans/create-issue-from-file@v6
2828
with:
2929
title: Link Checker Report
3030
content-filepath: ./lychee/out.md

.github/workflows/publish.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ jobs:
1919
python-version: "3.13"
2020
environment-file: environment.yml
2121
activate-environment: quantecon
22-
- name: Install JAX, Numpyro, PyTorch
22+
- name: Install JAX and Numpyro
2323
shell: bash -l {0}
2424
run: |
25-
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
26-
pip install --upgrade "jax[cuda12-local]==0.6.2"
27-
pip install numpyro
25+
pip install -U "jax[cuda13]"
26+
pip install numpyro
2827
python scripts/test-jax-install.py
2928
- name: Check nvidia drivers
3029
shell: bash -l {0}
@@ -59,7 +58,7 @@ jobs:
5958
run: |
6059
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
6160
zip -r download-notebooks.zip _build/jupyter
62-
- uses: actions/upload-artifact@v4
61+
- uses: actions/upload-artifact@v5
6362
with:
6463
name: download-notebooks
6564
path: download-notebooks.zip
@@ -73,6 +72,32 @@ jobs:
7372
shell: bash -l {0}
7473
run: |
7574
jb build lectures --path-output ./ -n -W --keep-going
75+
# Create HTML archive for release assets
76+
- name: Create HTML archive
77+
shell: bash -l {0}
78+
run: |
79+
tar -czf lecture-python-html-${{ github.ref_name }}.tar.gz -C _build/html .
80+
sha256sum lecture-python-html-${{ github.ref_name }}.tar.gz > html-checksum.txt
81+
82+
# Create metadata manifest
83+
cat > html-manifest.json << EOF
84+
{
85+
"tag": "${{ github.ref_name }}",
86+
"commit": "${{ github.sha }}",
87+
"timestamp": "$(date -Iseconds)",
88+
"size_mb": $(du -sm _build/html | cut -f1),
89+
"file_count": $(find _build/html -type f | wc -l)
90+
}
91+
EOF
92+
- name: Upload archives to release
93+
uses: softprops/action-gh-release@v2
94+
with:
95+
files: |
96+
lecture-python-html-${{ github.ref_name }}.tar.gz
97+
html-checksum.txt
98+
html-manifest.json
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76101
- name: Deploy website to gh-pages
77102
uses: peaceiris/actions-gh-pages@v4
78103
with:

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ dependencies:
77
- pip
88
- pip:
99
- jupyter-book==1.0.4post1
10-
- quantecon-book-theme==0.9.0
11-
- sphinx-tojupyter==0.3.1
10+
- quantecon-book-theme==0.10.1
11+
- sphinx-tojupyter==0.4.0
1212
- sphinxext-rediraffe==0.2.7
13-
- sphinx-exercise==1.0.1
13+
- sphinx-exercise==1.2.0
1414
- sphinx-proof==0.2.1
1515
- sphinxcontrib-youtube==1.4.1
1616
- sphinx-togglebutton==0.3.2

lectures/_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ sphinx:
120120
schelling: https://intro.quantecon.org/schelling.html
121121
scalar_dynam: https://intro.quantecon.org/scalar_dynam.html
122122
complex_and_trig: https://intro.quantecon.org/complex_and_trig.html
123+
# sphinx-proof
124+
proof_minimal_theme: true
125+
# sphinx-exercise
126+
exercise_style: "solution_follow_exercise"
127+
# sphinx-tojupyter
123128
tojupyter_static_file_path: ["source/_static", "_static"]
124129
tojupyter_target_html: true
125130
tojupyter_urlpath: "https://python.quantecon.org/"

lectures/_static/lecture_specific/cake_eating_numerical/analytical.py

Lines changed: 0 additions & 9 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)