Metadata-Version: 2.4
Name: colliderx
Version: 0.1.2
Summary: Local-first particle decay simulator
Author: Vatsal Jaiswal
License: MIT License
        
        Copyright (c) 2026 Vatsal Jaiswal
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Debugger4567/ColliderX
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: python-dotenv
Requires-Dist: psycopg2-binary
Dynamic: license-file

# ColliderX

ColliderX is a local-first particle decay simulator (MVP).

Run a short end-to-end flow: event simulation → Feynman diagram → summary plots.

## Install

From PyPI:

```bash
pip install colliderx
```

For local development:

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

Install Graphviz (optional, only needed for rendered `feynman.png`):

macOS:

```bash
brew install graphviz
```

Linux (Debian/Ubuntu):

```bash
sudo apt-get update
sudo apt-get install -y graphviz
```

Windows (PowerShell):

```powershell
# Option 1: winget
winget install Graphviz.Graphviz

# Option 2: Chocolatey
choco install graphviz
```

Verify Graphviz is available:

```bash
dot -V
```

Note: `pip install colliderx` cannot reliably auto-install system Graphviz (`dot`) across all OS/package managers. ColliderX will still run without it and fall back to DOT-only output (`feynman.dot`).

## Quick Run

If installed from PyPI, run the installed CLI command from any folder:

```bash
colliderx -p "Muon" -n 1000 --save --no-show -o artifacts/flow_muon
```

If running from source, first `cd` into the repository root, then use `main.py`:

```bash
cd /path/to/ColliderX
python main.py -p "Muon" -n 1000 --save --no-show -o artifacts/flow_muon
```

Other examples (from source):

Default (interactive, show-only):

```bash
python main.py -p "Muon" -n 1000
```

Save outputs to disk and avoid interactive windows:

```bash
python main.py -p "Muon" -n 1000 --save --no-show -o artifacts/flow_muon
```

Run with a seed:

```bash
python main.py -p "Muon" -n 1000 -s 42
```

## CLI Flags (short)

- `-p, --particle` : parent particle name (positional also supported)
- `-n, --events`   : number of events to simulate
- `-s, --seed`     : random seed
- `-E, --energy`   : override parent energy (MeV)
- `--save`         : persist generated files to `-o/--out`
- `--no-show`      : do not open interactive plot windows
- `-o, --out`      : output directory (default `artifacts/run_<timestamp>`)
- `--decay`        : force a particular root decay mode
- `--afb`          : enable forward-backward asymmetry (where applicable)

## Saved Outputs (`--save`)

- `feynman.dot` (DOT source)
- `feynman.png` (if Graphviz is available and rendering enabled)
- `graphs/` (PNG plots: decay modes, spectra, process-specific plots)
- `summary.txt` (run summary and counts)

## Tests

```bash
pytest -q
```

If Graphviz is not installed, the tool falls back to writing DOT files only and continues the flow.
