diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7809c2a9..04804108 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,16 @@ updates: prefix: ⬆️ schedule: interval: weekly + + - package-ecosystem: "conda" + directory: "/" + commit-message: + prefix: ⬆️ + schedule: + interval: weekly + ignore: + - dependency-name: "jupyter-book" + versions: [">=2.0"] + - dependency-name: "python" + # Python version should be constrained by the anaconda distribution version + versions: [">0"] diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 16fffa11..3f11f73e 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -39,7 +39,7 @@ jobs: - name: Build HTML shell: bash -l {0} run: | - jb build lectures --path-output ./ --keep-going + jb build lectures --path-output ./ -n -W --keep-going - name: Upload Execution Reports (HTML) uses: actions/upload-artifact@v4 if: failure() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36ddb70b..6eb3afb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: branch: main name: build-cache path: _build - # # Build Assets (Download Notebooks and PDF via LaTeX) + # Build Assets (Download Notebooks and PDF via LaTeX) # - name: Build PDF from LaTeX # shell: bash -l {0} # run: | @@ -71,7 +71,7 @@ jobs: - name: Build HTML shell: bash -l {0} run: | - jb build lectures --path-output ./ --keep-going + jb build lectures --path-output ./ -n -W --keep-going - name: Upload Execution Reports (HTML) uses: actions/upload-artifact@v4 if: failure() diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index da3099b5..6cc67b98 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,7 +71,7 @@ jobs: - name: Build HTML shell: bash -l {0} run: | - jb build lectures --path-output ./ + jb build lectures --path-output ./ -n -W --keep-going # Create HTML archive for release assets - name: Create HTML archive shell: bash -l {0} diff --git a/environment.yml b/environment.yml index 8d36c88d..a09e637e 100644 --- a/environment.yml +++ b/environment.yml @@ -3,11 +3,11 @@ channels: - default dependencies: - python=3.13 - - anaconda=2025.06 + - anaconda=2025.12 - pip - pip: - - jupyter-book==1.0.4post1 - - quantecon-book-theme==0.10.1 + - jupyter-book>=1.0.4post1,<2.0 + - quantecon-book-theme==0.15.1 - sphinx-tojupyter==0.3.1 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==1.2.0 diff --git a/lectures/_config.yml b/lectures/_config.yml index b6ef10e8..6a90ffe7 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -38,6 +38,7 @@ sphinx: # false-positive links linkcheck_ignore: ['https://online.stat.psu.edu/stat415/book/export/html/834'] bibtex_reference_style: author_year + nb_merge_streams: true nb_mime_priority_overrides: [ # HTML ['html', 'application/vnd.jupyter.widget-view+json', 10], @@ -82,6 +83,7 @@ sphinx: header_organisation: QuantEcon repository_url: https://github.com/QuantEcon/lecture-python.myst nb_repository_url: https://github.com/QuantEcon/lecture-python.zh-cn.notebooks + path_to_docs: lectures twitter: quantecon twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png diff --git a/lectures/_static/lecture_specific/optgrowth_fast/ogm.py b/lectures/_static/lecture_specific/optgrowth_fast/ogm.py index ef28a9ec..900802b9 100644 --- a/lectures/_static/lecture_specific/optgrowth_fast/ogm.py +++ b/lectures/_static/lecture_specific/optgrowth_fast/ogm.py @@ -34,7 +34,7 @@ def __init__(self, def f(self, k): - "生产函数" + "生产函数" return k**self.α diff --git a/lectures/back_prop.md b/lectures/back_prop.md index b3074dd8..3356fb57 100644 --- a/lectures/back_prop.md +++ b/lectures/back_prop.md @@ -533,8 +533,8 @@ Image(fig.to_image(format="png")) ```{code-cell} ipython3 ## 检查环境中是否启用了gpu -from jax.lib import xla_bridge -print(xla_bridge.get_backend().platform) +import jax.extend +print(jax.extend.backend.get_backend().platform) ``` ```{note} diff --git a/lectures/bayes_nonconj.md b/lectures/bayes_nonconj.md index 14f1f286..65407519 100644 --- a/lectures/bayes_nonconj.md +++ b/lectures/bayes_nonconj.md @@ -46,6 +46,7 @@ kernelspec: # install dependencies !pip install numpyro pyro-ppl torch jax ``` + ```{code-cell} ipython3 import numpy as np import seaborn as sns diff --git a/lectures/house_auction.md b/lectures/house_auction.md index 4205645f..c31933b9 100644 --- a/lectures/house_auction.md +++ b/lectures/house_auction.md @@ -537,7 +537,7 @@ def submit_bid(loser_list, p, ϵ, v, bid_info): ``` ```{code-cell} ipython3 -p,bid_info = submit_bid(失败者列表, p, ϵ, v, bid_info) +p,bid_info = submit_bid(loser_list, p, ϵ, v, bid_info) ``` ```{code-cell} ipython3 diff --git a/lectures/imp_sample.md b/lectures/imp_sample.md index 70b79a85..0a985d41 100644 --- a/lectures/imp_sample.md +++ b/lectures/imp_sample.md @@ -33,6 +33,7 @@ kernelspec: import numpy as np from numba import jit, vectorize, prange import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/likelihood_bayes.md b/lectures/likelihood_bayes.md index fd8007b2..eb3410c2 100644 --- a/lectures/likelihood_bayes.md +++ b/lectures/likelihood_bayes.md @@ -47,6 +47,8 @@ kernelspec: ```{code-cell} ipython3 :hide-output: false +import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/likelihood_ratio_process.md b/lectures/likelihood_ratio_process.md index c3f3f3bb..01347bfd 100644 --- a/lectures/likelihood_ratio_process.md +++ b/lectures/likelihood_ratio_process.md @@ -52,6 +52,7 @@ kernelspec: ```{code-cell} ipython3 import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/likelihood_ratio_process_2.md b/lectures/likelihood_ratio_process_2.md index 872a93ed..777dbf37 100644 --- a/lectures/likelihood_ratio_process_2.md +++ b/lectures/likelihood_ratio_process_2.md @@ -55,6 +55,7 @@ Blume和Easley构建了正式模型,研究关于风险收入过程概率的不 ```{code-cell} ipython3 import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/likelihood_var.md b/lectures/likelihood_var.md index 5550aa63..c7449a20 100644 --- a/lectures/likelihood_var.md +++ b/lectures/likelihood_var.md @@ -47,6 +47,7 @@ kernelspec: ```{code-cell} ipython3 import numpy as np import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/mix_model.md b/lectures/mix_model.md index feeb623e..76c7ad27 100644 --- a/lectures/mix_model.md +++ b/lectures/mix_model.md @@ -116,6 +116,7 @@ $$ :hide-output: false import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC'] diff --git a/lectures/wald_friedman_2.md b/lectures/wald_friedman_2.md index 067f8066..46dd51df 100644 --- a/lectures/wald_friedman_2.md +++ b/lectures/wald_friedman_2.md @@ -88,6 +88,7 @@ kernelspec: ```{code-cell} ipython3 import numpy as np import matplotlib.pyplot as plt +import matplotlib as mpl FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf" mpl.font_manager.fontManager.addfont(FONTPATH) plt.rcParams['font.family'] = ['Source Han Serif SC']