Skip to content

Configuration (mtb.config)

The paths and settings every function reads. mtb.config holds them: set one, such as mtb.config.data_path = "/scratch/data", to use your own data folder, environment folder or Leiden backend.

Name Summary
mtb.config The paths and settings every multibench function reads.

Environment variables

variable effect
MULTIBENCH_DATA_PATH The folder that holds the dataset folders (data_path).
MULTIBENCH_ENVS_DIR Where method environments are installed and looked up (envs_dir).
MULTIBENCH_REPO_PATH Where the method scripts are, or are downloaded to on first use (repo_path).
MULTIBENCH_SCRIPTS_REF A commit or tag of PYangLab/scMultiBench whose method scripts are fetched with git instead of the package's.
MULTIBENCH_RUN_MODE prefix or conda: how a run enters an environment. Environments describes both.

A value assigned in Python wins over the variable. print(mtb.config) prints each setting.

mtb.config

Settings

The paths and settings every multibench function reads.

mtb.config is one of these: set a field to change it, for example mtb.config.data_path = "/scratch/data", or set MULTIBENCH_DATA_PATH, MULTIBENCH_REPO_PATH and MULTIBENCH_ENVS_DIR in the shell. A value assigned in Python wins over the variable; None goes back to the default. print(mtb.config) shows every field; a misspelt field raises AttributeError.

ATTRIBUTES DESCRIPTION
data_path

Data root that holds the dataset folders; mtb.data.fetch, mtb.scan and mtb.run use it. Default $MULTIBENCH_DATA_PATH, else <base>/data.

type Path

repo_path

Folder of the method scripts (tools_scripts/), downloaded there on the first run when absent or empty. Default $MULTIBENCH_REPO_PATH, else <base>/scMultiBench_scripts/<id>, where <id> changes with the scripts.

type Path

envs_dir

Where the method environments live (<envs_dir>/<env>). Default $MULTIBENCH_ENVS_DIR, else the first writable envs folder of the conda on PATH, else ~/.cache/multibench/envs.

type Path

leiden_flavor

Leiden backend of the clustering in mtb.evaluate: "leidenalg" (default, the paper's and the stored results') or "igraph" (faster).

type str

Examples

>>> import multibench as mtb
>>> mtb.config.data_path = "/scratch/data"
>>> # before mtb.env.install(...)
>>> mtb.config.envs_dir = "/scratch/envs"
>>> print(mtb.config)
See Also

mtb.env.install : installs the method envs under envs_dir. mtb.data.fetch : downloads demo datasets into data_path.