Usage guide
AutoZyme is opt-in. Install it once, activate the patch family you want, then keep using the upstream package normally. Use the Python / R toggle on any code block to switch languages — your choice applies to the whole page and is remembered.
1. See what is available
Patch names are package-level: scanpy, seurat, cellchat, infercnv, and so on.
import autozyme
autozyme.list_patches(installed=True) library(autozyme)
list_patches(installed = TRUE) Use the patch catalog when you need the exact function list, tested upstream version, or benchmark gate.
2. Activate what you need
import autozyme
autozyme.activate("scanpy") # one patch
autozyme.activate(["scanpy", "scvelo"]) # several patches
autozyme.activate("scrna_core") # bundle, when available library(autozyme)
activate("seurat") # one patch
activate(c("seurat", "cellchat")) # several patches
activate("scrna_signaling") # bundle, when available Activation is lazy: importing AutoZyme does not import Scanpy, Seurat, TensorFlow, or any other upstream package. The upstream code is touched only when you activate a patch.
3. Use upstream exactly as before
import scanpy as sc
sc.pp.normalize_total(adata)
sc.tl.pca(adata) library(Seurat)
obj <- NormalizeData(obj)
obj <- RunPCA(obj) No wrapper object, no new data format, no pipeline rewrite. AutoZyme swaps selected upstream functions for faster versions inside the current process.
4. Check what is active
autozyme.status()
autozyme.inspect("scanpy") status()
inspect("seurat") Use inspect() if something does not seem faster. It tells you whether the upstream function is currently bound to AutoZyme’s fast implementation.
5. Save an environment snapshot
Every activation prints a one-line banner. For a structured record you can keep next to your results, save a full environment snapshot.
autozyme.env_snapshot() env_snapshot() This records AutoZyme version, per-patch state, upstream versions, and platform. (It does not capture thread-count env vars.)
6. Turn it off when needed
# one call
sc.pp.normalize_total(adata, zyme=False)
# one block
with autozyme.disabled():
sc.tl.pca(adata)
# one patch family
autozyme.deactivate("scanpy")
# whole session, set before import autozyme
import os
os.environ["AUTOZYME_DISABLED"] = "1" # one call
nichenetr::predict_ligand_activities(..., zyme = FALSE)
# one block
autozyme::with_disabled({
Seurat::RunPCA(obj)
})
# one patch family
deactivate("seurat")
# whole session, set before library(autozyme)
Sys.setenv(AUTOZYME_DISABLED = "1") For process-wide worker behavior and thread counts, read Threading & multiprocessing.