Skip to content

Commit db62783

Browse files
committed
Merge branch 'main' into add_cross_section
2 parents d21a8ab + a0fa02f commit db62783

Some content is hidden

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

45 files changed

+8255
-2556
lines changed

.github/workflows/cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
auto-update-conda: true
1616
auto-activate-base: true
1717
miniconda-version: 'latest'
18-
python-version: 3.9
18+
python-version: "3.10"
1919
environment-file: environment.yml
2020
activate-environment: quantecon
2121
# - name: Install latex dependencies

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build HTML [using jupyter-book]
2-
on: [push]
2+
on: [pull_request]
33
jobs:
4-
tests:
4+
preview:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout
@@ -12,7 +12,7 @@ jobs:
1212
auto-update-conda: true
1313
auto-activate-base: true
1414
miniconda-version: 'latest'
15-
python-version: 3.9
15+
python-version: "3.10"
1616
environment-file: environment.yml
1717
activate-environment: quantecon
1818
- name: Graphics Support
@@ -37,34 +37,34 @@ jobs:
3737
- name: Display Pip Versions
3838
shell: bash -l {0}
3939
run: pip list
40-
# - name: Download "build" folder (cache)
41-
# uses: dawidd6/action-download-artifact@v2
42-
# with:
43-
# workflow: cache.yml
44-
# branch: main
45-
# name: build-cache
46-
# path: _build
40+
- name: Download "build" folder (cache)
41+
uses: dawidd6/action-download-artifact@v2
42+
with:
43+
workflow: cache.yml
44+
branch: main
45+
name: build-cache
46+
path: _build
4747
# Build Assets (Download Notebooks and PDF via LaTeX)
4848
# - name: Build PDF from LaTeX
4949
# shell: bash -l {0}
5050
# run: |
5151
# jb build lectures --builder pdflatex --path-output ./ -n --keep-going
5252
# mkdir -p _build/html/_pdf
5353
# cp -u _build/latex/*.pdf _build/html/_pdf
54-
# - name: Build Download Notebooks (sphinx-tojupyter)
55-
# shell: bash -l {0}
56-
# run: |
57-
# jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
58-
# mkdir -p _build/html/_notebooks
59-
# cp -u _build/jupyter/*.ipynb _build/html/_notebooks
54+
- name: Build Download Notebooks (sphinx-tojupyter)
55+
shell: bash -l {0}
56+
run: |
57+
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter
58+
mkdir -p _build/html/_notebooks
59+
cp -u _build/jupyter/*.ipynb _build/html/_notebooks
6060
# Build HTML (Website)
6161
# BUG: rm .doctress to remove `sphinx` rendering issues for ipywidget mimetypes
6262
# and clear the sphinx cache for building final HTML documents.
6363
- name: Build HTML
6464
shell: bash -l {0}
6565
run: |
66-
# rm -r _build/.doctrees
67-
jb build lectures --path-output ./ -W --keep-going
66+
rm -r _build/.doctrees
67+
jb build lectures --path-output ./ -nW --keep-going
6868
- name: Upload Execution Reports (HTML)
6969
uses: actions/upload-artifact@v2
7070
if: failure()

.github/workflows/publish.yml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
auto-update-conda: true
1717
auto-activate-base: true
1818
miniconda-version: 'latest'
19-
python-version: 3.9
19+
python-version: "3.10"
2020
environment-file: environment.yml
2121
activate-environment: quantecon
2222
# - name: Install latex dependencies
@@ -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.
@@ -82,32 +82,33 @@ jobs:
8282
env:
8383
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
8484
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
85-
# - name: Deploy website to gh-pages
86-
# uses: peaceiris/actions-gh-pages@v3
87-
# with:
88-
# github_token: ${{ secrets.GITHUB_TOKEN }}
89-
# publish_dir: _build/html/
85+
- name: Deploy website to gh-pages
86+
uses: peaceiris/actions-gh-pages@v3
87+
with:
88+
github_token: ${{ secrets.GITHUB_TOKEN }}
89+
publish_dir: _build/html/
9090
# cname: intro.quantecon.org
9191
- name: Upload "_build" folder (cache)
9292
uses: actions/upload-artifact@v2
9393
with:
9494
name: build-publish
9595
path: _build
96-
# - name: Prepare lecture-python-intro.notebooks sync
97-
# shell: bash -l {0}
98-
# run: |
99-
# mkdir -p _build/lecture-python-intro.notebooks
100-
# cp -a _notebook_repo/. _build/lecture-python-intro.notebooks
101-
# cp _build/jupyter/*.ipynb _build/lecture-python-intro.notebooks
102-
# ls -a _build/lecture-python-intro.notebooks
103-
# - name: Commit latest notebooks to lecture-python-intro.notebooks
104-
# uses: cpina/github-action-push-to-another-repository@master
105-
# env:
106-
# API_TOKEN_GITHUB: ${{ secrets.QUANTECON_SERVICES_PAT }}
107-
# with:
108-
# source-directory: '_build/lecture-python-intro.notebooks/'
109-
# destination-repository-username: 'QuantEcon'
110-
# destination-repository-name: 'lecture-python-intro.notebooks'
111-
# commit-message: 'auto publishing updates to notebooks'
112-
# destination-github-username: 'quantecon-services'
113-
# user-email: services@quantecon.org
96+
# Sync notebooks
97+
- name: Prepare lecture-python-intro.notebooks sync
98+
shell: bash -l {0}
99+
run: |
100+
mkdir -p _build/lecture-python-intro.notebooks
101+
cp -a _notebook_repo/. _build/lecture-python-intro.notebooks
102+
cp _build/jupyter/*.ipynb _build/lecture-python-intro.notebooks
103+
ls -a _build/lecture-python-intro.notebooks
104+
- name: Commit latest notebooks to lecture-python-intro.notebooks
105+
uses: cpina/github-action-push-to-another-repository@main
106+
env:
107+
API_TOKEN_GITHUB: ${{ secrets.QUANTECON_SERVICES_PAT }}
108+
with:
109+
source-directory: '_build/lecture-python-intro.notebooks/'
110+
destination-repository-username: 'QuantEcon'
111+
destination-repository-name: 'lecture-python-intro.notebooks'
112+
commit-message: 'auto publishing updates to notebooks'
113+
destination-github-username: 'quantecon-services'
114+
user-email: services@quantecon.org

_notebook_repo/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# lecture-python-intro.notebooks
2+
3+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuantEcon/lecture-python-intro.notebooks/master)
4+
5+
<!-- Notebooks for https://python-intro.quantecon.org -->
6+
7+
**Note:** This README should be edited [here](https://github.com/quantecon/lecture-python-intro/_notebook_repo)

_notebook_repo/environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: lecture-python-intro
2+
channels:
3+
- default
4+
dependencies:
5+
- python=3.10
6+
- anaconda=2023.03
7+

environment.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@ name: quantecon
22
channels:
33
- default
44
dependencies:
5-
- python=3.9
6-
- anaconda=2022.10
5+
- python=3.10
6+
- anaconda=2023.03
77
- pip
88
- pip:
9-
- jupyter-book==0.14.0
10-
# - quantecon-book-theme==0.3.2
11-
# - sphinx-tojupyter==0.2.1
9+
- jupyter-book==0.15.1
10+
- docutils==0.17.1
11+
- quantecon-book-theme==0.4.1
12+
- sphinx-tojupyter==0.3.0
1213
- sphinxext-rediraffe==0.2.7
1314
- sphinx-exercise==0.4.1
1415
- sphinx-proof==0.1.3
1516
- ghp-import==1.1.0
1617
- sphinxcontrib-youtube==1.1.0
1718
- sphinx-togglebutton==0.3.1
18-
- quantecon
19-
- array-to-latex
20-
- prettytable
21-
- graphviz
2219
# Sandpit Requirements
2320
# - PuLP
2421
# - cvxpy
2522
# - cvxopt
2623
# - cylp
24+
# - array-to-latex
25+
# - prettytable
2726

0 commit comments

Comments
 (0)