Metadata-Version: 2.4
Name: umapers
Version: 1.0.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: BSD License
Classifier: Typing :: Typed
Requires-Dist: numpy>=1.26,<3
Summary: Python bindings for rust_umap
Keywords: umap,dimensionality-reduction,manifold-learning,rust,pyo3
Home-Page: https://github.com/wenjiudaijiugui/umapers
License: BSD-3-Clause
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/wenjiudaijiugui/umapers/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/wenjiudaijiugui/umapers/tree/main/umap_rs
Project-URL: Homepage, https://github.com/wenjiudaijiugui/umapers
Project-URL: Issues, https://github.com/wenjiudaijiugui/umapers/issues
Project-URL: Repository, https://github.com/wenjiudaijiugui/umapers

# umapers

Python package `umapers`, backed by `rust_umap` and built with PyO3 + maturin.

Version `1.0.0` focuses on IDE-help quality for the public Python API:

- the exported surface has useful type hints
- public methods carry docstrings that explain inputs and outputs
- `help(umapers.Umap)` and editor hover should be informative

The binding remains intentionally thin: Python normalizes arrays and CSR inputs,
while Rust owns validation and compute-heavy paths whenever practical.

## Local build

```bash
PYTHON_BIN="$(command -v python3 || command -v python)"
uv venv --python "$PYTHON_BIN" .venv
uv pip install --python .venv/bin/python --upgrade pip maturin
uv run --python .venv/bin/python maturin develop --manifest-path umap_rs/Cargo.toml
uv run --python .venv/bin/python python -I -m pytest -q umap_rs/tests/test_binding.py
```

## Quick usage

```python
import numpy as np
from umapers import Umap

x = np.random.default_rng(42).normal(size=(200, 16)).astype(np.float32)
model = Umap(n_neighbors=15, n_components=2, n_epochs=120, random_seed=42, init="random")
emb = model.fit_transform(x)
```

## API layers

### Main API

Most users should start here:

- `Umap`
- `fit_transform`
- `Umap.fit`
- `Umap.fit_transform`
- `Umap.transform`
- `Umap.inverse_transform`

These methods accept NumPy arrays by default and support the documented `out=`
buffers where available.

### Advanced API

`Umap.fit_transform_with_knn(...)` is available for callers who already have a
precomputed exact or shared kNN graph. It is useful for benchmarks and
parameter sweeps, but it is not the recommended first-stop quickstart.

