Skip to content

Commit b5f500d

Browse files
authored
Merge branch 'main' into translation-sync-2026-04-10T19-33-03-pr-521
2 parents 69b1c59 + 1e8dde1 commit b5f500d

31 files changed

+1065
-108
lines changed

.github/workflows/cache.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Cache [using jupyter-book]
2+
on:
3+
schedule:
4+
# Execute cache weekly at 3am on Monday
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
cache:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup Anaconda
14+
uses: conda-incubator/setup-miniconda@v3
15+
with:
16+
auto-update-conda: true
17+
auto-activate-base: true
18+
miniconda-version: 'latest'
19+
python-version: "3.13"
20+
environment-file: environment.yml
21+
activate-environment: quantecon
22+
- name: Install JAX (CPU)
23+
shell: bash -l {0}
24+
run: |
25+
pip install jax
26+
- name: Display Conda Environment Versions
27+
shell: bash -l {0}
28+
run: conda list
29+
- name: Display Pip Versions
30+
shell: bash -l {0}
31+
run: pip list
32+
- name: Build HTML
33+
shell: bash -l {0}
34+
run: |
35+
jb build lectures --path-output ./ -W --keep-going
36+
- name: Upload Execution Reports
37+
uses: actions/upload-artifact@v4
38+
if: failure()
39+
with:
40+
name: execution-reports
41+
path: _build/html/reports
42+
- name: Upload "_build" folder (cache)
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: build-cache
46+
path: _build
47+
include-hidden-files: true

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build Project [using jupyter-book]
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
actions: read
7+
8+
jobs:
9+
preview:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup Anaconda
14+
uses: conda-incubator/setup-miniconda@v3
15+
with:
16+
auto-update-conda: true
17+
auto-activate-base: true
18+
miniconda-version: 'latest'
19+
python-version: "3.13"
20+
environment-file: environment.yml
21+
activate-environment: quantecon
22+
- name: Install JAX (CPU)
23+
shell: bash -l {0}
24+
run: |
25+
pip install jax
26+
- name: Display Conda Environment Versions
27+
shell: bash -l {0}
28+
run: conda list
29+
- name: Display Pip Versions
30+
shell: bash -l {0}
31+
run: pip list
32+
- name: Download "build" folder (cache)
33+
uses: dawidd6/action-download-artifact@v6
34+
with:
35+
workflow: cache.yml
36+
branch: main
37+
name: build-cache
38+
path: _build
39+
# Build Assets (Download Notebooks)
40+
- name: Build Download Notebooks (sphinx-tojupyter)
41+
shell: bash -l {0}
42+
run: |
43+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
44+
mkdir -p _build/html/_notebooks
45+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
46+
# Final Build of HTML
47+
- name: Build HTML
48+
shell: bash -l {0}
49+
run: |
50+
jb build lectures --path-output ./ -n -W --keep-going
51+
- name: Upload Execution Reports
52+
uses: actions/upload-artifact@v4
53+
if: failure()
54+
with:
55+
name: execution-reports
56+
path: _build/html/reports

.github/workflows/publish.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build & Publish to GH Pages
2+
on:
3+
push:
4+
tags:
5+
- 'publish*'
6+
7+
permissions:
8+
contents: read
9+
actions: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
publish:
19+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
20+
runs-on: ubuntu-latest
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Setup Anaconda
28+
uses: conda-incubator/setup-miniconda@v3
29+
with:
30+
auto-update-conda: true
31+
auto-activate-base: true
32+
miniconda-version: 'latest'
33+
python-version: "3.13"
34+
environment-file: environment.yml
35+
activate-environment: quantecon
36+
- name: Install JAX (CPU)
37+
shell: bash -l {0}
38+
run: |
39+
pip install jax
40+
- name: Display Conda Environment Versions
41+
shell: bash -l {0}
42+
run: conda list
43+
- name: Display Pip Versions
44+
shell: bash -l {0}
45+
run: pip list
46+
# Download Build Cache from cache.yml
47+
- name: Download "build" folder (cache)
48+
uses: dawidd6/action-download-artifact@v6
49+
with:
50+
workflow: cache.yml
51+
branch: main
52+
name: build-cache
53+
path: _build
54+
# Build Assets (Download Notebooks)
55+
- name: Build Download Notebooks (sphinx-tojupyter)
56+
shell: bash -l {0}
57+
run: |
58+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
59+
mkdir -p _build/html/_notebooks
60+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
61+
# Final Build of HTML (with assets)
62+
- name: Build HTML
63+
shell: bash -l {0}
64+
run: |
65+
jb build lectures --path-output ./ -n -W --keep-going
66+
- name: Upload Execution Reports
67+
uses: actions/upload-artifact@v4
68+
if: failure()
69+
with:
70+
name: execution-reports
71+
path: _build/html/reports
72+
- name: Setup Pages
73+
uses: actions/configure-pages@v4
74+
- name: Upload Pages artifact
75+
uses: actions/upload-pages-artifact@v3
76+
with:
77+
path: _build/html/
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v4

.translate/state/autodiff.md.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source-sha: 05ce95691fd97e48da39dd6d58fe032c03e8813d
2+
synced-at: "2026-04-09"
3+
model: claude-sonnet-4-6
4+
mode: NEW
5+
section-count: 5
6+
tool-version: 0.14.1

.translate/state/jax_intro.md.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: c4c03c80c1eb4318f627d869707d242d19c8cf09
2-
synced-at: "2026-03-20"
1+
source-sha: 05ce95691fd97e48da39dd6d58fe032c03e8813d
2+
synced-at: "2026-04-09"
33
model: claude-sonnet-4-6
4-
mode: NEW
5-
section-count: 6
6-
tool-version: 0.13.0
4+
mode: UPDATE
5+
section-count: 7
6+
tool-version: 0.14.1
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: c4c03c80c1eb4318f627d869707d242d19c8cf09
2-
synced-at: "2026-03-20"
1+
source-sha: 05ce95691fd97e48da39dd6d58fe032c03e8813d
2+
synced-at: "2026-04-09"
33
model: claude-sonnet-4-6
4-
mode: NEW
5-
section-count: 2
6-
tool-version: 0.13.0
4+
mode: UPDATE
5+
section-count: 3
6+
tool-version: 0.14.1

.translate/state/pandas.md.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: 9490497982787a5b0eb54ee1dcd73ac326d5ae04
2-
synced-at: "2026-03-20"
1+
source-sha: 02e57a5befc2a9a081019edc748aba15e4b2f02a
2+
synced-at: "2026-04-09"
33
model: claude-sonnet-4-6
4-
mode: NEW
4+
mode: UPDATE
55
section-count: 5
6-
tool-version: 0.13.1
6+
tool-version: 0.14.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: f791129259d11c138d7662c88f994c9d5ebaa875
2-
synced-at: "2026-03-25"
1+
source-sha: 02e57a5befc2a9a081019edc748aba15e4b2f02a
2+
synced-at: "2026-04-09"
33
model: claude-sonnet-4-6
44
mode: UPDATE
55
section-count: 7
6-
tool-version: 0.13.0
6+
tool-version: 0.14.0

environment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: quantecon
2+
channels:
3+
- defaults
4+
dependencies:
5+
- python=3.13
6+
- anaconda=2025.12
7+
- pip
8+
- pip:
9+
- jupyter-book>=1.0.4post1,<2.0
10+
- quantecon-book-theme==0.20.0
11+
- sphinx-tojupyter==0.6.0
12+
- sphinxext-rediraffe==0.3.0
13+
- sphinx-exercise==1.2.1
14+
- sphinx-togglebutton==0.4.5

lectures/_admonition/gpu.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```{admonition} GPU
2+
:class: warning
3+
4+
本讲座使用了配备 GPU 的机器进行构建——但没有 GPU 也可以运行。
5+
6+
[Google Colab](https://colab.research.google.com/) 提供了免费的 GPU 访问,
7+
您可以按照以下步骤使用:
8+
9+
1. 点击右上角的"play"图标
10+
2. 选择 Colab
11+
3. 将运行时环境设置为包含 GPU
12+
```

0 commit comments

Comments
 (0)