How phuijse/montecarlobook works
1. Repository role
- This is not an application backend or library; it is a Jupyter Book that publishes educational content on Monte Carlo methods and MCMC.
- The main architectural boundary is between authoring content in notebooks and building a static documentation site for GitHub Pages.
2. Primary content layer: lectures/
- The core of the book lives in the lectures/ directory.
- Each .ipynb notebook is effectively a chapter or lesson: intro, monte_carlo, random_numbers, random_walk, markov, mcmc1, mcmc2, and numpyro.
- These notebooks are the main source of narrative, equations, code examples, and generated figures.
3. Supporting media
- lectures/images/ holds images used by the notebooks.
- These are part of the instructional content pipeline and are typically embedded into notebook pages during rendering.
4. Data dependency layer: data/
- The data/ directory contains notebook input datasets: mistery_data.npy and mnist_data_fives.pkl.
- These are offline assets consumed by the notebooks for demonstrations, simulations, or inference examples.
- The architecture is “content + local data,” with notebooks reading these files directly rather than fetching data from external services at runtime.
5. Book structure and navigation
- _toc.yml defines the book’s table of contents and chapter ordering.
- This file is the navigation backbone of the site: it determines how notebooks are assembled into a coherent sequence for readers.
6. Site and build configuration
- _config.yml contains Jupyter Book configuration such as site metadata, execution behavior, and build settings.
- Together with _toc.yml, it separates content organization from site generation policy.
7. Presentation customization
- _static/custom.css provides site-specific styling overrides.
- This is the visual customization boundary: content remains in notebooks, while appearance is adjusted at the static-site layer.
8. Build/runtime model
- The book is built with Jupyter Book, which converts notebooks into a static website.
- That means the runtime is primarily browser-side static hosting, not a server application.
- Any notebook code execution happens during authoring/build time, depending on the configured Jupyter Book execution settings.
9. Publishing target
- The README indicates the book is published on GitHub Pages.
- So the deployment architecture is a static site pipeline: source notebooks and configs in the repo, generated HTML hosted externally by GitHub Pages.
10. Educational flow of the content
- The topic progression is conceptual and cumulative: Monte Carlo basics → random walks → Markov processes → Metropolis → MCMC implementation/diagnostics → Bayesian inference with MCMC.
- This suggests the notebooks are intentionally ordered to support a teaching arc, not independent documentation pages.
11. Repository boundaries
- There is no separate service layer, API layer, or database layer.
- The only persistent assets are the authored notebooks, local datasets, and static site configuration; everything else is generated from those sources.
12. What an architecture diagram should emphasize
- Inputs: notebooks, images, datasets, config files.
- Processing: Jupyter Book build pipeline.
- Output: static website published to GitHub Pages.
- The key dependency arrows are from data/ and lectures/images/ into notebooks, then from notebooks + _toc.yml + _config.yml into the generated site.
Main entry points: images Lecture images · mcmc1.ipynb MCMC I · monte_carlo.ipynb Monte Carlo · random_numbers.ipynb Random Numbers
Components 16
Authoring content
Notebook-based chapters and supporting media
- Intro · Opening lesson for the book
lectures/intro.ipynb - Monte Carlo · Core Monte Carlo concepts and examples
lectures/monte_carlo.ipynb - Random Numbers · Random number generation and sampling foundations
lectures/random_numbers.ipynb - Random Walk · Stochastic motion and simulation patterns
lectures/random_walk.ipynb - Markov · Markov chains and transition structure
lectures/markov.ipynb - MCMC I · Metropolis-style sampling foundations
lectures/mcmc1.ipynb - MCMC II · Diagnostics, refinements, and extended MCMC topics
lectures/mcmc2.ipynb - NumPyro · Probabilistic programming and Bayesian inference
lectures/numpyro.ipynb - Lecture images · Figures and images embedded in notebook chapters
lectures/images - Data assets · Offline datasets consumed by examples and exercises
data
Book structure
Navigation, configuration, and presentation
- README · Project summary and publishing context
README.md - TOC · Book order and chapter structure
_toc.yml - Config · Jupyter Book settings and execution policy
_config.yml - Custom CSS · Site-specific visual styling
_static/custom.css
Build and publish
Jupyter Book generation and static hosting
- Jupyter Book · Converts notebooks and config into a static site
- GitHub Pages · Published HTML documentation hosted as a static site
Connections 30
- README → Jupyter Book: describes · README documents the publishing model
- TOC → Jupyter Book: orders · TOC defines the book sequence
- Config → Jupyter Book: configures · Build and execution settings flow into the book build
- Custom CSS → GitHub Pages: styles · Custom CSS overrides the rendered output
- Lecture images → Intro: embedded in · Images are used within notebook pages
- Lecture images → Monte Carlo: embedded in · Images are used within notebook pages
- Lecture images → Random Numbers: embedded in · Images are used within notebook pages
- Lecture images → Random Walk: embedded in · Images are used within notebook pages
- Lecture images → Markov: embedded in · Images are used within notebook pages
- Lecture images → MCMC I: embedded in · Images are used within notebook pages
- Lecture images → MCMC II: embedded in · Images are used within notebook pages
- Lecture images → NumPyro: embedded in · Images are used within notebook pages
- Data assets → MCMC I: feeds examples · Local datasets support demonstrations and inference exercises
- Data assets → NumPyro: feeds examples · Local datasets support demonstrations and inference exercises
- Intro → Monte Carlo: flows to · Conceptual progression through the book
- Monte Carlo → Random Numbers: flows to · Conceptual progression through the book
- Random Numbers → Random Walk: flows to · Conceptual progression through the book
- Random Walk → Markov: flows to · Conceptual progression through the book
- Markov → MCMC I: flows to · Conceptual progression through the book
- MCMC I → MCMC II: flows to · Conceptual progression through the book
- MCMC II → NumPyro: flows to · Conceptual progression through the book
- Intro → Jupyter Book: build input · Chapters are compiled into the site
- Monte Carlo → Jupyter Book: build input · Chapters are compiled into the site
- Random Numbers → Jupyter Book: build input · Chapters are compiled into the site
- Random Walk → Jupyter Book: build input · Chapters are compiled into the site
- Markov → Jupyter Book: build input · Chapters are compiled into the site
- MCMC I → Jupyter Book: build input · Chapters are compiled into the site
- MCMC II → Jupyter Book: build input · Chapters are compiled into the site
- NumPyro → Jupyter Book: build input · Chapters are compiled into the site
- Jupyter Book → GitHub Pages: publishes · Build output is deployed as a static website