Build and develop Jupyter Book lectures for intermediate quantitative economics using JAX, PyTorch, and scientific Python stack
Expert guidance for working with the QuantEcon lecture-python.myst repository - intermediate quantitative economics lecture materials built with Jupyter Book.
This skill provides comprehensive instructions for developing, building, and maintaining the Intermediate Quantitative Economics with Python lecture series. The repository contains 80+ MyST markdown lecture files that are executed and compiled into HTML, PDF, and notebook formats using Jupyter Book.
Always execute these commands in sequence before any development work:
```bash
conda env create -f environment.yml
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate quantecon
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
pip install pyro-ppl
pip install --upgrade "jax[cuda12-local]==0.6.2"
pip install numpyro
python scripts/test-jax-install.py
```
**Critical**: Never cancel installation commands. Each step has expected timing and interruption will require restarting from scratch.
**WARNING**: Build commands take 45-90 minutes to complete. Never cancel them.
```bash
jb build lectures --path-output ./ -W --keep-going
jb build lectures --builder pdflatex --path-output ./ -n -W --keep-going
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
```
Builds execute all notebooks sequentially, caching results in `_build/.jupyter_cache/`.
When editing lecture materials:
1. **Activate environment**: `conda activate quantecon`
2. **Edit MyST files**: Modify `.md` files in `/lectures/` directory
3. **Test locally**: Consider testing on a subset of changed files if possible
4. **Full validation**: Run complete HTML build to ensure all notebooks execute
5. **Verify output**: Check `_build/html/` for expected results
After changes, run these checks:
```bash
python scripts/test-jax-install.py
conda list | grep -E "(jax|torch|jupyter-book)"
ls -la /home/runner/work/lecture-python.myst/lecture-python.myst/
ls lectures/ | head -10
```
During builds, monitor:
**Key directories:**
**Technology stack:**
**Expected warnings (safe to ignore):**
**Performance notes:**
1. **Never cancel long-running commands** - Installation and build processes must complete fully
2. **Always activate conda environment** before running any commands
3. **Expect long build times** - 45-90 minutes is normal, not an error
4. **Network warnings are expected** in sandboxed environments
5. **GPU support may be unavailable** - JAX runs in CPU mode and is still functional
```bash
conda activate quantecon && python scripts/test-jax-install.py
ls -lh _build/html/
du -sh _build/.jupyter_cache/
ls -lt lectures/*.md | head -5
```
The repository uses GitHub Actions with cache, CI, and publish workflows. Local builds should match CI behavior using identical commands and expecting similar timing.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/quantitative-economics-with-python-development/raw