Metadata-Version: 2.4
Name: openmedaxis-init
Version: 0.1.2
Summary: Project scaffolder for OpenMedAxis
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown

# openmedaxis-init

A command-line scaffolder that creates ready-to-run [OpenMedAxis](https://github.com/openmedaxis) projects with a fully configured Python environment, PyTorch stack, and all standard dependencies pre-installed.

---

## Requirements

- [uv](https://docs.astral.sh/uv/) 0.5 or later

---

## Usage

```bash
uvx openmedaxis-init <project-name> [OPTIONS]
```

No installation needed. `uvx` runs the tool directly from PyPI in an isolated environment.

This single command will:

1. Create a new project directory named `<project-name>`
2. Generate a `pyproject.toml` with the correct uv/PyTorch index configuration
3. Create a virtual environment via `uv sync`
4. Install the full dependency stack
5. Run a smoke test to verify the environment

### Options

| Option | Choices | Default | Description |
|---|---|---|---|
| `--template` | `modern` | `modern` | Project template to use |
| `--torch-backend` | `cu118`, `cpu` | `cu118` | PyTorch backend (CUDA 11.8 or CPU-only) |
| `--oma` | any version string | latest | OpenMedAxis version to pin (e.g. `0.4.2`) |

### Examples

**GPU project (CUDA 11.8, latest OpenMedAxis):**
```bash
uvx openmedaxis-init my-segmentation-project
```

**CPU-only project:**
```bash
uvx openmedaxis-init my-project --torch-backend cpu
```

**Pin a specific OpenMedAxis version:**
```bash
uvx openmedaxis-init my-project --oma 0.4.2
```

---

## What Gets Installed

Every `modern` template project installs the following packages:

| Package | Version |
|---|---|
| torch | 2.6.0 |
| torchvision | 0.21.0 |
| torchaudio | 2.6.0 |
| openmedaxis | latest or pinned |
| lightning | 2.5.2 |
| einops | 0.8.1 |
| matplotlib | 3.10.0 |
| nibabel | 5.4.0 |
| numpy | 2.1.2 |
| pip | latest |
| scikit-image | 0.25.2 |
| scipy | 1.16.0 |
| torchmetrics | 1.7.3 |
| tqdm | 4.67.1 |

---

## Generated Project Structure

```
my-project/
├── pyproject.toml          # Project config with uv/PyTorch index settings
├── .python-version         # Pins Python 3.11
├── .gitignore
├── README.md
└── src/
    └── my_project/
        ├── __init__.py
        └── train.py        # Entry point: uv run python -m my_project.train
```

---

## After Scaffolding

```bash
cd my-project
uv run python -m my_project.train
```

---

## Development

To work on `openmedaxis-init` itself:

```bash
git clone <repo-url>
cd openmedaxis_init
uv sync
uv run openmedaxis-init --help
```
