Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified data slicing in BLFReader for when the object type is CAN_ME… #1825

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions can/io/blf.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def _parse_data(self, data):
is_remote_frame=bool(flags & REMOTE_FLAG),
is_rx=not bool(flags & DIR),
dlc=dlc,
data=can_data[:dlc],
data=can_data,
channel=channel - 1,
)
elif obj_type == CAN_ERROR_EXT:
Expand All @@ -290,7 +290,7 @@ def _parse_data(self, data):
is_extended_id=bool(can_id & CAN_MSG_EXT),
arbitration_id=can_id & 0x1FFFFFFF,
dlc=dlc,
data=can_data[:dlc],
data=can_data,
channel=channel - 1,
)
elif obj_type == CAN_FD_MESSAGE:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "python-can"
dynamic = ["readme", "version"]
dynamic = ["readme"]
version = "4.3.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo this. The version is set by setuptools-scm from the git tag.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now undone. Please accept if no other problems. Thank you

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pratik-mahamuni the tests are failing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zariiii9003 modified the method equals from the Message class based on the intricacies of how the tests are modeled in the repository. This change could be deemed temporary as the current implementation of the loggers_test.py uses the same data and constructor for all file types (ASC, BLF, CSV etc.).

As equals is used only in tests and not for logic in the code (based on a quick grep), the small change should not have side-effects. I will let you be the judge for that.

description = "Controller Area Network interface module for Python"
authors = [{ name = "python-can contributors" }]
dependencies = [
Expand Down
Loading