modules

geometor.byrne

Digital Scriptorium Codex, Visual Pseudocode Engine, and Symbolic Proofs for Oliver Byrne’s 1847 Euclid.

Unites Oliver Byrne’s The First Six Books of the Elements of Euclid in Which Coloured Diagrams and Symbols Are Used Instead of Letters for the Greater Ease of Learners (London: William Pickering / Chiswick Press, 1847) with:

  1. Inline Byrne Visual Glyph Roles (geometor.byrne.sphinx_ext) rendering authentic four-color vector micro-glyphs inside Sphinx/HTML/EPUB proof equations with bidirectional .euclid-graphic hover/click highlighting;

  2. Formal Pointer-Free Visual Pseudocode Grammar (geometor.byrne.pseudocode) modeling Byrne’s 1847 notation as a typed geometric value-token DSL alongside Heath’s classical alphabetic Euclid and geometor/elements formal pseudocode; and

  3. 100% Exact Symbolic Constructions & Renderer (geometor.byrne.constructions, geometor.byrne.render) built on geometor.model.Model over exact SymPy number fields ($mathbb{Q}$, $mathbb{Q}(sqrt{3})$, $mathbb{Q}(phi)$, and cyclotomic pentagonal extensions).

Submodules

Attributes

PHI

PLATE_REGISTRY

BYRNE_COLORS

BYRNE_STROKE_STYLES

ROSETTA_PROGRAMS

__version__

Classes

ByrnePlate

Complete symbolic model, verified invariants, and 1847 visual layers for one plate.

ByrneColorSpec

Color specification for one of Oliver Byrne's four 1847 woodblock inks.

ByrneProgram

Complete 3-way Rosetta formalization of a Euclidean proposition.

ByrneStatement

A single structured line in a Byrne visual program.

RosettaMetrics

Quantitative comparison across Heath (alphabetic), Byrne (visual), and GEOMETOR (DAG).

VisualToken

An inline pass-by-value geometric glyph in a Byrne statement.

Functions

build_all_plates() → list[ByrnePlate]

Construct and verify all 17 showcase ByrnePlate models.

build_plate(prop_id) → ByrnePlate

Construct and verify a single ByrnePlate by proposition ID.

list_plate_ids() → list[str]

Return ordered list of all 17 showcase Byrne proposition IDs.

get_color_spec(color) → ByrneColorSpec

Return the ByrneColorSpec for color (case-insensitive).

compute_rosetta_metrics(program) → RosettaMetrics

Compute quantitative Rosetta comparison metrics for a ByrneProgram.

get_rosetta_program(prop_id) → ByrneProgram

Lookup a ByrneProgram by proposition ID (e.g. "I.47").

export_all_plates(output_dir) → list[pathlib.Path]

Construct and export all 17 showcase Byrne plates into output_dir.

export_plate_svg(plate, output_path, *[, margin, ...]) → pathlib.Path

Write plate as an interactive .euclid-graphic SVG file.

render_plate_svg(plate, *[, margin, show_labels]) → str

Render a ByrnePlate into a .euclid-graphic SVG.

Package Contents

geometor.byrne.PHI: sympy.Expr
geometor.byrne.PLATE_REGISTRY: dict[str, collections.abc.Callable[[], ByrnePlate]]
class geometor.byrne.ByrnePlate

Complete symbolic model, verified invariants, and 1847 visual layers for one plate.

prop_id: str
slug: str
heath_id: str
g_id: str
book: int
title: str
pickering_page: str
number_field: str
model: geometor.model.Model
polygons: list[StyledPolygon] = []
wedges: list[StyledAngleWedge] = []
circles: list[StyledCircle] = []
arcs: list[StyledArc] = []
segments: list[StyledSegment] = []
proof_checks: dict[str, bool]
canvas_size: tuple[int, int] = (640, 460)
show_labels: bool = False
geometor.byrne.build_all_plates() → list[ByrnePlate]

Construct and verify all 17 showcase ByrnePlate models.

geometor.byrne.build_plate(prop_id: str) → ByrnePlate

Construct and verify a single ByrnePlate by proposition ID.

geometor.byrne.list_plate_ids() → list[str]

Return ordered list of all 17 showcase Byrne proposition IDs.

geometor.byrne.BYRNE_COLORS: dict[str, ByrneColorSpec]
geometor.byrne.BYRNE_STROKE_STYLES: dict[str, str]
class geometor.byrne.ByrneColorSpec

Color specification for one of Oliver Byrne’s four 1847 woodblock inks.

Stores canonical token name, human-readable label, light/dark stroke and fill hex values (light_hex, dark_hex, light_fill_hex, dark_fill_hex), CSS custom property tokens (css_var, css_fill_var), and the 1847 Chiswick Press historical_pigment note.

name: str
label: str
light_hex: str
dark_hex: str
light_fill_hex: str
dark_fill_hex: str
css_var: str
css_fill_var: str
historical_pigment: str
geometor.byrne.get_color_spec(color: str) → ByrneColorSpec

Return the ByrneColorSpec for color (case-insensitive).

Parameters:

color – Color identifier ("red", "blue", "yellow", "black", or "ink").

Returns:

Matching ByrneColorSpec.

Raises:

ValueError – If color is not one of Byrne’s four canonical colors.

geometor.byrne.ROSETTA_PROGRAMS: dict[str, ByrneProgram]
class geometor.byrne.ByrneProgram

Complete 3-way Rosetta formalization of a Euclidean proposition.

Pairs Byrne’s 1847 pointer-free visual program with Heath’s classical alphabetic English translation and GEOMETOR’s formal DAG pseudocode.

prop_id: str
plate_id: str
heath_id: str
g_id: str
title: str
pickering_page: str
number_field: str
statements: tuple[ByrneStatement, ...]
heath_text: str
geometor_steps: tuple[str, ...]
design_notes: str = ''
all_visual_tokens() → list[VisualToken]

Flatten all visual tokens appearing across all phases of the program.

class geometor.byrne.ByrneStatement

A single structured line in a Byrne visual program.

Stores block phase (ProofPhase), ordered items of visual tokens, operators, and minimal connectors, marginal Euclidean justifications, and an optional analytical comment.

phase: ProofPhase
items: tuple[StatementItem, ...]
justifications: tuple[str, ...] = ()
comment: str = ''
visual_tokens() → list[VisualToken]

Return all VisualToken instances in this statement.

word_count() → int

Count natural-language words (excluding pure visual glyphs and operators).

to_rst(plate_id: str = '') → str

Compile statement into RST with inline :byrne-*: and :just: roles.

to_compact() → str

Render statement into compact Unicode pseudocode.

class geometor.byrne.RosettaMetrics

Quantitative comparison across Heath (alphabetic), Byrne (visual), and GEOMETOR (DAG).

prop_id: str
heath_words: int
heath_pointer_dereferences: int
byrne_words: int
byrne_pointer_dereferences: int
byrne_visual_tokens: int
byrne_distinct_registers: int
byrne_statement_count: int
geometor_step_count: int
word_compression_ratio: float
register_diagnostic: RegisterDiagnostic
class geometor.byrne.VisualToken

An inline pass-by-value geometric glyph in a Byrne statement.

Encodes primitive kind (TokenKind), Byrne color expression, stroke (StrokeMode), fill (FillMode), optional interactive geom_ref, squared exponent flag, Book V shape_hint, and intentional symmetric congruence_group.

kind: TokenKind
color: str
stroke: StrokeMode
fill: FillMode
geom_ref: str = ''
squared: bool = False
shape_hint: str = ''
congruence_group: str = ''
property register_signature: tuple[str, str, str, str, str]

Perceptual tuple distinguishing this token in visual working memory.

role_spec_body(plate_id: str = '') → str

Build the RST role argument string for :byrne-<kind>:.

to_rst(plate_id: str = '') → str

Compile this visual token into a Sphinx :byrne-*: role.

to_html(plate_id: str = '') → str

Render this visual token directly to an interactive HTML/SVG span.

to_compact() → str

Return a concise human-readable token representation for CLI/tables.

geometor.byrne.compute_rosetta_metrics(program: ByrneProgram) → RosettaMetrics

Compute quantitative Rosetta comparison metrics for a ByrneProgram.

geometor.byrne.get_rosetta_program(prop_id: str) → ByrneProgram

Lookup a ByrneProgram by proposition ID (e.g. "I.47").

geometor.byrne.export_all_plates(output_dir: str | pathlib.Path) → list[pathlib.Path]

Construct and export all 17 showcase Byrne plates into output_dir.

geometor.byrne.export_plate_svg(plate: geometor.byrne.constructions.ByrnePlate, output_path: str | pathlib.Path, *, margin: float = 42.0, show_labels: bool | None = None) → pathlib.Path

Write plate as an interactive .euclid-graphic SVG file.

geometor.byrne.render_plate_svg(plate: geometor.byrne.constructions.ByrnePlate, *, margin: float = 42.0, show_labels: bool | None = None) → str

Render a ByrnePlate into a .euclid-graphic SVG.

geometor.byrne.__version__ = '0.1.0'