Skip to content

Commit 1d94461

Browse files
committed
Merge branch 'main' into input_output
2 parents 516850f + 95005ca commit 1d94461

34 files changed

+6456
-1693
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 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
@@ -15,9 +15,9 @@ jobs:
1515
python-version: "3.10"
1616
environment-file: environment.yml
1717
activate-environment: quantecon
18-
- name: Graphics Support
19-
run: |
20-
sudo apt-get -qq update && sudo apt-get install -y graphviz
18+
# - name: Graphics Support
19+
# run: |
20+
# sudo apt-get -qq update && sudo apt-get install -y graphviz
2121
# - name: Install latex dependencies
2222
# run: |
2323
# sudo apt-get -qq update
@@ -51,12 +51,12 @@ jobs:
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.
@@ -80,4 +80,4 @@ jobs:
8080
deploy-message: "Preview Deploy from GitHub Actions"
8181
env:
8282
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
83-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
83+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

.github/workflows/publish.yml

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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: [email protected]
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: [email protected]

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
lectures/_build
3-
*/.ipynb_checkpoints/
3+
*/.ipynb_checkpoints/
4+
_build/*

_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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name: quantecon
22
channels:
33
- default
4+
- conda-forge
45
dependencies:
56
- python=3.10
67
- anaconda=2023.03
8+
- python-graphviz
79
- pip
810
- pip:
911
- jupyter-book==0.15.1
1012
- docutils==0.17.1
11-
- quantecon-book-theme==0.4.1
13+
- quantecon-book-theme==0.4.2
1214
- sphinx-tojupyter==0.3.0
1315
- sphinxext-rediraffe==0.2.7
1416
- sphinx-exercise==0.4.1
@@ -23,4 +25,3 @@ dependencies:
2325
# - cylp
2426
# - array-to-latex
2527
# - prettytable
26-

lectures/_config.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ parse:
1717
- substitution
1818
- tasklist
1919

20+
only_build_toc_files: true
2021
execute:
2122
execute_notebooks: "cache"
2223
timeout: 600 # 10 minutes
23-
# run_in_temp: true
24+
exclude_patterns:
25+
- '_static/*'
2426

2527
html:
2628
baseurl: https://intro.quantecon.org/
@@ -33,21 +35,24 @@ latex:
3335
targetname: quantecon-python-intro.tex
3436

3537
sphinx:
36-
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx_proof] # sphinx_tojupyter
38+
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx_proof, sphinx_tojupyter]
3739
config:
40+
# myst-nb config
41+
nb_render_image_options:
42+
width: 80%
3843
html_favicon: _static/lectures-favicon.ico
3944
html_theme: quantecon_book_theme
4045
html_static_path: ['_static']
4146
html_theme_options:
42-
# header_organisation_url: https://quantecon.org
43-
# header_organisation: QuantEcon
47+
header_organisation_url: https://quantecon.org
48+
header_organisation: QuantEcon
4449
repository_url: https://github.com/QuantEcon/lecture-python-intro
45-
# nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
46-
# twitter: quantecon
47-
# twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
48-
# og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
49-
# description: This website presents a set of lectures on python programming for economics, designed and written by Thomas J. Sargent and John Stachurski.
50-
# keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
50+
nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
51+
twitter: quantecon
52+
twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
53+
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
54+
description: This website presents introductory lectures on computational economics, designed and written by Thomas J. Sargent and John Stachurski.
55+
keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
5156
# analytics:
5257
# google_analytics_id: UA-54984338-9
5358
launch_buttons:
Loading
Loading

lectures/_static/quant-econ.bib

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,82 @@
33
Note: Extended Information (like abstracts, doi, url's etc.) can be found in quant-econ-extendedinfo.bib file in _static/
44
###
55
6+
@article{chambers1996theory,
7+
title={A theory of commodity price fluctuations},
8+
author={Chambers, Marcus J and Bailey, Roy E},
9+
journal={Journal of Political Economy},
10+
volume={104},
11+
number={5},
12+
pages={924--957},
13+
year={1996},
14+
publisher={The University of Chicago Press}
15+
}
16+
17+
@article{deaton1996competitive,
18+
title={Competitive storage and commodity price dynamics},
19+
author={Deaton, Angus and Laroque, Guy},
20+
journal={Journal of Political Economy},
21+
volume={104},
22+
number={5},
23+
pages={896--923},
24+
year={1996}
25+
}
26+
27+
28+
@article{deaton1992on,
29+
title={On the behavior of commodity prices},
30+
author={Deaton, Angus and Laroque, Guy},
31+
journal={The Review of Economic Studies},
32+
year={1992},
33+
volume={59},
34+
pages={1--23}
35+
}
36+
37+
@article{scheinkman1983simple,
38+
title={A simple competitive model with production and storage},
39+
author={Scheinkman, Jose A and Schechtman, Jack},
40+
journal={The Review of Economic Studies},
41+
volume={50},
42+
number={3},
43+
pages={427--441},
44+
year={1983},
45+
publisher={Wiley-Blackwell}
46+
}
47+
48+
@article{wright1982economic,
49+
title={The economic role of commodity storage},
50+
author={Wright, Brian D and Williams, Jeffrey C},
51+
journal={The Economic Journal},
52+
volume={92},
53+
number={367},
54+
pages={596--614},
55+
year={1982},
56+
publisher={JSTOR}
57+
}
58+
59+
@article{samuelson1971stochastic,
60+
title={Stochastic speculative price},
61+
author={Samuelson, Paul A},
62+
journal={Proceedings of the National Academy of Sciences},
63+
volume={68},
64+
number={2},
65+
pages={335--337},
66+
year={1971},
67+
publisher={National Acad Sciences}
68+
}
69+
70+
@article{samuelson1958exact,
71+
title={An exact consumption-loan model of interest with or without the social contrivance of money},
72+
author={Samuelson, Paul A},
73+
journal={Journal of political economy},
74+
volume={66},
75+
number={6},
76+
pages={467--482},
77+
year={1958},
78+
publisher={The University of Chicago Press}
79+
}
80+
81+
682
@article{sargent2023economic,
783
title={Economic Networks: Theory and Computation},
884
author={Sargent, Thomas J and Stachurski, John},
@@ -2624,4 +2700,4 @@ @article{imampolitical
26242700
author={Imam, Patrick and Temple, Jonathan RW},
26252701
year={2023},
26262702
journal={IMF Working Paper}
2627-
}
2703+
}

0 commit comments

Comments
 (0)