"Given a flat pile of transistors with no labels, name the analog building blocks — using nothing but which devices share which wires."
A synthesized opamp, once flattened to SPICE, is just 20–40 devices and a mess of net names. A human designer glances at it and sees structure instantly. This package teaches a computer to do the same, in three layers, each a clean transform whose output is the next layer's input.
This is the map to keep in mind. Hover a stage to trace its data flow; click any box to open its page.
Not the file's order, not alphabetical — simplest and most foundational first, orchestrator last. Learn the nouns, then the transforms bottom-up, then the façade that ties them together.
The nine dataclasses. The vocabulary every other file speaks.
SPICE text → ParsedNetlist. Dispatch by first letter. The warm-up.
The engine: a pruned backtracking search over template patterns.
Accept-and-extend escape hatches for variable-size structures.
The judge: resolve overlapping candidates into functional blocks.
The public façade. Eleven names; no logic; the whole thing at a glance.
The generated pages follow the layout of circuitgenome/recognizer/ one-to-one. The tree is flat (the only subfolder, config/, holds YAML pattern libraries — no Python to explain, shown greyed below).
If you remember nothing else, remember this shape — four verbs, three layers, one direction of flow:
from circuitgenome.recognizer import parse, recognize, group_by_category
netlist = parse(spice_text) # Layer 0
sr = recognize(netlist) # Layer 1 — every candidate, overlaps and all
fbr = group_by_category(sr, netlist) # Layer 2 — best-guess functional groups
In one sentence: the
recognizerpackage turns a flat SPICE netlist into named analog building blocks through three connectivity-driven layers — parse, recognize, assign — that never look at a single transistor size.
Generated with the explain-code-with-fig skill · intuition-first teaching, hand-authored themeable SVG