v0.1.11-alpha
🎉 v0.1.11 – “Collision Tolerance” 🎉
We’ve made DBC prefixing bullet-proof: no more fatal errors on duplicate message names—now it simply falls back to a unique scheme and logs a warning. Your DBCs always load, no matter how “creative” the naming!
✨ What’s New in v0.1.11
🛠 Resilient Prefixing
Automatic fallback on duplicate message names
When you call load_dbc_files(..., prefix_signals=True) and two or more messages share the same name, canml now emits a warning and prefixes signals as instead of raising an error.
🎨 API Behavior
prefix_signals=True
- Unique message names → prefixes remain _
- Duplicate message names → fallback prefixes include the CAN frame_id for guaranteed uniqueness
🔧 Quickstart
pip install canml==0.1.8from canml.canmlio import (
load_dbc_files, load_blf, to_csv, to_parquet, CanmlConfig
)
# 1️⃣ Merge & cache your DBC(s) safely
db = load_dbc_files(["vehicle.dbc", "chassis.dbc"], prefix_signals=True)
# 2️⃣ Configure BLF loading once
cfg = CanmlConfig(
chunk_size=5000,
progress_bar=True,
force_uniform_timing=True,
interval_seconds=0.02,
interpolate_missing=True,
dtype_map={"Engine_RPM": "int32"}
)
# 3️⃣ Full‐file decode with filters, injection, and enums
df = load_blf(
blf_path="drive.blf",
db=db,
config=cfg,
message_ids={0x100, 0x200},
expected_signals=["Engine_RPM", "Brake_Active"]
)
print(df.head())
# timestamp Engine_RPM Brake_Active raw_timestamp
# 0 0.00 8000 0 162523.1
# 1 0.02 8050 0 162523.3
# 4️⃣ Export with metadata side-dump
to_csv(df, "drive_data.csv", metadata_path="drive_data_meta.json")
to_parquet(df, "drive_data.parquet", metadata_path="drive_data_meta.json")Massive thanks to all contributors and issue reporters—enjoy the smoother, smarter CAN-ML! 🎉🎉