Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,12 @@ jobs:

- name: Validate JSON schemas
run: |
python -c "from pathlib import Path; import json; from jsonschema import Draft202012Validator; root=Path('schemas');
[Draft202012Validator.check_schema(json.loads(p.read_text(encoding='utf-8'))) for p in root.glob('*.json')]; print('schemas ok')"
python -c "
from pathlib import Path
import json
from jsonschema import Draft202012Validator
root = Path('schemas')
for p in root.glob('*.json'):
Draft202012Validator.check_schema(json.loads(p.read_text(encoding='utf-8')))
print('schemas ok')
"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ captures/community/*
*.log
!captures/synthetic/*.log
!captures/synthetic/*.asc
!tests/fixtures/*.log

# Regenerable opendbc fetch cache
research/_opendbc_fetch/
Expand Down
6 changes: 6 additions & 0 deletions docs/generated/buses.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
| Platform | Bus ID | OEM name | Bitrate | Confidence |
|----------|--------|----------|---------|------------|
| `honda.accord.gen10.us` | `vehicle_can` | — | UNKNOWN | DOCUMENTED |
| `honda.accord.gen11.us` | `pt_canfd` | Powertrain CAN-FD (opendbc Bus.pt) | UNKNOWN | UNKNOWN |
| `honda.civic.gen10.us` | `vehicle_can` | — | UNKNOWN | DOCUMENTED |
| `honda.civic.gen11.us` | `vehicle_can` | — | UNKNOWN | DOCUMENTED |
| `honda.civic.gen7.us` | `obd_kline` | OBD-II K-Line (ISO 9141-2 / ISO 14230-4) | 10400 | DOCUMENTED |
| `honda.civic.gen7.us` | `f_can` | F-CAN (if present) | UNKNOWN | UNKNOWN |
| `honda.civic.gen7.us` | `b_can` | B-CAN / body multiplex | UNKNOWN | UNKNOWN |
| `honda.civic.gen8.us` | `f_can` | F-CAN | 500000 | DOCUMENTED |
| `honda.civic.gen8.us` | `b_can` | B-CAN | 33333 | DOCUMENTED |
| `honda.civic.gen9.us` | `f_can` | F-CAN / OBD-II CAN | 500000 | DOCUMENTED |
| `honda.civic.gen9.us` | `b_can` | B-CAN | UNKNOWN | UNKNOWN |
| `honda.crv.gen5.us` | `vehicle_can` | — | UNKNOWN | DOCUMENTED |
| `honda.crv.gen6.us` | `pt_canfd` | Powertrain CAN-FD (opendbc Bus.pt) | UNKNOWN | UNKNOWN |
| `honda.element.gen1.us` | `unknown_can` | — | UNKNOWN | UNKNOWN |
| `honda.fit.gen3.us` | `vehicle_can` | F-CAN | UNKNOWN | DOCUMENTED |
| `honda.hrv.gen2.us` | `unknown_can` | — | UNKNOWN | UNKNOWN |
| `honda.insight.gen3.us` | `vehicle_can` | F-CAN | UNKNOWN | DOCUMENTED |
| `honda.odyssey.gen5.us` | `vehicle_can` | F-CAN | UNKNOWN | DOCUMENTED |
| `honda.pilot.gen3.us` | `unknown_can` | — | UNKNOWN | UNKNOWN |
| `honda.pilot.gen4.us` | `pt_canfd` | Powertrain CAN-FD (opendbc Bus.pt) | UNKNOWN | UNKNOWN |
| `honda.prelude.gen5.us` | `unknown_can` | — | UNKNOWN | UNKNOWN |
| `honda.ridgeline.gen2.us` | `unknown_can` | — | UNKNOWN | UNKNOWN |
4 changes: 4 additions & 0 deletions docs/generated/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ _Auto-generated. Confidence labels only — not hardware claims._
| Platform | RPM | SPEED | FUEL | TEMP | GEAR | TURN | ABS | SRS |
|----------|------|------|------|------|------|------|------|------|
| `honda.accord.gen10.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.accord.gen11.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen10.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.civic.gen11.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.civic.gen7.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen8.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen9.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.crv.gen5.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.crv.gen6.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.element.gen1.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.fit.gen3.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.hrv.gen2.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.insight.gen3.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.odyssey.gen5.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.pilot.gen3.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.pilot.gen4.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.prelude.gen5.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.ridgeline.gen2.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |

Expand Down
4 changes: 4 additions & 0 deletions docs/generated/honda_coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ _Auto-generated. Confidence labels only — not hardware claims._
| Platform | RPM | SPEED | FUEL | TEMP | GEAR | TURN | ABS | SRS |
|----------|------|------|------|------|------|------|------|------|
| `honda.accord.gen10.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.accord.gen11.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen10.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.civic.gen11.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.civic.gen7.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen8.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.civic.gen9.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.crv.gen5.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.crv.gen6.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.element.gen1.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.fit.gen3.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.hrv.gen2.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.insight.gen3.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.odyssey.gen5.us` | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN | DOCUMENTED | DOCUMENTED | UNKNOWN | UNKNOWN |
| `honda.pilot.gen3.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.pilot.gen4.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.prelude.gen5.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
| `honda.ridgeline.gen2.us` | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
3 changes: 3 additions & 0 deletions docs/generated/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
| `honda.civic.gen11.us` | `eps` | vehicle_can | chassis | DOCUMENTED |
| `honda.civic.gen11.us` | `adas` | vehicle_can | adas | DOCUMENTED |
| `honda.civic.gen11.us` | `cluster` | vehicle_can | cluster | INFERRED |
| `honda.civic.gen7.us` | `pcm` | obd_kline | powertrain | DOCUMENTED |
| `honda.civic.gen7.us` | `micu` | b_can | body | COMMUNITY_REPORTED |
| `honda.civic.gen7.us` | `gauge` | UNKNOWN | cluster | UNKNOWN |
| `honda.civic.gen8.us` | `pcm` | f_can | powertrain | DOCUMENTED |
| `honda.civic.gen8.us` | `abs_vsa` | f_can | chassis | DOCUMENTED |
| `honda.civic.gen8.us` | `bcm` | b_can | body | DOCUMENTED |
Expand Down
4 changes: 4 additions & 0 deletions docs/generated/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ _Auto-generated from protocol YAML. UNKNOWN is valid._
| Platform | Years | Roles | Buses | Messages | Signals | Cluster |
|----------|-------|-------|-------|----------|---------|---------|
| `honda.accord.gen10.us` | 2018-2022 | target | 1 | 16 | 23 | `honda.accord.gen10.cluster.digital` |
| `honda.accord.gen11.us` | 2023-2026 | target | 1 | 0 | 0 | `—` |
| `honda.civic.gen10.us` | 2016-2021 | target,source | 1 | 16 | 25 | `honda.civic.gen10.cluster.digital` |
| `honda.civic.gen11.us` | 2022-2026 | target | 1 | 16 | 23 | `honda.civic.gen11.cluster.digital` |
| `honda.civic.gen7.us` | 2001-2005 | source | 3 | 0 | 8 | `—` |
| `honda.civic.gen8.us` | 2006-2011 | source | 2 | 3 | 8 | `—` |
| `honda.civic.gen9.us` | 2012-2015 | source | 2 | 0 | 9 | `—` |
| `honda.crv.gen5.us` | 2017-2022 | target | 1 | 17 | 23 | `honda.crv.gen5.cluster.digital` |
| `honda.crv.gen6.us` | 2023-2026 | target | 1 | 0 | 0 | `—` |
| `honda.element.gen1.us` | 2003-2011 | source | 1 | 0 | 0 | `—` |
| `honda.fit.gen3.us` | 2015-2020 | source | 1 | 13 | 27 | `—` |
| `honda.hrv.gen2.us` | 2023-2026 | source | 1 | 0 | 0 | `—` |
| `honda.insight.gen3.us` | 2019-2022 | source,target | 1 | 14 | 28 | `—` |
| `honda.odyssey.gen5.us` | 2018-2025 | source | 1 | 15 | 28 | `—` |
| `honda.pilot.gen3.us` | 2016-2022 | source | 1 | 0 | 0 | `—` |
| `honda.pilot.gen4.us` | 2023-2026 | target | 1 | 0 | 0 | `—` |
| `honda.prelude.gen5.us` | 1997-2001 | source | 1 | 0 | 0 | `—` |
| `honda.ridgeline.gen2.us` | 2017-2025 | source | 1 | 0 | 0 | `—` |
8 changes: 8 additions & 0 deletions docs/generated/signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
| `honda.civic.gen11.us` | `safety.seatbelt_passenger` | `0x305` | DOCUMENTED | False |
| `honda.civic.gen11.us` | `adas.acc_state` | `0x17C` | DOCUMENTED | False |
| `honda.civic.gen11.us` | `vehicle.ignition_state` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `powertrain.engine_rpm` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `vehicle.speed` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `powertrain.coolant_temperature` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `fuel.level` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `transmission.gear` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `lighting.left_indicator` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `lighting.right_indicator` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen7.us` | `vehicle.ignition_state` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen8.us` | `powertrain.engine_rpm` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen8.us` | `vehicle.speed` | `UNKNOWN` | UNKNOWN | False |
| `honda.civic.gen8.us` | `powertrain.coolant_temperature` | `UNKNOWN` | UNKNOWN | False |
Expand Down
4 changes: 4 additions & 0 deletions docs/generated/vehicles.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ _Auto-generated from protocol YAML._
| Platform | Manufacturer | Model | Gen | Years | Roles | Validation |
|----------|--------------|-------|-----|-------|-------|------------|
| `honda.accord.gen10.us` | honda | accord | 10 | 2018-2022 | target | incomplete |
| `honda.accord.gen11.us` | honda | accord | 11 | 2023-2026 | target | incomplete |
| `honda.civic.gen10.us` | honda | civic | 10 | 2016-2021 | target,source | incomplete |
| `honda.civic.gen11.us` | honda | civic | 11 | 2022-2026 | target | incomplete |
| `honda.civic.gen7.us` | honda | civic | 7 | 2001-2005 | source | incomplete |
| `honda.civic.gen8.us` | honda | civic | 8 | 2006-2011 | source | incomplete |
| `honda.civic.gen9.us` | honda | civic | 9 | 2012-2015 | source | incomplete |
| `honda.crv.gen5.us` | honda | crv | 5 | 2017-2022 | target | incomplete |
| `honda.crv.gen6.us` | honda | crv | 6 | 2023-2026 | target | incomplete |
| `honda.element.gen1.us` | honda | element | 1 | 2003-2011 | source | incomplete |
| `honda.fit.gen3.us` | honda | fit | 3 | 2015-2020 | source | incomplete |
| `honda.hrv.gen2.us` | honda | hrv | 2 | 2023-2026 | source | incomplete |
| `honda.insight.gen3.us` | honda | insight | 3 | 2019-2022 | source,target | incomplete |
| `honda.odyssey.gen5.us` | honda | odyssey | 5 | 2018-2025 | source | incomplete |
| `honda.pilot.gen3.us` | honda | pilot | 3 | 2016-2022 | source | incomplete |
| `honda.pilot.gen4.us` | honda | pilot | 4 | 2023-2026 | target | incomplete |
| `honda.prelude.gen5.us` | honda | prelude | 5 | 1997-2001 | source | incomplete |
| `honda.ridgeline.gen2.us` | honda | ridgeline | 2 | 2017-2025 | source | incomplete |
10 changes: 3 additions & 7 deletions opendashcan/adaptation/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,14 @@ def build_adapter(

# Phase 4: per-function SOURCE/TARGET/TRANSLATION/TIMING/INTEGRITY/CLUSTER RX/VALIDATION
try:
from opendashcan.cluster.gaps import build_gap_report
from opendashcan.cluster.environment_loader import CLUSTER_ALIASES
from opendashcan.cluster.gaps import build_gap_report

gap_key = CLUSTER_ALIASES.get(target) or CLUSTER_ALIASES.get(adaptation.cluster_id)
if gap_key:
gap = build_gap_report(
gap_key,
source_confidence_map={
r.signal: r.source_confidence for r in adaptation.rows
},
source_confidence_map={r.signal: r.source_confidence for r in adaptation.rows},
)
functions = []
for row in gap["rows"]:
Expand All @@ -202,9 +200,7 @@ def build_adapter(
"signal": row["signal"],
"SOURCE": axes["A"],
"TARGET": axes["B"],
"TRANSLATION": (
plan_row.translation if plan_row else "UNKNOWN"
),
"TRANSLATION": (plan_row.translation if plan_row else "UNKNOWN"),
"PRODUCER": axes["C"],
"BUS": axes["D"],
"CLUSTER_RX": axes["E"],
Expand Down
3 changes: 1 addition & 2 deletions opendashcan/adaptation/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def format_text(self) -> str:
lines += ["", "TARGET CLUSTER"]
if tgt:
lines.append(
f" {tgt.cluster_id} display={tgt.display_type} "
f"status={tgt.compatibility_status}"
f" {tgt.cluster_id} display={tgt.display_type} status={tgt.compatibility_status}"
)
else:
lines.append(f" {self.cluster_id} (no cluster.yaml)")
Expand Down
4 changes: 1 addition & 3 deletions opendashcan/adaptation/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def schedule_from_package(pkg: PlatformPackage) -> SchedulePlan:
return SchedulePlan(platform_id=pkg.platform_id, messages=msgs)


def schedule_from_specs(
platform_id: str, specs: list[PeriodicFrameSpec]
) -> SchedulePlan:
def schedule_from_specs(platform_id: str, specs: list[PeriodicFrameSpec]) -> SchedulePlan:
msgs = [
ScheduledMessage(
arbitration_id=hex(s.arbitration_id),
Expand Down
4 changes: 1 addition & 3 deletions opendashcan/analysis/conflicts_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ def format_conflicts_text(data: dict[str, Any] | None = None) -> str:
lines += ["", "## Lineage encoding"]
for c in data["lineage_encoding_conflicts"][:50]:
aid = c.get("arbitration_id") or c.get("name")
lines.append(
f"- {aid}: {c.get('detail')} vehicles={c.get('vehicles')}"
)
lines.append(f"- {aid}: {c.get('detail')} vehicles={c.get('vehicles')}")
lines.append("")
return "\n".join(lines)

Expand Down
2 changes: 1 addition & 1 deletion opendashcan/analysis/dbc_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def build_dbc_inventory(*, out_dir: Path | None = None) -> dict[str, Any]:
bus=entry.get("bus", "vehicle_can"),
)
platform_hint = entry.get("platform") or entry.get("vehicle")
vehicle_summary = {
vehicle_summary: dict[str, Any] = {
"file": entry["file"],
"vehicle_id": result.vehicle_id,
"bus": entry.get("bus", "vehicle_can"),
Expand Down
16 changes: 5 additions & 11 deletions opendashcan/analysis/lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ def compare_encodings(a: dict[str, Any], b: dict[str, Any]) -> dict[str, Any]:
}
)
identical = (
same_id
and same_dlc
and same_name
and not only_a
and not only_b
and not encoding_mismatches
same_id and same_dlc and same_name and not only_a and not only_b and not encoding_mismatches
)
return {
"identical_encoding": identical,
Expand Down Expand Up @@ -169,7 +164,7 @@ def build_lineage(*, messages: list[dict[str, Any]] | None = None) -> dict[str,
# Name collisions across different IDs
name_collisions = []
for name, group in sorted(by_name.items()):
ids = sorted({g.get("id_dec") for g in group if g.get("id_dec") is not None})
ids = sorted(int(i) for i in {g.get("id_dec") for g in group} if isinstance(i, int))
if len(ids) > 1:
name_collisions.append(
{
Expand All @@ -195,9 +190,7 @@ def build_lineage(*, messages: list[dict[str, Any]] | None = None) -> dict[str,
for g in id_groups
if g["identical_across_all"] and g["vehicle_count"] >= 2
],
"divergent_ids": [
g["arbitration_id"] for g in id_groups if not g["identical_across_all"]
],
"divergent_ids": [g["arbitration_id"] for g in id_groups if not g["identical_across_all"]],
}


Expand Down Expand Up @@ -246,8 +239,9 @@ def write_lineage_artifacts(
f"vehicles={g['vehicle_count']} variants={g['encoding_variant_count']}"
)
for d in g["encoding_differences"][:3]:
n_mismatch = len(d.get("encoding_mismatches") or [])
lines.append(
f" - vs `{d.get('vehicle_id')}`: mismatches={len(d.get('encoding_mismatches') or [])} "
f" - vs `{d.get('vehicle_id')}`: mismatches={n_mismatch} "
f"only_a={d.get('signals_only_in_a')} only_b={d.get('signals_only_in_b')}"
)
lines += ["", "## Name collisions (different IDs)", ""]
Expand Down
6 changes: 2 additions & 4 deletions opendashcan/analysis/network_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from pathlib import Path
from typing import Any

from opendashcan.cluster.classify import classify_from_dbc_message
from opendashcan.analysis.lineage import _load_indexed_messages
from opendashcan.cluster.classify import classify_from_dbc_message

REPO_ROOT = Path(__file__).resolve().parents[2]

Expand Down Expand Up @@ -49,9 +49,7 @@ def build_network_graph(
msgs = messages if messages is not None else _load_indexed_messages()
if cluster_platform_filter:
msgs = [
m
for m in msgs
if cluster_platform_filter in str(m.get("vehicle_id") or "")
m for m in msgs if cluster_platform_filter in str(m.get("vehicle_id") or "")
] or msgs # fall back to all if filter empty

nodes: dict[str, dict[str, Any]] = {}
Expand Down
2 changes: 1 addition & 1 deletion opendashcan/analysis/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path
from typing import Any

from opendashcan.analysis.lineage import _load_indexed_messages, compare_encodings
from opendashcan.dbc import taxonomy_implementations_from_imports
from pathlib import Path


@dataclass
Expand Down
Loading
Loading