# slackermanz/pythonmnca architecture

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

- Interactive diagram: https://gitdiagram.com/slackermanz/pythonmnca
- Repository: https://github.com/slackermanz/pythonmnca

## Overview

This is a small Pygame cellular-automaton application. Its main workflow initializes and seeds a World, repeatedly advances its state through multiscale convolution updates, and renders the result. The source shows a separate simple-convolution utility, but no caller for it. The README is empty, so the map reflects only the supplied source; external library behavior is represented at a high level.

Main entry points: [`mnca.py`](https://github.com/slackermanz/pythonmnca/blob/master/mnca.py) (Pygame loop), [`world.py`](https://github.com/slackermanz/pythonmnca/blob/master/world.py) (World state), [`convolve.py`](https://github.com/slackermanz/pythonmnca/blob/master/convolve.py) (MNCA update)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_loop["Pygame loop<br/>[mnca.py]"]
end

subgraph group_simulation["Simulation"]
  node_world["World state<br/>[world.py]"]
  node_mnca["MNCA update<br/>[convolve.py]"]
  node_kernel["Circular kernels<br/>[convolve.py]"]
  node_simple["Simple convolution<br/>[convolve.py]"]
end

subgraph group_rendering["Rendering"]
  node_pygame["Pygame display"]
  node_screen["Display screen"]
end

node_operator(("Operator"))
node_scipy["SciPy convolution"]

node_operator -->|"starts"| node_loop
node_loop -->|"creates"| node_world
node_loop -->|"seeds"| node_world
node_loop -->|"steps"| node_world
node_world -->|"updates via"| node_mnca
node_mnca -->|"generates"| node_kernel
node_mnca -->|"convolves with"| node_scipy
node_simple -->|"convolves with"| node_scipy
node_loop -->|"renders"| node_world
node_world -->|"builds surface"| node_pygame
node_world -->|"blits state"| node_screen
node_loop -->|"handles events"| node_pygame
node_loop -->|"flips display"| node_screen
node_pygame -.->|"scales surface"| node_screen

click node_loop "https://github.com/slackermanz/pythonmnca/blob/master/mnca.py"
click node_world "https://github.com/slackermanz/pythonmnca/blob/master/world.py"
click node_mnca "https://github.com/slackermanz/pythonmnca/blob/master/convolve.py"
click node_kernel "https://github.com/slackermanz/pythonmnca/blob/master/convolve.py"
click node_simple "https://github.com/slackermanz/pythonmnca/blob/master/convolve.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_loop toneBlue
class node_world,node_mnca,node_kernel,node_simple toneAmber
class node_pygame,node_screen toneMint
class node_operator,node_scipy toneIndigo
```

## Components

### Application

- [Pygame loop](https://github.com/slackermanz/pythonmnca/blob/master/mnca.py): `mnca.py`

### Simulation

- [World state](https://github.com/slackermanz/pythonmnca/blob/master/world.py): `world.py`
- [MNCA update](https://github.com/slackermanz/pythonmnca/blob/master/convolve.py): `convolve.py`
- [Circular kernels](https://github.com/slackermanz/pythonmnca/blob/master/convolve.py): `convolve.py`
- [Simple convolution](https://github.com/slackermanz/pythonmnca/blob/master/convolve.py): `convolve.py`

### Rendering

- **Pygame display**
- **Display screen**

### Other components

- **Operator**
- **SciPy convolution**

## Connections

- Operator → Pygame loop: starts
- Pygame loop → World state: creates
- Pygame loop → World state: seeds
- Pygame loop → World state: steps
- World state → MNCA update: updates via
- MNCA update → Circular kernels: generates
- MNCA update → SciPy convolution: convolves with
- Simple convolution → SciPy convolution: convolves with
- Pygame loop → World state: renders
- World state → Pygame display: builds surface
- World state → Display screen: blits state
- Pygame loop → Pygame display: handles events
- Pygame loop → Display screen: flips display
- Pygame display → Display screen: scales surface
