# Partitioning

```{eval-rst}
.. currentmodule:: campmc
```

Metacell partitioning with CAMP1–4. The high-level entry point is
{func}`~campmc.partition`, which samples a coreset and dispatches to an
assignment kernel.

**Writes**

- ``adata.obs[key_added]`` — metacell labels (or ``key_added_{gamma}`` for multi-gamma)
- ``adata.obs[f"{key_added}_is_seed"]`` — coreset seed flags
- ``adata.uns[key_added]`` — run metadata

Executable examples are on {func}`campmc.partition`.

```{eval-rst}
.. autosummary::
   :nosignatures:
   :toctree: ../generated/

   partition
```

Assignment kernels live in the private ``campmc._assign`` package and are called
from {func}`campmc.partition`. Prefer the high-level API unless you are extending
the package.
