# Installation (cross-platform, conda-first with mamba)

The project prefers **mamba/conda**. If they are unavailable, the installer falls back to a local **Python venv**.

## Recommended: Mambaforge (conda + mamba preinstalled)
- Download **Mambaforge** (or **Miniforge**) for your OS from the conda-forge Miniforge releases page.
- Run the installer and allow it to initialize your shell (e.g., `mamba init`).
- Open a new terminal and verify:
  ```bash
  mamba --version
  conda --version
  ```

## If you already have Miniconda or Anaconda
Install **mamba** into the base environment, then use it for speed and reliability:
```bash
conda install -n base -c conda-forge mamba -y
mamba --version
```

## Quick start (after mamba is available)

**macOS / Linux**
```bash
bash scripts/install.sh
```

**Windows (PowerShell)**
```powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
powershell -File scripts\install.ps1
```

**Windows (cmd.exe)**
```bat
scripts\install.bat
```

## What the installer does
1. Detects **mamba** (or tries to install it via `conda install -n base -c conda-forge mamba` if only conda is found).
2. Updates/creates the environment from `environment.yml` (if present). The environment name is read from the YAML (detected: `lab01`).
3. Installs `requirements.txt` if present (inside the environment).
4. Registers a Jupyter kernel with the environment name.
5. If no conda/mamba is found, creates `.venv/` and installs requirements via pip; registers `lab01-venv` as a kernel.

## Manual conda pathway
```bash
# From project root
mamba env update --file environment.yml --name lab01 --prune   # or: conda env update ...
mamba activate lab01                                          # or: conda activate ...
python -m pip install -r requirements.txt  # optional extra deps via pip
python -m ipykernel install --user --name lab01 --display-name lab01
```

## Notes
- Apple Silicon: prefer Mambaforge/Miniforge (ARM64 builds) for simpler wheels.
- After installation, select the installed Jupyter kernel (`lab01` or `lab01-venv`).
