Skip to content

API reference

k4Bench is a small, importable Python package. This page is the entry point to the auto-generated reference — the pages under it are built from the live docstrings and type hints by mkdocstrings, so they never drift from the code.

Docstring quality is doc quality

Because these pages render the source docstrings directly, improving a docstring improves the docs.

How to import

# High-level orchestration
from k4bench.benchmark.ddsim import BenchmarkConfig, SweepMode, run_sweep

# Results
from k4bench.results.model import RunResult

# Geometry
from k4bench.geometry.scanner import get_detector_names, resolve_includes
from k4bench.geometry.patcher import patched_geometry, patched_geometry_keep_only

# Analysis (the most common public surface)
from k4bench.analysis import (
    load_results, load_event_timing, load_region_timing,
    plot_run_overview, plot_event_timing, plot_event_memory, plot_region_timing,
)

The modules at a glance

Module Public surface Page
k4bench.cli main cli
k4bench.benchmark.ddsim BenchmarkConfig, SweepMode, run_sweep benchmark.ddsim
k4bench.geometry.scanner get_detector_names, resolve_includes geometry.scanner
k4bench.geometry.patcher patched_geometry, patched_geometry_keep_only, build_patched_xml, DetectorNotFoundError geometry.patcher
k4bench.runner.executor run_ddsim runner.executor
k4bench.runner.parser parse_time_output runner.parser
k4bench.results.model RunResult results.model
k4bench.results.reporter print_summary, save_csv results.reporter
k4bench.plugin.runtime setup_plugin_environment, find_plugin_lib_dir, ensure_plugin_built plugin.runtime
k4bench.analysis the loaders + plot functions analysis

The complete, navigable tree is in the API section of the sidebar.

Stability

The functions and dataclasses listed above are the intended public API. Underscore-prefixed names are internal, may change without notice, and are excluded from these generated pages. The project is young and evolving, so even the public surface may shift between releases — pin a version if you depend on it programmatically.

See also