# rougier/numpy-100 architecture

> Architecture diagram of the GitHub repository rougier/numpy-100, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rougier/numpy-100
- Repository: https://github.com/rougier/numpy-100

## Overview

This repository is a collection of 100 NumPy exercises, distributed as Markdown and Jupyter notebooks for learners and teachers. The main workflow is to author exercise and header content in keyed-text files, generate learning materials, then read or run them. Notebook setup exposes question, hint, answer, and random-pick helpers. The README also documents Binder access. The source tree and README differ on the exercise-data filename; this map uses the exact path present in the tree. Binder wiring is documented, not implemented here.

Main entry points: [`generators.py`](https://github.com/rougier/numpy-100/blob/master/generators.py) (Material generator), [`initialise.py`](https://github.com/rougier/numpy-100/blob/master/initialise.py) (Notebook helpers), [`100_Numpy_exercises.ipynb`](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.ipynb) (Exercise notebook), [`100_Numpy_random.ipynb`](https://github.com/rougier/numpy-100/blob/master/100_Numpy_random.ipynb) (Random exercise notebook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Exercise content"]
  node_exercise_data["Exercise data<br/>[exercises100.ktx]"]
  node_headers["Document headers<br/>[headers.ktx]"]
end

subgraph group_generation["Material generation"]
  node_generator["Material generator<br/>[generators.py]"]
end

subgraph group_learning["Learning materials"]
  node_notebook["Exercise notebook"]
  node_random_notebook["Random exercise notebook"]
  node_markdown["Markdown exercises"]
  node_markdown_hints["Markdown with hints"]
  node_markdown_solutions["Markdown with solutions"]
  node_markdown_hints_solutions["Markdown with hints and solutions"]
  node_initializer["Notebook helpers<br/>[initialise.py]"]
end

node_learner(("Learner or teacher"))
node_numpy["NumPy random"]
node_binder["Binder"]

node_generator -->|"reads exercises"| node_exercise_data
node_generator -->|"reads headers"| node_headers
node_generator -->|"generates"| node_notebook
node_generator -->|"generates"| node_random_notebook
node_generator -->|"generates"| node_markdown
node_generator -->|"generates"| node_markdown_hints
node_generator -->|"generates"| node_markdown_solutions
node_generator -->|"generates"| node_markdown_hints_solutions
node_notebook -->|"runs setup"| node_initializer
node_random_notebook -->|"runs setup"| node_initializer
node_initializer -->|"reads exercise data"| node_generator
node_initializer -->|"selects random index"| node_numpy
node_learner -->|"reads"| node_markdown
node_learner -->|"reads"| node_markdown_hints
node_learner -->|"reads"| node_markdown_solutions
node_learner -->|"reads"| node_markdown_hints_solutions
node_learner -->|"opens and runs"| node_notebook
node_binder -.->|"hosts notebook"| node_random_notebook

click node_exercise_data "https://github.com/rougier/numpy-100/blob/master/source/exercises100.ktx"
click node_headers "https://github.com/rougier/numpy-100/blob/master/source/headers.ktx"
click node_generator "https://github.com/rougier/numpy-100/blob/master/generators.py"
click node_notebook "https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.ipynb"
click node_random_notebook "https://github.com/rougier/numpy-100/blob/master/100_Numpy_random.ipynb"
click node_markdown "https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.md"
click node_markdown_hints "https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_hints.md"
click node_markdown_solutions "https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_solutions.md"
click node_markdown_hints_solutions "https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_hints_with_solutions.md"
click node_initializer "https://github.com/rougier/numpy-100/blob/master/initialise.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_exercise_data,node_headers toneBlue
class node_generator toneAmber
class node_notebook,node_random_notebook,node_markdown,node_markdown_hints,node_markdown_solutions,node_markdown_hints_solutions,node_initializer toneMint
class node_learner,node_numpy,node_binder toneIndigo
```

## Components

### Exercise content

- [Exercise data](https://github.com/rougier/numpy-100/blob/master/source/exercises100.ktx): `source/exercises100.ktx`
- [Document headers](https://github.com/rougier/numpy-100/blob/master/source/headers.ktx): `source/headers.ktx`

### Material generation

- [Material generator](https://github.com/rougier/numpy-100/blob/master/generators.py): `generators.py`

### Learning materials

- [Exercise notebook](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.ipynb): `100_Numpy_exercises.ipynb`
- [Random exercise notebook](https://github.com/rougier/numpy-100/blob/master/100_Numpy_random.ipynb): `100_Numpy_random.ipynb`
- [Markdown exercises](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.md): `100_Numpy_exercises.md`
- [Markdown with hints](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_hints.md): `100_Numpy_exercises_with_hints.md`
- [Markdown with solutions](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_solutions.md): `100_Numpy_exercises_with_solutions.md`
- [Markdown with hints and solutions](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_hints_with_solutions.md): `100_Numpy_exercises_with_hints_with_solutions.md`
- [Notebook helpers](https://github.com/rougier/numpy-100/blob/master/initialise.py): `initialise.py`

### Other components

- **Learner or teacher**
- **NumPy random**
- **Binder**

## Connections

- Material generator → Exercise data: reads exercises
- Material generator → Document headers: reads headers
- Material generator → Exercise notebook: generates
- Material generator → Random exercise notebook: generates
- Material generator → Markdown exercises: generates
- Material generator → Markdown with hints: generates
- Material generator → Markdown with solutions: generates
- Material generator → Markdown with hints and solutions: generates
- Exercise notebook → Notebook helpers: runs setup
- Random exercise notebook → Notebook helpers: runs setup
- Notebook helpers → Material generator: reads exercise data
- Notebook helpers → NumPy random: selects random index
- Learner or teacher → Markdown exercises: reads
- Learner or teacher → Markdown with hints: reads
- Learner or teacher → Markdown with solutions: reads
- Learner or teacher → Markdown with hints and solutions: reads
- Learner or teacher → Exercise notebook: opens and runs
- Binder → Random exercise notebook: hosts notebook
