# akashdeshmukh-git/fractal-cosmology-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/akashdeshmukh-git/fractal-cosmology-pipeline
- Repository: https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline

## Overview

This package analyzes the fractal Hubble model through three scripts: a DESI ΛCDM benchmark, a joint DESI DR1 and Pantheon+ MCMC fit, and an analytic CMB consistency check. Users can run each stage individually or use `run_all.py`, which executes them in sequence. The benchmark’s best-fit parameters can inform the joint fit, whose posterior results feed the CMB check. The scripts also compute model predictions and likelihoods internally. Data files are referenced by the source and README, but are not present in the supplied tree.

Main entry points: [`step2_joint_mcmc.py`](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step2_joint_mcmc.py) (Joint MCMC), [`step1_lcdm_benchmark.py`](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step1_lcdm_benchmark.py) (ΛCDM Benchmark), [`run_all.py`](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/run_all.py) (Sequential Runner), [`step3_cmb_check.py`](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step3_cmb_check.py) (CMB Check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow"]
  node_runner["Sequential Runner<br/>[run_all.py]"]
  node_lcdm_state["ΛCDM Fit State"]
  node_joint_state["Joint Fit Results"]
  node_benchmark_result["Benchmark Results"]
  node_cmb_result["CMB Results"]
  node_joint_plots["Posterior Plots"]
end

subgraph group_inference["Model Inference"]
  node_benchmark["ΛCDM Benchmark"]
  node_joint["Joint MCMC"]
  node_model_likelihood["Model Likelihoods"]
  node_desi_bao["DESI BAO Inputs"]
  node_pantheon["Pantheon+ Inputs"]
end

subgraph group_validation["Validation"]
  node_cmb["CMB Check<br/>[step3_cmb_check.py]"]
end

node_user(("Analyst"))

node_user -->|"runs workflow"| node_runner
node_user -.->|"runs directly"| node_benchmark
node_user -.->|"runs directly"| node_joint
node_user -.->|"runs directly"| node_cmb
node_runner -->|"executes first"| node_benchmark
node_runner -->|"executes second"| node_joint
node_runner -->|"executes third"| node_cmb
node_desi_bao -->|"provides BAO data"| node_benchmark
node_desi_bao -->|"provides BAO data"| node_joint
node_pantheon -->|"provides SN data"| node_joint
node_benchmark -->|"evaluates BAO likelihood"| node_model_likelihood
node_joint -->|"evaluates joint likelihood"| node_model_likelihood
node_benchmark -->|"saves best fit"| node_lcdm_state
node_benchmark -->|"writes metrics"| node_benchmark_result
node_lcdm_state -.->|"loads optional baseline"| node_joint
node_joint -->|"writes posterior"| node_joint_state
node_joint -->|"saves plots"| node_joint_plots
node_joint_state -.->|"loads posterior"| node_cmb
node_cmb -->|"writes check"| node_cmb_result

click node_runner "https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/run_all.py"
click node_benchmark "https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step1_lcdm_benchmark.py"
click node_joint "https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step2_joint_mcmc.py"
click node_model_likelihood "https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step2_joint_mcmc.py"
click node_cmb "https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step3_cmb_check.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_runner,node_lcdm_state,node_joint_state,node_benchmark_result,node_cmb_result,node_joint_plots toneBlue
class node_benchmark,node_joint,node_model_likelihood,node_desi_bao,node_pantheon toneAmber
class node_cmb toneMint
class node_user toneIndigo
```

## Components

### Workflow

- [Sequential Runner](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/run_all.py): `run_all.py`
- **ΛCDM Fit State**
- **Joint Fit Results**
- **Benchmark Results**
- **CMB Results**
- **Posterior Plots**

### Model Inference

- [ΛCDM Benchmark](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step1_lcdm_benchmark.py): `step1_lcdm_benchmark.py`
- [Joint MCMC](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step2_joint_mcmc.py): `step2_joint_mcmc.py`
- [Model Likelihoods](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step2_joint_mcmc.py): `step2_joint_mcmc.py`
- **DESI BAO Inputs**
- **Pantheon+ Inputs**

### Validation

- [CMB Check](https://github.com/akashdeshmukh-git/fractal-cosmology-pipeline/blob/main/step3_cmb_check.py): `step3_cmb_check.py`

### Other components

- **Analyst**

## Connections

- Analyst → Sequential Runner: runs workflow
- Analyst → ΛCDM Benchmark: runs directly
- Analyst → Joint MCMC: runs directly
- Analyst → CMB Check: runs directly
- Sequential Runner → ΛCDM Benchmark: executes first
- Sequential Runner → Joint MCMC: executes second
- Sequential Runner → CMB Check: executes third
- DESI BAO Inputs → ΛCDM Benchmark: provides BAO data
- DESI BAO Inputs → Joint MCMC: provides BAO data
- Pantheon+ Inputs → Joint MCMC: provides SN data
- ΛCDM Benchmark → Model Likelihoods: evaluates BAO likelihood
- Joint MCMC → Model Likelihoods: evaluates joint likelihood
- ΛCDM Benchmark → ΛCDM Fit State: saves best fit
- ΛCDM Benchmark → Benchmark Results: writes metrics
- ΛCDM Fit State → Joint MCMC: loads optional baseline
- Joint MCMC → Joint Fit Results: writes posterior
- Joint MCMC → Posterior Plots: saves plots
- Joint Fit Results → CMB Check: loads posterior
- CMB Check → CMB Results: writes check
