Python implementation of NCodec.#22
Conversation
There was a problem hiding this comment.
The AutomotiveBus should be installed as a dependency directly from the whl file (rather than duplicated code).
https://github.com/boschglobal/automotive-bus-schema/releases/download/v1.0.16/automotive_bus_schema-1.0.16-py3-none-any.whl
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Python implementation of the NCodec library for automotive bus communication, providing encoding/decoding functionality for PDU (Protocol Data Unit) and CAN (Controller Area Network) messages using FlatBuffers serialization.
Key changes:
- Complete Python package structure with codec implementations for PDU and CAN protocols
- Comprehensive test suite covering codec construction, interface polymorphism, and message serialization/deserialization
- FMPy integration example demonstrating FMU (Functional Mock-up Unit) simulation with NCodec
Reviewed Changes
Copilot reviewed 76 out of 87 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| extra/python/src/ncodec/*.py | Core codec implementation including PDU/CAN codecs, interface abstractions, and MIME type handling |
| extra/python/src/AutomotiveBus/**/*.py | Auto-generated FlatBuffers Python bindings for stream/frame/signal/register protocols |
| extra/python/tests/*.py | Unit tests for PDU codec, CAN codec, and codec factory interface |
| extra/python/pyproject.toml | Package configuration defining dependencies and build metadata |
| dse/ncodec/examples/fmpy/* | FMPy integration example with C wrapper and simulation script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SomeIpMetadata.AddReturnCode(self.builder, adapter.return_code) | ||
| return SomeIpMetadata.End(self.builder) | ||
|
|
||
| def emitIpMessageMetdata(self, msg: PduMessage) -> any: |
There was a problem hiding this comment.
Corrected spelling of 'Metdata' to 'Metadata' in method name.
| def emitIpMessageMetdata(self, msg: PduMessage) -> any: | |
| def emitIpMessageMetadata(self, msg: PduMessage) -> any: |
| elif codec_type == "can": | ||
| return CodecFactory.create_can_codec(MimeMap, Stream, ModelName, SimulationTime) | ||
| else: | ||
| raise ValueError(f"Unsupported codec type: {codec_type}") |
There was a problem hiding this comment.
Error message uses 'Unsupported codec type' but test expects 'unsupported type' (lowercase, no 'codec' word). This inconsistency will cause test failure.
| raise ValueError(f"Unsupported codec type: {codec_type}") | |
| raise ValueError(f"unsupported type: {codec_type}") |
| version = "0.0.1" | ||
| description = "Python implementation of the dse.ncodec project." | ||
| authors = [ | ||
| { name = "Your Name", email = "your.email@example.com" } |
There was a problem hiding this comment.
Placeholder author information should be replaced with actual project contact details.
| { name = "Your Name", email = "your.email@example.com" } | |
| { name = "Jane Doe", email = "jane.doe@projectdomain.com" } |
No description provided.