All reference pages · source: docs/reference/api.md
Python API reference
import dexvantage as dv gives every name below without importing Qt. The worked examples are in the user guide and The Python and notebook API; this page is the docstrings of dexvantage/api.py, dexvantage/api_research.py, dexvantage/api_cluster.py and dexvantage/plugin_sdk.py, in the order dv lists them.
The module
The Python and notebook API: DexVantage without the window (no Qt is imported on this path).
import dexvantage as dv
rig = dv.sample('ur5e') # or dv.open('cell.dexv'), dv.new('My cell')
res = rig.run('coverage') # a Result: a dict (the study's JSON) plus .headline, .to_frame()
res.headline['text'] # 'Task volume seen: 91.9 % (mostly single or blind)'
rig.metrics(['coverage.covered', 'bandwidth.payload_mbps'])
rig.factors['sensor:Overhead D435.z'] # read a factor (core/factors.py paths)
taller = rig.with_factors({'sensor:Overhead D435.z': 1.2}) # a NEW Rig; rig is unchanged
rig.factors['sensor:Overhead D435.z'] = 1.2 # edits rig itself (its project is replaced by the edited one)
rig.export('out/', ['opencv_yaml', 'mjcf']) # core/exporters: files, notes, a manifest with SHA-256
rig.check('requirements.yaml') # the readiness scorecard (core/requirements.py)
rig.save('cell.dexv')
dv.studies(), dv.metrics(), dv.exporters(), dv.plugins()
ds = dv.datasets.open('path/to/lerobot_dataset') # LeRobot v2.1 / v3.0, RLDS, ROS 2 bags, plugin formats
dv.diff(rig, taller), dv.merge(base, ours, theirs) # project diff and three-way merge (api_research.py)
dv.bibtex(rig), dv.figure(res, 'fig.svg') # BibTeX of every source; a vector figure of a result
dv.splat.fit(rig, dataset='episodes/') # splat views: a 3DGS rig, its held-out quality (api_splat.py)
What edits in place and what returns a new object:
rig.factors[path] = valueandrig.factors.update({...})changerig(its project is replaced by the edited copy core.factors.apply returns; Robot and Sensor objects read from it before are then stale).rig.with_factors({...}),rig.use_variant(name)andrig.copy()return a new Rig;rigis unchanged.rig.run(study, **settings)runs on a copy with the settings laid over the stored ones; the rig's stored settings are unchanged (store them withrig.factors['setting:<study>.<key>'] = value).rig.robots,rig.sensorsandrig.variantsare the project's own objects: changing one changes the rig.rig.add_variant(name, {sensor factors})adds a copy of the active variant torig(the active one stays).
Every number comes from the studies themselves (the same code the window and batch mode run, through core.jobs and its result cache, keyed by the project's content): the API computes nothing of its own. A study that cannot run raises DexVantageError (core.jobs.StudyError) with a plain sentence; a figure a result does not state reads None.
Rig and Result have rich HTML views for Jupyter (repr_html). Result.to_frame() returns a pandas DataFrame when pandas is installed (the optional extra "research": pip install "dexvantage[research]"), else a list of dicts (Records) whose .note says so.
Doctest (run by tests/test_api.py):
>>> import dexvantage as dv
>>> rig = dv.sample('so100')
>>> rig
<Rig 'SO-100 sample': 1 robot, 2 sensors, 1 variant>
>>> [s.name for s in rig.sensors]
['Wrist camera (sample placement)', 'Third-person camera (sample placement)']
>>> z = 'sensor:Third-person camera (sample placement).z'
>>> rig.factors[z]
0.36
>>> higher = rig.with_factors({z: 0.5}) # a new Rig
>>> higher.factors[z], rig.factors[z]
(0.5, 0.36)
>>> rig.factors[z] = 0.4 # edits rig itself
>>> rig.factors[z]
0.4
>>> res = rig.run('bandwidth')
>>> isinstance(res, dict), res['study'], res.headline['word']
(True, 'bandwidth', 'no hosts')
>>> res.headline['text']
'Smallest controller margin: not stated (no hosts). The rig has no host controller: ...'
>>> 'coverage' in [s['id'] for s in dv.studies()]
True
Known limits: the API is a thin layer over the studies, so their own Known limits apply; studies run in the calling thread (the window's background controller is not used: a long study blocks the notebook cell, pass progress= to see it move); the result cache is per process (32 results, keyed by content, so a changed project or setting misses it); UI pages a plugin adds are not reachable from here; HTML views show at most 200 rows of a table.
Functions
dv.open(path: str) -> Rig
Open a .dexv project as a Rig.
dv.sample(name: str) -> Rig
A sample project as a Rig ('so100', 'ur5e', 'dexhand', 'aloha', 'panda-bimanual', 'g1'; dv.samples() lists them).
dv.new(name: str = 'Untitled') -> Rig
An empty project as a Rig.
dv.samples() -> Table
No docstring.
dv.studies() -> Table
Every study: id, title, batch flag, whether it needs a robot, and the plugin that added it (None: built in).
dv.metrics() -> Table
Every metric: id, title, unit, better, study, note and the plugin that added it.
dv.exporters() -> Table
No docstring.
dv.plugins() -> Table
The plugins found at start-up (or on first use of the API): name, version, status, what they added, errors.
dv.load_plugins(enabled: bool = True, reload: bool = True) -> Table
Find and load the installed plugins again (enabled=False: list them without loading).
dv.runs(where: Rig | str | os.PathLike | RunStore | None = None, *, study: str | list | None = None, tag: str | list | None = None, kind: str | list | None = None, since: str | datetime.date | None = None, until: str | datetime.date | None = None, status: str | list | None = None, project: str | list | None = None) -> Records | pd.DataFrame
The runs of a run store (run_store(where)) as a table: one row per run (run id, start and end in UTC, seconds, kind, study, status, project, its content hash, variant, headline, tags, note, re-run of, DexVantage version, git commit, result hash) and one column per metric (a metric id, or id@stat for a distribution's or a search's figure); None where a run does not state it. A pandas DataFrame (units in .attrs['units']) when pandas is installed, else Records (a list of row dicts, with .units). Filters: study, tag, kind, status, project (a value or a list), since / until (a date, a datetime or ISO text).
dv.track(result: Result | dict, rig: Rig | None = None, *, store: str | os.PathLike | RunStore | None = None, tags: tuple | list = (), note: str = '') -> dict
Log a Result (from rig.run or rig.check) as a run, whether or not the project's tracking is on: into store (a folder or a RunStore; default the rig's project's store). Returns the run record.
dv.run_store(where: Rig | str | os.PathLike | RunStore | None) -> RunStore
The run store (core/tracking/store.py RunStore) of where: a Rig (its project's store), a .dexv project file (the store its tracking settings name, default <name>.runs beside it) or a run store folder.
dv.prices(kind: str | None = None, stated_only: bool = True) -> Table
The library's cited prices: id, kind, device, amount, currency, price kind (maker_store, maker_price_list, reseller), min_quantity, region, source URL and date read; stated_only=False lists the entries without one too (amount None). Nothing is estimated or converted (docs/models/library.md#prices).
dv.price(model_id: str) -> dict | None
The cited price block of one library entry (a copy), or None when the entry states no price.
dv.diff(a: Rig | Project | str | os.PathLike, b: Rig | Project | str | os.PathLike, metrics: str | Sequence[str] | None = None) -> Diff
What changed from a to b (each a Rig, a Project or a path). metrics: metric ids (dv.metrics()) to run on both projects and compare; their studies run in this thread.
dv.merge(base: Rig | Project | str | os.PathLike, ours: Rig | Project | str | os.PathLike, theirs: Rig | Project | str | os.PathLike) -> Merge
Merge two edits (ours, theirs) of one project (base); each a Rig, a Project or a path. Places changed differently on both sides raise dv.MergeConflict (a DexVantageError) whose .conflicts lists them in words.
dv.bibtex(rig: Rig | Project | str | os.PathLike | None, path: str | os.PathLike | None = None, references: str = 'checks') -> str
BibTeX of every source the rig depends on: DexVantage, its library entries' datasheets, its robots' model files, its datasets and the validation references (references: 'checks' those the checks cite, 'all', 'none'). path: also write it there. Returns the text.
dv.figures(result: Result | dict) -> list
The publication figure specs of a study result (a dv Result or its dict), as the paper kit draws them: a list of {'id', 'study', 'spec'}; empty when the result has no per-item list of numbers to chart.
dv.figure(source: Result | dict | str | os.PathLike, path: str | os.PathLike, width: str | float = 'single', palette: str = 'tol', index: int = 0, **options: object) -> dict
Write a vector figure: source is a figure spec (dexvantage.figure/1, a dict, JSON text or a .json file), a {'spec': ...} item of dv.figures(), or a study result (its figure number index). width: 'single' (88.9 mm), 'double' (182 mm) or millimetres; palette 'tol' (colour-blind safe, the default) or 'chart'. The format follows the extension (.svg or .pdf). Returns {'path', 'format', 'width_mm', 'height_mm', 'series'}.
dv.export_runs(where: Rig | str | os.PathLike | RunStore | None, out_dir: str | os.PathLike, formats: str | Sequence[str] = ('csv', 'parquet', 'mlflow', 'wandb'), **filters: object) -> dict
Write the runs of a run store (dv.run_store(where): a Rig, a .dexv file or a store folder) into out_dir as runs.csv / runs_long.csv, runs.parquet, mlruns/ (MLflow's file store layout) and wandb/ (a W&B offline replay), with a manifest (SHA-256 and provenance). filters as dv.runs (study, tag, kind, status, project, since, until). Returns {'files', 'formats': {format: {'status', 'files', 'notes' or 'reason'}}, 'runs', 'manifest'}.
Classes
dv.Rig(project: Project)
A DexVantage project (core.project.Project) seen from Python: its robots, sensors and variants, its factors, its studies, metrics, exports and requirements. Rig(project) wraps a Project; dv.open / dv.sample / dv.new make one.
Rig.add_variant(name: str, factors: dict | None = None, from_variant: str | None = None, allow_locked: bool = False) -> Variant
Add a variant to this rig (edits it, as the window's "New variant from this one"): a copy of from_variant (a name or uid; default the active one) called name, with the sensor factors given set on the copy, e.g. rig.add_variant('Raised overhead', {'sensor:cam_high (overhead).dz': 0.05}). Its sensors keep their uids, so host links, cables and policy cameras apply to it too; the active variant does not change. Returns the Variant (dv.stats.compare_variants(rig, b=name) compares the two).
Rig.apply_sim2real(change: dict) -> Rig
A NEW Rig with one sim-to-real suggestion made (a result's 'apply', or a cause's 'apply'); rig is unchanged. A locked sensor is refused (DexVantageError).
Rig.check(requirements: str | os.PathLike | list | None = None, variant: str | None = None) -> Result
The readiness scorecard: requirements is a requirements file (YAML or JSON), a list of requirement dicts, 'defaults' (DexVantage's labelled defaults) or None (the rig's own). Returns a Result whose headline is the verdict ('ready', 'not ready', 'not evaluated').
Rig.copy() -> Rig
No docstring.
Rig.export(out_dir: str, formats: str | list, options: dict | None = None) -> dict
Write the rig in the given formats (dv.exporters() lists them) into out_dir; returns the manifest (formats with their files, notes and status; every file's SHA-256; export_manifest.json beside them).
Rig.factors
No docstring.
Rig.gap_dataset(folder: str, gaps: dict, progress: Callable[[float, str], None] | None = None, **settings: object) -> dict
Render a synthetic LeRobot dataset with KNOWN sim-to-real gaps (brightness_dn, gain, blur_px, noise_dn, mount, latency_s, camera: core/sim2real/inject.py) into a new or empty folder; returns its summary.
Rig.metrics(ids: str | list) -> MetricTable
The named metrics (core/metrics.py ids; dv.metrics() lists them), each study run at most once.
Rig.name
No docstring.
Rig.new(name: str = 'Untitled') -> Rig
No docstring.
Rig.open(path: str) -> Rig
No docstring.
Rig.path
No docstring.
Rig.project
The underlying core.project.Project (the same object: changing it changes the rig).
Rig.robots
No docstring.
Rig.run(study: str, *, progress: Callable[[float, str], None] | None = None, **settings: object) -> Result
Run a study (its id, e.g. 'coverage', or its batch flag, e.g. 'grasp') on a copy of the rig with settings laid over the stored ones; the rig is unchanged. progress: fn(fraction, text). A setting name the study does not read is refused in one sentence that lists its settings (core/study_settings.py).
Rig.sample(name: str) -> Rig
No docstring.
Rig.save(path: str | None = None) -> str
Write the .dexv file (to path, or where it was opened from; a folder or a path ending in .dexv.d: the unpacked, Git-friendly form); returns the path.
Rig.sensor_rows() -> list
No docstring.
Rig.sensors
The active variant's sensors.
Rig.sim2real(dataset: str | os.PathLike, *, progress: Callable[[float, str], None] | None = None, **settings: object) -> Result
The sim-to-real gap of a recorded episode (core/sim2real/gap.py: the episode rendered again through the rig and compared per camera, the causes ranked with their changes); dataset is a path (LeRobot, RLDS, ROS 2 bag). The same as run('sim2real', dataset=path, ...).
Rig.synth_episodes(folder: str, progress: Callable[[float, str], None] | None = None, **settings: object) -> dict
Render synthetic LeRobot episodes with known faults into a new or empty folder (core/sim/episodes.py; needs MuJoCo's offscreen renderer); returns its summary.
Rig.to_frame() -> Records | pd.DataFrame
The active variant's sensors, one row each (mount pose in the parent frame).
Rig.use_variant(ident: str) -> Rig
A new Rig with the variant named (by name or uid) active.
Rig.variant
No docstring.
Rig.variants
No docstring.
Rig.with_factors(values: dict, allow_locked: bool = False) -> Rig
A new Rig with these factors set (core/factors.py paths); this rig is unchanged.
dv.Result(doc: dict, study: str = '', title: str = '', project: Project | None = None)
A study's result: the study's own JSON document (a dict: res['summary'], json.dumps(res)) plus
.study, .title the study id and its title .headline {'metric', 'title', 'value', 'unit', 'better', 'status', 'bound', 'level', 'word', 'text'}: the study's headline figure (its metric tagged 'headline') with the status word the result gives, or None when the study has no headline metric .metrics() every metric of this study read off this result (no re-run): a MetricTable .to_frame(key=None, columns=None) key None: the metrics, one row each; else the list (or dict) under that key, one row per item, nested fields as dotted columns (columns= keeps only those): a pandas DataFrame, or Records .tables() the keys that hold lists of rows (what to_frame(key) takes) .save(path) JSON with the provenance block (core/provenance.py)
Result.headline
No docstring.
Result.metrics() -> MetricTable
No docstring.
Result.rows(key: str | None = None) -> list
No docstring.
Result.save(path: str) -> str
Write the result as JSON with the provenance block; returns the path.
Result.tables() -> list
No docstring.
Result.to_frame(key: str | None = None, columns: list | None = None) -> Records | pd.DataFrame
A table of the result (the class docstring); columns: keep only these (dotted names for nested fields).
dv.Records(iterable=())
A list of row dicts, returned by to_frame() when pandas is not installed; .note says so.
dv.Table(iterable=())
A list of row dicts (dv.studies(), dv.metrics(), ...) with to_frame() and an HTML view.
Table.to_frame() -> Records | pd.DataFrame
No docstring.
dv.MetricTable(…)
{metric id: {'value', 'unit', 'better', 'study', 'title', 'status', 'reason'?, 'bound'?}} (core.metrics), with to_frame() (one row per metric) and an HTML view.
MetricTable.figures() -> dict
{metric id: value} (None where not stated).
MetricTable.rows() -> list
No docstring.
MetricTable.to_frame() -> Records | pd.DataFrame
No docstring.
dv.Recording(ds: Dataset)
A recorded dataset (core.datasets.Dataset) seen from Python: .format, .version, .path, .info, episodes() (a Table), episode(i) (a core.datasets.Episode), truth(), to_frame() (the episodes), close(). Use it in a with block, or close() it.
Recording.close() -> None
No docstring.
Recording.episode(index: int) -> Episode
No docstring.
Recording.episode_rows(index: int) -> list
One episode's joint-state rows: {'t', <joint name>: value, ...} per row.
Recording.episodes() -> Table
No docstring.
Recording.format
No docstring.
Recording.info
No docstring.
Recording.path
No docstring.
Recording.to_frame(episode: int | None = None) -> Records | pd.DataFrame
The episodes (one row each), or, with episode=i, that episode's joint-state rows.
Recording.truth() -> dict | None
No docstring.
Recording.version
No docstring.
dv.DexVantageError(…)
A study cannot run on this project; the message says why in plain words (shown in the UI, never a traceback).
dv.Diff(doc: dict, project: Project | None = None)
What changed from project a to project b (core/projdiff.diff's document): 'a', 'b', 'identical', 'counts', 'changes' (section, op, kind, item, field, path, before, after, text) and 'metrics' (the deltas asked for).
Diff.html
A standalone HTML page of the diff.
Diff.identical
No docstring.
Diff.save(path: str) -> str
The diff as JSON with the provenance block of project a (as --diff A --diff B OUT.json writes it).
Diff.text
No docstring.
Diff.to_frame(key: str = 'changes') -> Records | pd.DataFrame
One row per change (key='metrics': one row per metric delta): a pandas DataFrame, or Records.
dv.Merge(res: MergeResult)
A three-way merge: .rig (the merged Rig, not yet saved), .from_ours and .from_theirs (the places only one side changed), .notes (what the merge noticed, such as two sensors that now share a name).
dv.MergeConflict(text, conflicts=())
The two edits cannot be merged; .conflicts lists each conflicting place in words.
Namespaces
Objects whose methods group one area: call them as dv.<name>.<method>(…).
dv.datasets
dv.datasets: open(path) -> Recording; formats() -> the formats DexVantage reads (plugins' too).
dv.datasets.formats() -> Table
No docstring.
dv.datasets.open(path: str) -> Recording
No docstring.
dv.publication
dv.publication: the publication kit (core/publication.py) of a rig, headless.
dv.publication.methods(rig, results) the methods paragraph (TeX), every number traced
dv.publication.tables(rig, results) {name: TeX table} (sensors, results, scorecard, ...)
dv.publication.kit(rig, results) the whole kit as data, with its checks and status
dv.publication.export(rig, 'out/', results) main.tex, methods.tex, tables/, figures/, refs.bib, ...
results: {study id: result} or a list of results (rig.run(...) gives them); without results every study but the long meta-studies runs first, as the report does (pass studies=[...] to choose). Other keyword options are the kit's settings: sections, siunitx, widths, pdf_figures, bibliography, title, validation, figure_specs. The PDF figures (export only) use Qt's PDF writer; nothing else imports Qt.
dv.publication.export(rig: Rig | Project, out_dir: str, results: dict | list | None = None, **options: object) -> dict
No docstring.
dv.publication.kit(rig: Rig | Project, results: dict | list | None = None, **options: object) -> dict
No docstring.
dv.publication.methods(rig: Rig | Project, results: dict | list | None = None, **options: object) -> str
No docstring.
dv.publication.tables(rig: Rig | Project, results: dict | list | None = None, **options: object) -> dict
No docstring.
dv.campaign
dv.campaign: plan(rig, spec=None, **settings) -> Result (the 'campaign' study: the counterbalanced schedule, totals, storage, checklists); export(result, base) -> the paths of <base>.csv, .ics, .html; power_n(p1, p2, alpha=0.05, power=0.8, continuity=True) -> the demonstrations per condition for a difference in success rate; balance(result) -> the balance counts; apply(rig, result) writes the plan into the rig's project.
dv.campaign.apply(rig: Rig | Project, result: Result | dict) -> None
No docstring.
dv.campaign.balance(result: Result | dict) -> dict
No docstring.
dv.campaign.export(result: Result | dict, base: str, start_date: str | None = None) -> list
No docstring.
dv.campaign.plan(rig: Rig | Project, spec: dict | str | None = None, **settings: object) -> Result
The campaign of rig (a Rig or a core Project) with spec (a dict, JSON text or a spec file) and settings laid over the project's stored spec; the stored spec is not changed.
dv.campaign.power_n(p1: float, p2: float, alpha: float = 0.05, power: float = 0.8, continuity: bool = True) -> dict
No docstring.
dv.cells
dv.cells: compare(*cells, reference=0, metrics=None, tolerance_draws=0, seed=1, pooling='auto', variants=False, progress=None) -> CellComparison.
A cell is a Rig (dv.open, dv.sample), a core Project, a path to a .dexv file or folder, or 'sample:<name>'; the first is the reference unless reference= names another (by number). metrics: metric ids, 'all', or None (the quick figures, core/cells.DEFAULT_METRICS); tolerance_draws ≥ 2 runs the tolerance Monte Carlo on every cell to say which differences exceed the build spread; pooling: 'auto' (a recorded dataset where a cell has one, else its plan), 'plan' or 'recorded'; variants=True adds the first cell's other variants as cells.
>>> import dexvantage as dv
>>> res = dv.cells.compare(dv.sample('so100'), 'sample:so100', metrics=['rig.camera_count'])
>>> res.headline['value'], res['pooling']['text']
(0.0, 'Every cell pools as is.')
dv.cells.compare(*cells: Rig | Project | str | os.PathLike, reference: int = 0, metrics: list | None = None, tolerance_draws: int = 0, seed: int = 1, pooling: str = 'auto', variants: bool = False, progress: Callable[[float, str], None] | None = None) -> CellComparison
No docstring.
dv.cluster
dv.cluster: experiment, tolerance, optimise, studies (this machine); slurm, gather, status, run_shard (a cluster); partition, settings, DiskResultCache.
dv.cluster.DiskResultCache
No docstring.
dv.cluster.experiment(rig: Rig | Project, design: dict | str | os.PathLike, jobs: int | None = None, progress: Callable | None = None, cache_dir: str | None = None) -> Result
No docstring.
dv.cluster.gather(folder: str | os.PathLike, out: str | None = None, write: bool = True, rig: Rig | Project | None = None) -> dict
The gather report; a complete experiment or Monte Carlo is logged in the experiment tracker as batch --gather logs it: in rig's project's store when rig is given, else the job folder's base project's.
dv.cluster.optimise(rig: Rig | Project, jobs: int | None = None, progress: Callable | None = None, cache_dir: str | None = None, **settings: object) -> Result
No docstring.
dv.cluster.optimise_continue(folder: str | os.PathLike, submit: bool = False) -> dict
No docstring.
dv.cluster.partition(m: int, n: int) -> list
No docstring.
dv.cluster.run_shard(work: str | os.PathLike, shard: int, of: int, out: str | None = None) -> dict
No docstring.
dv.cluster.settings() -> Table
No docstring.
dv.cluster.slurm(rig: Rig | Project, folder: str | os.PathLike, experiment: dict | str | os.PathLike | None = None, tolerance: dict | bool | None = None, optimise: dict | bool | None = None, shards: int | None = None, submit: bool = False, **slurm_settings: object) -> dict
A Slurm job folder for one of: experiment=design (a dict, JSON text or a path), tolerance={settings} (or True), optimise={settings} (or True: the optimiser's first round). Settings: core/cluster/slurm.DEFAULTS.
dv.cluster.status(folder: str | os.PathLike) -> dict
No docstring.
dv.cluster.studies(job_list: list | tuple, jobs: int | None = None, progress: Callable | None = None, cache_dir: str | None = None) -> list
[Result, or {'refused': sentence}] per (rig, study, settings) job, in order.
dv.cluster.tolerance(rig: Rig | Project, jobs: int | None = None, progress: Callable | None = None, cache_dir: str | None = None, **settings: object) -> Result
No docstring.
dv.stats
dv.stats: tests, effect sizes, corrections and power analysis (core/stats.py, every function of it is here: dv.stats.wilson, .clopper_pearson, .bootstrap_ci, .permutation_test, .welch_t, .mann_whitney, .wilcoxon_signed_rank, .cohens_d, .cliffs_delta, .risk_difference, .odds_ratio, .fisher_exact, .adjust, .power_two_proportions, .power_t, .n_two_proportions, .n_t, .episodes_needed, .demonstrations_needed, ...) and the app's comparisons:
compare_rates(rows, compare='reference', test='fisher', ...) -> Result (the 'stats' study)
compare_samples(a, b, paired=False, title='', unit='', better='higher', ...) -> Result
compare_variants(rig, a=None, b=None, metrics=None, n=32, seed=0, ...) -> Result (tolerance draws,
paired by seed)
compare_experiment(rig, factor, levels=None, result=None, ...) -> Result
compare_runs(rig, a, b, folder=None, metrics=None, ...) -> Result (tracker runs)
run(spec, rig=None) -> Result (a spec dict or file)
>>> import dexvantage as dv
>>> dv.stats.episodes_needed(0.5, 0.8)['n_per_group']
44
>>> r = dv.stats.compare_rates([('ACT', 14, 20), ('Diffusion', 19, 20)])
>>> r.headline['word'], round(r['comparisons'][0]['p'], 4)
('no clear difference', 0.0915)
dv.stats.compare_experiment(rig: Rig | Project, factor: str, levels: list | None = None, result: Result | dict | str | os.PathLike | None = None, responses: list | None = None, progress: Callable[[float, str], None] | None = None, **settings: object) -> Result
An experiment's runs split by factor's two levels (result: an experiment Result, its dict or a file; default the experiment saved in rig, run).
dv.stats.compare_rates(rows: list, compare: str = 'reference', test: str = 'fisher', power: dict | None = None, **settings: object) -> Result
rows: [(condition, successes, trials)] or [{'condition', 'successes', 'trials'}].
dv.stats.compare_runs(rig: Rig | Project, a: str | list | dict, b: str | list | dict, folder: str | None = None, metrics: list | None = None, **settings: object) -> Result
Tracker runs: a and b each a run id, a list of ids or {'tag': t}.
dv.stats.compare_samples(a: Sequence[float], b: Sequence[float], paired: bool = False, title: str = 'Value', unit: str = '', better: str = 'higher', names: tuple | list = ('A', 'B'), **settings: object) -> Result
No docstring.
dv.stats.compare_variants(rig: Rig | Project, a: str | None = None, b: str | None = None, metrics: list | None = None, n: int = 32, seed: int = 0, scale: float = 1.0, distribution: str = 'uniform', progress: Callable[[float, str], None] | None = None, **settings: object) -> Result
Two variants of rig over the tolerance Monte Carlo with one seed (the draws paired by seed).
dv.stats.run(spec: dict | str | os.PathLike, rig: Rig | Project | None = None, progress: Callable[[float, str], None] | None = None) -> Result
A statistics spec (a dict, JSON text or a spec file: schema dexvantage.stats/1) on rig (None: success counts, samples and the power calculator need no project).
dv.robot_io
dv.robot_io: robot files in and out, headless.
dv.robot_io.convert_usd('arm.usda') # {'name', 'mjcf', 'meshes', 'notes', 'record'}: a UsdPhysics # articulation as MJCF (core/robot/usd_import.py; needs usd-core) robot = dv.robot_io.add_robot(rig, 'arm.usda') # import a URDF, MJCF or USD robot into rig (edits rig) dv.robot_io.write_usd(rig, "arm.usda") # a robot as a UsdPhysics articulation (core/robot/usd_writer) dv.robot_io.openvla_encoding(rig) # the OXE state / action encodings the OpenVLA export writes
dv.robot_io.add_robot(rig: Rig, path: str | os.PathLike, name: str | None = None) -> Robot
Import the robot file at path (URDF, MJCF or USD) into rig's project (the first robot is primary); the Robot added. Edits rig.
dv.robot_io.convert_usd(path: str | os.PathLike) -> dict
No docstring.
dv.robot_io.openvla_encoding(rig: Rig, action_space: str | None = None) -> dict
No docstring.
dv.robot_io.write_usd(rig: Rig, path: str | os.PathLike, robot: str | None = None) -> dict
Write rig's robot (a name or uid; default the primary) as a UsdPhysics articulation at path.
dv.splat
dv.splat: fit, replay, augment, rig, load, available, lpips_state, fetch_lpips_weights, settings.
dv.splat.augment(rig: Rig | Project, out_dir: str | os.PathLike, dataset: str | os.PathLike | None = None, progress: Callable[[float, str], None] | None = None, **settings: object) -> dict
augment_n copies of the episode through §8.5's perturbed extrinsics, as a LeRobot dataset in out_dir/splat_augment_synthetic/ (every render marked synthetic). Returns the manifest.
dv.splat.available() -> str | None
None when the splat extra is installed; else the sentence saying it is not.
dv.splat.fetch_lpips_weights() -> str
Download AlexNet's ImageNet weights for LPIPS into the cache (network, 244 MB); returns the path.
dv.splat.fit(rig: Rig | Project, dataset: str | os.PathLike | None = None, progress: Callable[[float, str], None] | None = None, **settings: object) -> Result
The splat_views study (fit the rig or reuse the cached fit; its quality on held-out frames; the before/after preview of the target camera) on rig with settings laid over the stored ones.
dv.splat.load(path: str | os.PathLike) -> SplatRig
A splat rig a fit saved (.npz and its .json sidecar).
dv.splat.lpips_state() -> str
'ready', 'no package' or 'no weights' (AlexNet's weights are not in the cache).
dv.splat.replay(rig: Rig | Project, out_dir: str | os.PathLike, dataset: str | os.PathLike | None = None, progress: Callable[[float, str], None] | None = None, **settings: object) -> dict
The episode re-rendered at its logged q(t) through the proposed camera: out_dir/splat_replay_synthetic/ (a video read back after writing, per-frame images, the manifest). Returns the manifest.
dv.splat.rig(rig: Rig | Project, dataset: str | os.PathLike | None = None, progress: Callable[[float, str], None] | None = None, **settings: object) -> SplatRig
The fitted SplatRig itself (fitted now, or the cached fit for the same inputs).
dv.splat.settings() -> dict
The settings and their defaults (core/sim/splat_views.DEFAULTS).
The plugin SDK (dexvantage.plugin_sdk)
Plugins: third-party packages that add studies, metrics, exporters, dataset readers, library folders, UI pages and the validation checks of their models to DexVantage without editing it.
A plugin is an installed Python distribution that declares an entry point in the group dexvantage.plugins:
# the plugin's pyproject.toml
[project.entry-points."dexvantage.plugins"]
my_plugin = "my_plugin:register"
# my_plugin/__init__.py
def register(api): # api: a PluginAPI, one per plugin
api.study('my_study', 'My study', batch='my-study')(my_study_fn)
api.metric('my.figure', 'My figure', 'mm', 'lower', study='my_study')(lambda doc: doc['summary']['mm'])
api.exporter('my_format', 'My format')(my_export_fn)
api.dataset_reader('my_format', sniff=my_sniff)(my_open_fn)
api.library_folder(os.path.join(os.path.dirname(__file__), 'library'))
api.check('my.vs_closed_form', 'My study against a closed form', 'mm error', 'the closed form',
0.01, 'mm', references={'me2026': 'A. Author, "Title", URL (read 2026-11-07).'})(my_check_fn)
# a validation check of the plugin's model (plugin.my_plugin), run by
# --validate and Help ▸ Validate the models with the built-in checks
api.page('my_page', 'My study', 'my_plugin.page:MyPage', menu='Analysis') # the class is imported only
# when the window is built
The entry point may name a function or a module (its register is called). DexVantage loads plugins once at start-up
(app.py, before the batch flags are built, so a plugin study gets its --flag too), and the Python API loads them on
first use (dexvantage.api). Help ▸ Plugins lists every plugin found: its name, version, what it added and, for a plugin
that failed, why, in a plain sentence. A plugin that fails is rolled back (what it added before the failure is removed)
and the app carries on; its traceback goes to the log (stderr), never to the UI.
--no-plugins (or the environment variable DEXVANTAGE_NO_PLUGINS=1) finds the installed plugins without loading
them: they are listed as "off".
Rules a plugin follows (checked where they can be): ids are new (a plugin cannot replace a built-in study, metric,
exporter or dataset format: the duplicate is skipped and said so); study ids are lower-case words joined by
underscores (no dots: factor paths and settings use the dot); a page class is given as "module:Class" so headless use
never imports Qt; a plugin's figures follow docs/DEVELOPING.md like DexVantage's own (cited or None). A plugin may set
REQUIRES_API = n in its module; one that needs a newer plugin API than API_VERSION is refused with a sentence.
API load(enabled=True, entry_points=None, paths=None) -> [PluginRecord] once; again with reload=True loaded() -> [PluginRecord] what the last load found (for Help ▸ Plugins and dv.plugins()) discover(paths=None) -> [EntryPoint] the installed entry points of the group (paths: search there) unload(name) remove what a plugin added (tests; a plugin turned off) origin(kind, id) -> plugin name | None which plugin added a study / metric / exporter / reader / page / check summary_text(record) -> str "2 studies (a, b), 1 metric (c)": what it added, in words
Known limits: a plugin runs in the same process with the same rights as DexVantage (there is no sandbox: install only plugins you trust); unloading removes what a plugin registered, not modules it imported or state it changed in other ways; UI pages are added when the window is built, so a plugin loaded later (from the Python API in a running window) adds its page only after a restart; a page whose id equals a built-in page's id is replaced by the built-in one (the plugin's record says so: page_replaced).
plugin_sdk.PluginAPI(record: PluginRecord)
What a plugin's register(api) receives: one per plugin, recording what it adds (shown in Help ▸ Plugins and removed again when the plugin fails or is unloaded).
PluginAPI.Outcome
What a validation check returns (validation/suite.py Outcome: error, detail, figure, rows, ...).
PluginAPI.StudyError
No docstring.
PluginAPI.check(cid: str, title: str, quantity: str, reference: str, tolerance: float, unit: str, references: dict | None = None, refs: Iterable[str] | None = None, cost: str = 'cheap', tolerance_quick: float | None = None, model_title: str = '') -> Callable[[Callable], Callable]
Decorator: register fn(ctx) -> api.Outcome as a validation check (validation/suite.py @check) of this plugin's model, 'plugin.<plugin name>' (model_title: its title in the report, default "<name> (plugin)"), so --validate, the self-test's cheap run and Help ▸ Validate the models run it with DexVantage's own checks. reference: the independent reference in words; tolerance: the error the check accepts (say why in the reference or the plugin's docs, as docs/DEVELOPING.md asks); references: {key: the full citation with its URL and the date read}, added to the report's reference list (refs: the keys this check cites, default all of references; a key DexVantage already has may be cited by name).
PluginAPI.dataset_reader(fmt: str, sniff: Callable[[str], bool], title: str = '') -> Callable[[Callable], Callable]
Decorator: register open(path) -> core.datasets.Dataset for the format fmt; sniff(path) -> bool says whether a path is in it. title: the format's name in words ('' = fmt).
PluginAPI.dv
The Python API (dexvantage.api): dv.sample, Rig, Result, ...
PluginAPI.exporter(fid: str, title: str, needs_robot: bool = False, description: str = '') -> Callable[[Callable], Callable]
Decorator: register fn(project, out_dir, options, ctx) -> {'files', 'notes'} (core.exporters.exporter).
PluginAPI.jobs
No docstring.
PluginAPI.library_folder(path: str) -> None
Read library entries (one JSON per device, the library schema) from this folder too; read-only, like the built-in library. Entries whose id is already taken are skipped (Library problems say so).
PluginAPI.metric(mid: str, title: str, unit: str, better: str, study: str, note: str = '', tags: Iterable[str] = ()) -> Callable[[Callable], Callable]
Decorator: register extract(doc) -> float | None as a metric (core.metrics.metric).
PluginAPI.page(pid: str, title: str, cls: type | str, menu: str = 'Analysis', icon: str | None = None, action_id: str | None = None, shortcut: str | None = None, workspace: str | None = None, order: int = 200) -> type | str
A UI page (ui/pages registry). cls: a StudyPage subclass or "module:Class" (imported when the window is built: headless use of the plugin never imports Qt).
PluginAPI.study(sid: str, title: str, quick: bool = False, batch: str = '', needs_robot: bool = False) -> Callable[[Callable], Callable]
Decorator: register fn(project, ctx) -> dict as a study (core.jobs.study). batch: its batch flag without dashes ('' for none).
plugin_sdk.PluginError(…)
A plugin asked for something DexVantage cannot give it; the message says what, in plain words.
plugin_sdk.discover(paths: Iterable[str | os.PathLike] | None = None) -> list
The entry points of the group: installed ones, or those of the distributions found on paths (folders, as importlib.metadata searches them: a pip --target folder, a site-packages).
plugin_sdk.load(enabled: bool | None = None, entry_points: Iterable[EntryPoint] | None = None, paths: Iterable[str | os.PathLike] | None = None, reload: bool = False) -> list
Find and load the plugins once (again with reload=True, which unloads the previous ones first). enabled=None follows DEXVANTAGE_NO_PLUGINS; False finds them without loading (status 'off'). entry_points: load these instead of the installed ones (tests); paths: find them on these folders instead of sys.path.
plugin_sdk.loaded() -> list
No docstring.
plugin_sdk.enabled() -> bool
False when this session was started with --no-plugins (or DEXVANTAGE_NO_PLUGINS).
plugin_sdk.unload(name: str) -> None
Remove everything the named plugin added (studies, metrics, exporters, readers, library folders, pages, checks with their model and references).
plugin_sdk.report_lines() -> list
One plain line per plugin, for the terminal (--list-plugins) and the self-test.