# isarojpandit/abforge architecture

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

- Interactive diagram: https://gitdiagram.com/isarojpandit/abforge
- Repository: https://github.com/isarojpandit/abforge

## Overview

abforge is a Python library for the A/B experiment lifecycle: plan sample size, test observed outcomes, monitor sequentially, and reduce variance with CUPED; it also provides visualizations. The package API re-exports these capabilities, while CUPED uses the hypothesis-testing functions and power-curve plotting uses power calculations. The notebook demonstrates the lifecycle but is not part of the runtime architecture. Relationships among the unsampled notebook and modules are omitted; edges reflect excerpts or README statements.

Main entry points: [`abforge/__init__.py`](https://github.com/isarojpandit/abforge/blob/main/abforge/__init__.py) (Package API), [`abforge/cuped.py`](https://github.com/isarojpandit/abforge/blob/main/abforge/cuped.py) (CUPED adjustment), [`abforge/viz.py`](https://github.com/isarojpandit/abforge/blob/main/abforge/viz.py) (Result plots), [`abforge/power.py`](https://github.com/isarojpandit/abforge/blob/main/abforge/power.py) (Power analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Experiment Design"]
  node_power["Power analysis<br/>[power.py]"]
end

subgraph group_analysis["Statistical Analysis"]
  node_stats["Hypothesis tests<br/>[stats.py]"]
  node_sequential["Sequential monitoring<br/>[sequential.py]"]
  node_cuped["CUPED adjustment<br/>[cuped.py]"]
end

subgraph group_presentation["Visualization"]
  node_viz["Result plots<br/>[viz.py]"]
end

node_analyst(("Experiment analyst"))
node_api["Package API<br/>[__init__.py]"]

node_analyst -->|"uses"| node_api
node_api -->|"exports"| node_power
node_api -->|"exports"| node_stats
node_api -->|"exports"| node_sequential
node_api -->|"exports"| node_cuped
node_api -->|"exports"| node_viz
node_cuped -->|"runs tests"| node_stats
node_viz -->|"computes curve"| node_power

click node_api "https://github.com/isarojpandit/abforge/blob/main/abforge/__init__.py"
click node_power "https://github.com/isarojpandit/abforge/blob/main/abforge/power.py"
click node_stats "https://github.com/isarojpandit/abforge/blob/main/abforge/stats.py"
click node_sequential "https://github.com/isarojpandit/abforge/blob/main/abforge/sequential.py"
click node_cuped "https://github.com/isarojpandit/abforge/blob/main/abforge/cuped.py"
click node_viz "https://github.com/isarojpandit/abforge/blob/main/abforge/viz.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_power toneBlue
class node_stats,node_sequential,node_cuped toneAmber
class node_viz,node_api toneMint
class node_analyst toneIndigo
```

## Components

### Experiment Design

- [Power analysis](https://github.com/isarojpandit/abforge/blob/main/abforge/power.py): `abforge/power.py`

### Statistical Analysis

- [Hypothesis tests](https://github.com/isarojpandit/abforge/blob/main/abforge/stats.py): `abforge/stats.py`
- [Sequential monitoring](https://github.com/isarojpandit/abforge/blob/main/abforge/sequential.py): `abforge/sequential.py`
- [CUPED adjustment](https://github.com/isarojpandit/abforge/blob/main/abforge/cuped.py): `abforge/cuped.py`

### Visualization

- [Result plots](https://github.com/isarojpandit/abforge/blob/main/abforge/viz.py): `abforge/viz.py`

### Other components

- **Experiment analyst**
- [Package API](https://github.com/isarojpandit/abforge/blob/main/abforge/__init__.py): `abforge/__init__.py`

## Connections

- Experiment analyst → Package API: uses (evidence: `README.md`)
- Package API → Power analysis: exports (evidence: `abforge/__init__.py`)
- Package API → Hypothesis tests: exports (evidence: `abforge/__init__.py`)
- Package API → Sequential monitoring: exports (evidence: `abforge/__init__.py`)
- Package API → CUPED adjustment: exports (evidence: `abforge/__init__.py`)
- Package API → Result plots: exports (evidence: `abforge/__init__.py`)
- CUPED adjustment → Hypothesis tests: runs tests (evidence: `abforge/cuped.py`)
- Result plots → Power analysis: computes curve (evidence: `abforge/viz.py`)
