openodd_py
ASAM OpenODD 1.0 for Python, on a Rust core.
-
Read an ODD from OpenODD YAML (taxonomy, modules,
IMPORT, unit conversions) and a binding file saying how each concept is measured.openodd-taxonomy-units model.xmlwrites the units an EA taxonomy model defines (tier4/taxonomy'staxonomy_master.xml) as theconversion:block an ODD imports.openodd-taxonomy-check reference.yaml --odd my.binding.yaml --rules rules.yamllists the concepts they use that a shared taxonomy lacks or declares otherwise -- and drafts the issue proposing each missing one. -
Judge values against it with OpenODD's three-valued, missing-value semantics, and work out which buckets of each attribute lie outside it.
-
Version it: an ODD's revision is the digest of the transmission it was read from (see docs/versioning.md), and the transmission packs into a deterministic archive the ODD reads back from exactly.
-
Cover what runs drive:
CoverageCollectorsamples cover items and the ODD's attributes step by step (hits, seconds, metres, entries,min_stay, situations, steps outside the ODD) and writes a coverage file;merge_coverage/openodd-coveragemerge any number into a report, and--export-codwrites each run's ODD samples as an OpenODD COD table (section 8.3) with its manifest and taxonomy. -
Sample the next runs from the ODD (
OddSampler), aimed at what coverage left uncovered, or with a share of them in chosen modules -- 30% inheavy_rain(docs/weighted_sampling.md). -
Find flaky cases:
FlakySearchlearns where runs pass and fail (Gaussian-process classification in the Rust core) and draws part of each batch where a small change flips the outcome, keeping the sampler's own policy for the rest. Each case getsflip_probability,instability_confidenceandrobustness_radius(docs/flaky.md). A run's coverage file can record its case, the predicted flakiness and its outcome; the merged report reassesses them, and the next campaign's search starts from them. -
See it:
CoverageViewrenders an ODD matrix -- any two attributes, coloured flaky / fails / passes / outside the ODD / not sampled -- that drills into a cell for the next two, as an HTML component other tools embed or a standalone page (openodd-coverage --html); theopenodd-coverage-viewcrate (docs/coverage_view.md). -
See the drawn cases:
CasePlotplaces every case of a sampled sweep at the values it was drawn with -- any two attributes of its space, ODD bucket edges as grid lines -- as a pass dot, a fail cross or a flaky ring withpasses/runs, over a faint background of the pass probability the flaky model fitted to the runs predicts there (red low, yellow ~50% / unstable, green high), with a table of the cases run more than once; embeddable likeCoverageView, or a page (openodd-coverage --cases-html) (docs/case_plot.md). -
Drawn vs measured: the case plot can place cases by what the run measured at its start instead of what the sampler drew, and the scenario-realisation view shows, per attribute, how far the scenario staged each run from its draw -- bias, MAE, bucket hit rate, and the knob correction a least-squares fit suggests (
CasePlot.drift_html,openodd-coverage --drift-html; docs/drift.md). -
In the browser: both views compile to WebAssembly (
crates/openodd-wasm): a web page computes the matrix and the case plot -- the flaky model's background included -- from coverage JSON on the client, with live axis pickers; no Python, no server (docs/wasm.md, demo in examples/wasm-viewer). -
Edit an ODD in the browser, visually:
crates/openodd-editordraws the ODD as it is edited, with this library's reader compiled to WebAssembly:- a graph of roots, modules and the attributes they test;
- a map of any two attributes;
- each attribute's domain, allowed or excluded;
- number lines whose condition ends you drag;
- a test drive judging values live.
Its Rules mode edits a backend's rule files as forms: each part's distribution drawn over its input with draggable points, its values as a table, and each quantity's distribution as the inputs move. Its Graph mode edits the same rules as a factor graph: drag a variable onto a factor to make it read the variable, quantities chaining into others. Load measured rows as JSON and Fit the graph to them by maximum likelihood, in the browser. Its Binding mode edits how each attribute is measured. With a backend's manifest (
Backend.manifest()), it follows each attribute from the ODD through the binding and the backend's knobs to the rules that read it. It is written in Rust and Leptos, with no server (docs/editor.md, demo at hakuturu583.github.io/openodd_py). -
Comparing two sets on one ODD: the same views with two sets of runs laid over one another -- a baseline and, say, the next version of the software -- each cell and each case split in two and outlined by how its failure rate moved, behind the cases the change of the predicted pass rate (docs/compare.md).
-
Test report:
openodd-test-report runs/ -o report.htmllays a campaign's coverage files out as one HTML page -- verdict, results per scenario, every failed run, ODD coverage, flakiness and the interactive views -- with an analysis Claude writes through the Claude Agent SDK. Claude reads the report only through tools of its own, and follows theodd-test-analysisskill, which ships in the package as a Claude Code plugin along with the prompts (pip install "openodd-py[agent]";TestReport,openodd.agent.analyze; docs/test_report.md). -
Find flaky regions of the ODD: the merged report counts, per ODD cell, the runs that drove through it, how many failed (with a 95% Wilson interval) and how many failed in it, per scenario and environment (
CoverageReport.cell_flakiness, docs/flaky.md). -
Weigh importance-sampled runs: a run that records its likelihood ratio (
record_outcome(passed, weight=...), NADE's weight say) counts in the merged report's naturalistic failure rate per scenario and environment -- the mean of the weighted failures, its 95% interval, the relative half width it has converged to and Kish's effective number of runs (CoverageReport.weighted_outcomes, docs/flaky.md). -
Write an ODD in Python instead of YAML (
OddDefinition,OddAttribute,OddModule), register it by name (register_odd, theopenodd.oddsentry point group), and let users pick one by a string -- a bundled or registered name, a.yamlfile orpackage.module:function(resolve_odd; docs/python_odd.md).
What measures the attributes -- a simulator, a recorded log -- is the application's
backend: a subclass of openodd.Backend naming its probes, how a run sets an
attribute (knob), and where the ego is (position, geolocation). Everything
else is this library's.
- Derive with rules: what a run's settings do to the rest of it -- a
simulator's rain to the road's grip -- a backend may write as conditional
distributions in YAML (
Rules, evaluated in the Rust core): per quantity, a distribution's parameters at points of its inputs, interpolated between them; a quantity may read another, so the rules form a graph (Rules.sample). It holds its own (Backend.rules), a run reads another file over them (Backend.use_rules),Backend.derived_range("tire_friction", {"water": 70})gives the range andBackend.derived_at(..., quantile)the value a run draws (docs/rules.md). Fit them to data:Rules.fit(rows)(oropenodd-rules-fit rules.yaml drives.csv -o fitted.yaml) estimates every parameter at every point by maximum likelihood from values measured together in the real world, factor by factor through the graph -- holding what the rule file (fixed:) or the call (fixed=[...]) says must not move -- and writes the fitted rules as a file extending the original (docs/rules.md). In the browser,RulesViewdraws them as an embeddable component: each part's distribution over its input, and the quantity's at the inputs chosen (docs/wasm.md).
A default ODD ships with the package (openodd.bundled_odd(),
python/openodd/odds/default): every attribute a road-vehicle
simulator commonly measures, after ISO 34503, and no modules. Its binding names the probes
a backend provides (ego_speed_kph, measure: vehicle_ahead_gap_m, ...); its revision
changes only when its files do.
import openodd
backend = openodd.Backend(probes={"speed_kph": (read_speed, "km/h")})
odd = openodd.load_odd_binding("urban.yaml", backend=backend)
verdict = odd.evaluate(odd.sample(context))
odd.revision # sha256 of the files it was read from
odd.archive() # those files as a deterministic .tar.gz
collector = openodd.CoverageCollector(items, odd=odd, backend=backend)
collector.start(context, 0.0)
collector.tick(context, 0.05) # after every step
collector.end(context, 0.05)
collector.write(Path("run_coverage.json"), "my_scenario")
Coverage
A coverage document records, besides each item's buckets, how a run spent its
time across the ODD's buckets: OddCells adds up steps, seconds and metres per
cell -- one bucket of each attribute, as its cover item buckets it -- so a
consumer can slice runs by any attributes without the per-step values:
cells = openodd.OddCells(odd)
cells.add(values, seconds=dt, meters=ds) # every step: each attribute's value
cells.to_dict()
# {"attributes": ["speed", "rain"], "rows": [[["[30, 60]", "heavy"], 812, 40.6, 588.2], ...]}
A missing value is <missing>, a number outside the buckets <below> / <above>.
Each item's definition (describe()) names the measure its coverage is read from
(amount: hits, counted.seconds, ...) and, for an ODD attribute's item, the
attribute (attribute). openodd.__version__ is the installed version, for
coverage files to say what wrote them.
Development
uv venv && uv pip install maturin pytest hypothesis pyyaml
maturin develop
cargo test --workspace && pytest
Releasing
Releases are cut by labels, as in simple_lanelet2. Put exactly one of
release:major, release:minor or release:patch on a PR; when it is merged into
main, the release workflow bumps the version in
Cargo.toml and Cargo.lock with tools/bump_version.py, commits
chore(release): vX.Y.Z and tags it, runs the tests again, builds the wheels (Linux
x86_64/aarch64, macOS universal2, Windows x64) and the sdist, tests each wheel, and attaches them to a
GitHub release with generated notes, and publishes them to PyPI with Trusted
Publishing. A PR without a label releases nothing. The
release label check runs on every PR: it creates any missing release:* label, fails if the PR carries more than one, and
says in its summary which release the merge will cut.
A hand-pushed v* tag is built and published the same way (its version must match
Cargo.toml), and running the workflow by hand builds everything without publishing.
Metadata
Release files for openodd-py 0.32.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openodd_py-0.32.0.tar.gz | 540.8 kB | With provenance | Details for openodd_py-0.32.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| openodd_py-0.32.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for openodd_py-0.32.0-cp310-abi3-win_amd64.whl |
| openodd_py-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for openodd_py-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| openodd_py-0.32.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for openodd_py-0.32.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| openodd_py-0.32.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for openodd_py-0.32.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 14.5 MB
Release files / openodd_py-0.32.0.tar.gz
| Download URL | openodd_py-0.32.0.tar.gz |
|---|---|
| Size | 540.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49cd9ae453fb8eb84d75f17ec64f8c1ff675b6c94b59c5a61007267f2b43cf9f
|
|
BLAKE2b-256 checksum How to use checksums |
b6a8a157a1b731d7fb03e33eb759bb0d88de44ffa2daddf0780c1b38ca5cf5d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / openodd_py-0.32.0-cp310-abi3-win_amd64.whl
| Download URL | openodd_py-0.32.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8b123c7d75da78d5770506f4b795c76d0a0e9a871727ff42f20260984ec18f5a
|
|
BLAKE2b-256 checksum How to use checksums |
0ca74c4447197bb285d5728eab1ccc11d8bc7b162ce638c8eef66f959b4cc7f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / openodd_py-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | openodd_py-0.32.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7e2c26a7cc67b71d2bcdbd5a57b542c7ce310123a48fadd1e907993b0911ad6b
|
|
BLAKE2b-256 checksum How to use checksums |
c107fe9f507dbaaf88de81845a67a4e28e404beaa4cc761720f56d92d1b56799
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / openodd_py-0.32.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | openodd_py-0.32.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d7615e6e0eb22789f1798215c88107e20e7a8ca1cd5d26f77f385e3c594dc549
|
|
BLAKE2b-256 checksum How to use checksums |
9be06924c2dc9f3e77ead3fed1fd7c0b19a511bea71201abbb48a26d395321ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / openodd_py-0.32.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | openodd_py-0.32.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d08a0cda9685df9571db45b7f7f41e3489ed7b1488d5b7fd6ceeefd6aafb9cf1
|
|
BLAKE2b-256 checksum How to use checksums |
900eaa6c18a632cb28a4533ec4c2b39be26f8d1a00a19af5978385cec51a1ae0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for openodd-py 0.32.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for openodd_py-0.32.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.