Skip to content

Commit dfbe8e8

Browse files
authored
Merge branch 'main' into Mys94's-translation-1
2 parents 4c52c91 + ab7f62f commit dfbe8e8

32 files changed

+421
-323
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Cache [using jupyter-book] for Windows
2+
on:
3+
schedule:
4+
# Execute cache weekly at 3am on Monday
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch: # Allows manual trigger if required
7+
8+
jobs:
9+
cache:
10+
runs-on: windows-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Setup Anaconda
15+
uses: conda-incubator/setup-miniconda@v3
16+
with:
17+
auto-update-conda: true
18+
auto-activate-base: true
19+
miniconda-version: 'latest'
20+
python-version: "3.12"
21+
environment-file: environment.yml
22+
activate-environment: quantecon
23+
- name: Build HTML
24+
shell: bash -l {0}
25+
run: |
26+
jb build lectures --path-output ./ -W --keep-going
27+
- name: Upload Execution Reports (HTML)
28+
uses: actions/upload-artifact@v4
29+
if: failure()
30+
with:
31+
name: execution-reports
32+
path: _build/html/reports
33+
- name: Upload "_build" folder (cache)
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: build-cache-windows
37+
path: _build
38+
include-hidden-files: true

.github/workflows/cache.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build Cache [using jupyter-book]
22
on:
3-
push:
4-
branches:
5-
- main
3+
schedule:
4+
# Execute cache weekly at 3am on Monday
5+
- cron: '0 3 * * 1'
66
jobs:
77
tests:
88
runs-on: ubuntu-latest

.github/workflows/ci-cn.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
shell: bash -l {0}
3939
run: pip list
4040
- name: Download "build" folder (cache)
41-
uses: dawidd6/action-download-artifact@v7
41+
uses: dawidd6/action-download-artifact@v8
4242
with:
4343
workflow: cache.yml
4444
branch: main

.github/workflows/ci-windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ jobs:
1515
python-version: "3.12"
1616
environment-file: environment.yml
1717
activate-environment: quantecon
18+
- name: Download "build" folder (cache)
19+
uses: dawidd6/action-download-artifact@v7
20+
with:
21+
workflow: cache-windows.yml
22+
branch: main
23+
name: build-cache-windows
24+
path: _build
1825
- name: Display Conda Environment Versions
1926
shell: bash -l {0}
2027
run: conda list

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
shell: bash -l {0}
3939
run: pip list
4040
- name: Download "build" folder (cache)
41-
uses: dawidd6/action-download-artifact@v7
41+
uses: dawidd6/action-download-artifact@v8
4242
with:
4343
workflow: cache.yml
4444
branch: main
@@ -57,12 +57,12 @@ jobs:
5757
# with:
5858
# name: execution-reports
5959
# 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
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
6666
# Build HTML (Website)
6767
# BUG: rm .doctress to remove `sphinx` rendering issues for ipywidget mimetypes
6868
# and clear the sphinx cache for building final HTML documents.

.github/workflows/collab.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
shell: bash -l {0}
2121
run: pip list
2222
- name: Download "build" folder (cache)
23-
uses: dawidd6/action-download-artifact@v7
23+
uses: dawidd6/action-download-artifact@v8
2424
with:
2525
workflow: cache.yml
2626
branch: main

.github/workflows/linkcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
environment-file: environment.yml
2828
activate-environment: quantecon
2929
- name: Download "build" folder (cache)
30-
uses: dawidd6/action-download-artifact@v7
30+
uses: dawidd6/action-download-artifact@v8
3131
with:
3232
workflow: cache.yml
3333
branch: main

.github/workflows/publish.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
shell: bash -l {0}
4040
run: pip list
4141
- name: Download "build" folder (cache)
42-
uses: dawidd6/action-download-artifact@v7
42+
uses: dawidd6/action-download-artifact@v8
4343
with:
4444
workflow: cache.yml
4545
branch: main
@@ -55,15 +55,15 @@ jobs:
5555
# run: |
5656
# mkdir -p _build/html/_pdf
5757
# cp -u _build/latex/*.pdf _build/html/_pdf
58-
# - name: Build Download Notebooks (sphinx-tojupyter)
59-
# shell: bash -l {0}
60-
# run: |
61-
# jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
62-
# - name: Copy Download Notebooks for GH-PAGES
63-
# shell: bash -l {0}
64-
# run: |
65-
# mkdir -p _build/html/_notebooks
66-
# cp -u _build/jupyter/*.ipynb _build/html/_notebooks
58+
- name: Build Download Notebooks (sphinx-tojupyter)
59+
shell: bash -l {0}
60+
run: |
61+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
62+
- name: Copy Download Notebooks for GH-PAGES
63+
shell: bash -l {0}
64+
run: |
65+
mkdir -p _build/html/_notebooks
66+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
6767
# Build HTML (Website)
6868
# BUG: rm .doctress to remove `sphinx` rendering issues for ipywidget mimetypes
6969
# and clear the sphinx cache for building final HTML documents.

lectures/_config.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ sphinx:
3939
config:
4040
bibtex_reference_style: author_year
4141
# false-positive links
42-
linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116', 'https://unctad.org/publication/commodities-and-development-report-2019',
43-
'https://math.stackexchange.com/*', 'https://stackoverflow.com/*']
42+
linkcheck_ignore: [
43+
'https://doi.org/https://doi.org/10.2307/1235116',
44+
'https://unctad.org/publication/commodities-and-development-report-2019',
45+
'https://math.stackexchange.com/*', 'https://stackoverflow.com/*', 'https://baike.baidu.com/*']
4446
# myst-nb config
4547
nb_render_image_options:
4648
width: 80%
@@ -126,4 +128,9 @@ sphinx:
126128
language: python3
127129
name: python3
128130
file_extension: ".py"
129-
tojupyter_images_markdown: true
131+
tojupyter_images_markdown: true
132+
nb_mime_priority_overrides: [
133+
# Link Checker
134+
['linkcheck', 'text/plain', 10],
135+
['linkcheck', 'text/html', 20],
136+
]

lectures/ar1_processes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ for t in range(sim_length):
173173
mu = a * mu + b
174174
v = a**2 * v + c**2
175175
ax.plot(grid, norm.pdf(grid, loc=mu, scale=np.sqrt(v)),
176-
label=f"$\psi_{t}$",
176+
label=fr"$\psi_{t}$",
177177
alpha=0.7)
178178
179179
ax.legend(bbox_to_anchor=[1.05,1],loc=2,borderaxespad=1)
@@ -255,7 +255,7 @@ plot_density_seq(ax, mu_0=4.0)
255255
mu_star = b / (1 - a)
256256
std_star = np.sqrt(c**2 / (1 - a**2)) # v_star的平方根
257257
psi_star = norm.pdf(grid, loc=mu_star, scale=std_star)
258-
ax.plot(grid, psi_star, 'k-', lw=2, label="$\psi^*$")
258+
ax.plot(grid, psi_star, 'k-', lw=2, label=r"$\psi^*$")
259259
ax.legend()
260260
261261
plt.show()

0 commit comments

Comments
 (0)