# kouroshie/containment architecture

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

- Interactive diagram: https://gitdiagram.com/kouroshie/containment
- Repository: https://github.com/kouroshie/containment

## Overview

Containment is a Class VI geologic carbon-storage permitting toolkit, available as a Python library, CLI, and Streamlit app. The principal workflow takes project inputs or imported simulation output through fluid and threshold-pressure evaluation, flow modelling, and AoR delineation; it then supports corrective-action and PISC analyses and produces maps, reports, and exports. The graph preserves documented capabilities even where implementation excerpts were not supplied. Some subsystem links rely on the SOURCE INDEX or README rather than inspected call sites.

Main entry points: [`src/containment/workflow.py`](https://github.com/kouroshie/containment/blob/main/src/containment/workflow.py) (Run orchestration), [`src/containment/report.py`](https://github.com/kouroshie/containment/blob/main/src/containment/report.py) (Permit report), [`app/streamlit_app.py`](https://github.com/kouroshie/containment/blob/main/app/streamlit_app.py) (Browser app), [`src/containment/gis.py`](https://github.com/kouroshie/containment/blob/main/src/containment/gis.py) (Interactive GIS map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry and inputs"]
  node_cli["Command line<br/>[cli.py]"]
  node_webapp["Browser app<br/>[streamlit_app.py]"]
  node_project["Project configuration<br/>[config.py]"]
  node_imports["Simulation imports<br/>[importers.py]"]
  node_workbook["Excel workbook I/O<br/>[workbook.py]"]
end

subgraph group_models["Reservoir and pressure models"]
  node_fluid["Fluid properties<br/>[fluids.py]"]
  node_threshold["Threshold pressure<br/>[threshold.py]"]
  node_analytical["Analytical flow<br/>[pressure.py]"]
  node_relperm["Relative permeability<br/>[relperm.py]"]
  node_numerical["Numerical VE solver<br/>[ve_solver.py]"]
  node_faults["Fault and seismic layers<br/>[fault_layers.py]"]
  node_texnet["TexNet seismicity<br/>[texnet.py]"]
end

subgraph group_permit["Permit analyses"]
  node_workflow["Run orchestration<br/>[workflow.py]"]
  node_delineate["AoR delineation<br/>[delineate.py]"]
  node_corrective["Corrective action<br/>[corrective.py]"]
  node_pisc["PISC analysis<br/>[pisc.py]"]
  node_uncertainty["AoR uncertainty<br/>[uncertainty.py]"]
end

subgraph group_outputs["Maps and deliverables"]
  node_gis["Interactive GIS map<br/>[gis.py]"]
  node_viz["Static and interactive charts<br/>[viz.py]"]
  node_report["Permit report<br/>[report.py]"]
  node_exporters["GIS and field exports<br/>[exporters.py]"]
end

node_operator(("Project operator"))

node_operator -->|"runs"| node_cli
node_operator -->|"uses"| node_webapp
node_cli -->|"loads project"| node_project
node_cli -->|"runs analysis"| node_workflow
node_webapp -->|"runs analysis"| node_workflow
node_project -->|"provides inputs"| node_workflow
node_imports -.->|"supplies fields"| node_workflow
node_workbook -->|"reads and writes"| node_project
node_workflow -->|"evaluates"| node_fluid
node_workflow -->|"computes"| node_threshold
node_workflow -->|"uses pressure model"| node_analytical
node_workflow -->|"uses VE solver"| node_numerical
node_analytical -->|"uses"| node_relperm
node_numerical -->|"uses"| node_relperm
node_workflow -->|"delineates AoR"| node_delineate
node_workflow -->|"sizes actions"| node_corrective
node_workflow -->|"evaluates PISC"| node_pisc
node_workflow -->|"runs sensitivity"| node_uncertainty
node_workflow -.->|"creates report"| node_report
node_report -->|"renders results"| node_delineate
node_report -->|"includes metrics"| node_pisc
node_report -->|"renders figures"| node_viz
node_report -->|"renders map"| node_gis
node_workflow -->|"writes outputs"| node_exporters
node_gis -->|"uses georeferencing"| node_exporters
node_gis -->|"loads map layers"| node_faults
node_texnet -->|"uses layer data"| node_faults
node_webapp -->|"offers reporting"| node_report
node_webapp -->|"offers mapping"| node_gis
node_webapp -->|"supports workbook I/O"| node_workbook

click node_cli "https://github.com/kouroshie/containment/blob/main/src/containment/cli.py"
click node_webapp "https://github.com/kouroshie/containment/blob/main/app/streamlit_app.py"
click node_project "https://github.com/kouroshie/containment/blob/main/src/containment/config.py"
click node_imports "https://github.com/kouroshie/containment/blob/main/src/containment/io/importers.py"
click node_workbook "https://github.com/kouroshie/containment/blob/main/src/containment/io/workbook.py"
click node_fluid "https://github.com/kouroshie/containment/blob/main/src/containment/fluids.py"
click node_threshold "https://github.com/kouroshie/containment/blob/main/src/containment/threshold.py"
click node_analytical "https://github.com/kouroshie/containment/blob/main/src/containment/analytical/pressure.py"
click node_relperm "https://github.com/kouroshie/containment/blob/main/src/containment/analytical/relperm.py"
click node_numerical "https://github.com/kouroshie/containment/blob/main/src/containment/numerical/ve_solver.py"
click node_workflow "https://github.com/kouroshie/containment/blob/main/src/containment/workflow.py"
click node_delineate "https://github.com/kouroshie/containment/blob/main/src/containment/delineate.py"
click node_corrective "https://github.com/kouroshie/containment/blob/main/src/containment/corrective.py"
click node_pisc "https://github.com/kouroshie/containment/blob/main/src/containment/pisc.py"
click node_uncertainty "https://github.com/kouroshie/containment/blob/main/src/containment/uncertainty.py"
click node_gis "https://github.com/kouroshie/containment/blob/main/src/containment/gis.py"
click node_viz "https://github.com/kouroshie/containment/blob/main/src/containment/viz.py"
click node_report "https://github.com/kouroshie/containment/blob/main/src/containment/report.py"
click node_exporters "https://github.com/kouroshie/containment/blob/main/src/containment/io/exporters.py"
click node_faults "https://github.com/kouroshie/containment/blob/main/src/containment/fault_layers.py"
click node_texnet "https://github.com/kouroshie/containment/blob/main/src/containment/texnet.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_cli,node_webapp,node_project,node_imports,node_workbook toneBlue
class node_fluid,node_threshold,node_analytical,node_relperm,node_numerical,node_faults,node_texnet toneAmber
class node_workflow,node_delineate,node_corrective,node_pisc,node_uncertainty toneMint
class node_gis,node_viz,node_report,node_exporters toneRose
class node_operator toneIndigo
```

## Components

### User entry and inputs

- [Command line](https://github.com/kouroshie/containment/blob/main/src/containment/cli.py): `src/containment/cli.py`
- [Browser app](https://github.com/kouroshie/containment/blob/main/app/streamlit_app.py): `app/streamlit_app.py`
- [Project configuration](https://github.com/kouroshie/containment/blob/main/src/containment/config.py): `src/containment/config.py`
- [Simulation imports](https://github.com/kouroshie/containment/blob/main/src/containment/io/importers.py): `src/containment/io/importers.py`
- [Excel workbook I/O](https://github.com/kouroshie/containment/blob/main/src/containment/io/workbook.py): `src/containment/io/workbook.py`

### Reservoir and pressure models

- [Fluid properties](https://github.com/kouroshie/containment/blob/main/src/containment/fluids.py): `src/containment/fluids.py`
- [Threshold pressure](https://github.com/kouroshie/containment/blob/main/src/containment/threshold.py): `src/containment/threshold.py`
- [Analytical flow](https://github.com/kouroshie/containment/blob/main/src/containment/analytical/pressure.py): `src/containment/analytical/pressure.py`
- [Relative permeability](https://github.com/kouroshie/containment/blob/main/src/containment/analytical/relperm.py): `src/containment/analytical/relperm.py`
- [Numerical VE solver](https://github.com/kouroshie/containment/blob/main/src/containment/numerical/ve_solver.py): `src/containment/numerical/ve_solver.py`
- [Fault and seismic layers](https://github.com/kouroshie/containment/blob/main/src/containment/fault_layers.py): `src/containment/fault_layers.py`
- [TexNet seismicity](https://github.com/kouroshie/containment/blob/main/src/containment/texnet.py): `src/containment/texnet.py`

### Permit analyses

- [Run orchestration](https://github.com/kouroshie/containment/blob/main/src/containment/workflow.py): `src/containment/workflow.py`
- [AoR delineation](https://github.com/kouroshie/containment/blob/main/src/containment/delineate.py): `src/containment/delineate.py`
- [Corrective action](https://github.com/kouroshie/containment/blob/main/src/containment/corrective.py): `src/containment/corrective.py`
- [PISC analysis](https://github.com/kouroshie/containment/blob/main/src/containment/pisc.py): `src/containment/pisc.py`
- [AoR uncertainty](https://github.com/kouroshie/containment/blob/main/src/containment/uncertainty.py): `src/containment/uncertainty.py`

### Maps and deliverables

- [Interactive GIS map](https://github.com/kouroshie/containment/blob/main/src/containment/gis.py): `src/containment/gis.py`
- [Static and interactive charts](https://github.com/kouroshie/containment/blob/main/src/containment/viz.py): `src/containment/viz.py`
- [Permit report](https://github.com/kouroshie/containment/blob/main/src/containment/report.py): `src/containment/report.py`
- [GIS and field exports](https://github.com/kouroshie/containment/blob/main/src/containment/io/exporters.py): `src/containment/io/exporters.py`

### Other components

- **Project operator**

## Connections

- Project operator → Command line: runs (evidence: `README.md`)
- Project operator → Browser app: uses (evidence: `README.md`)
- Command line → Project configuration: loads project (evidence: `src/containment/cli.py`)
- Command line → Run orchestration: runs analysis (evidence: `src/containment/cli.py`)
- Browser app → Run orchestration: runs analysis (evidence: `app/streamlit_app.py`)
- Project configuration → Run orchestration: provides inputs (evidence: `src/containment/workflow.py`)
- Simulation imports → Run orchestration: supplies fields
- Excel workbook I/O → Project configuration: reads and writes (evidence: `src/containment/io/workbook.py`)
- Run orchestration → Fluid properties: evaluates (evidence: `src/containment/workflow.py`)
- Run orchestration → Threshold pressure: computes (evidence: `src/containment/workflow.py`)
- Run orchestration → Analytical flow: uses pressure model (evidence: `src/containment/workflow.py`)
- Run orchestration → Numerical VE solver: uses VE solver (evidence: `src/containment/workflow.py`)
- Analytical flow → Relative permeability: uses (evidence: `src/containment/analytical/pressure.py`)
- Numerical VE solver → Relative permeability: uses (evidence: `src/containment/numerical/ve_solver.py`)
- Run orchestration → AoR delineation: delineates AoR (evidence: `src/containment/workflow.py`)
- Run orchestration → Corrective action: sizes actions (evidence: `src/containment/workflow.py`)
- Run orchestration → PISC analysis: evaluates PISC (evidence: `src/containment/workflow.py`)
- Run orchestration → AoR uncertainty: runs sensitivity (evidence: `src/containment/workflow.py`)
- Run orchestration → Permit report: creates report
- Permit report → AoR delineation: renders results (evidence: `src/containment/report.py`)
- Permit report → PISC analysis: includes metrics (evidence: `src/containment/report.py`)
- Permit report → Static and interactive charts: renders figures (evidence: `src/containment/report.py`)
- Permit report → Interactive GIS map: renders map (evidence: `src/containment/report.py`)
- Run orchestration → GIS and field exports: writes outputs (evidence: `src/containment/workflow.py`)
- Interactive GIS map → GIS and field exports: uses georeferencing (evidence: `src/containment/gis.py`)
- Interactive GIS map → Fault and seismic layers: loads map layers (evidence: `src/containment/gis.py`)
- TexNet seismicity → Fault and seismic layers: uses layer data (evidence: `src/containment/texnet.py`)
- Browser app → Permit report: offers reporting (evidence: `app/streamlit_app.py`)
- Browser app → Interactive GIS map: offers mapping (evidence: `app/streamlit_app.py`)
- Browser app → Excel workbook I/O: supports workbook I/O (evidence: `app/streamlit_app.py`)
