eds: fix LowLimit/HighLimit parsing for all signed integer types#658
Open
friederschueler wants to merge 2 commits intocanopen-python:masterfrom
Open
eds: fix LowLimit/HighLimit parsing for all signed integer types#658friederschueler wants to merge 2 commits intocanopen-python:masterfrom
friederschueler wants to merge 2 commits intocanopen-python:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
Please always separate style changes from functional changes. Except of course fixing in the immediate vicinity of the functional changes. |
131f43e to
27e94d8
Compare
acolomb
requested changes
May 7, 2026
- Replace _calc_bit_length() (only handled INTEGER8/16/32/64) with a lookup dict _SIGNED_BIT_LENGTHS covering all 8 SIGNED_TYPES (INTEGER8/16/24/32/40/48/56/64) - Log a warning instead of silently ignoring invalid limit values (except ValueError: pass) - Add EDS test entries in sample.eds for INTEGER24/40/48/56 with hex-encoded negative limits - Extend test_record_with_limits and add test_invalid_limit_logs_warning Closes part of canopen-python#352.
27e94d8 to
f65a1fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes incomplete signed integer handling for
LowLimit/HighLimitin EDS parsing, as noted in #352.Changes
_calc_bit_length()(only handled INTEGER8/16/32/64) with a lookup dict_SIGNED_BIT_LENGTHScovering all 8SIGNED_TYPES(INTEGER8/16/24/32/40/48/56/64)warninginstead of silently ignoring invalid limit values (except ValueError: pass)sample.edsfor INTEGER24/40/48/56 with hex-encoded negative limitstest_record_with_limitsand addtest_invalid_limit_logs_warningNote on formatting
eds.pyandtest_eds.pywere reformatted with black. If a purely functional diff is preferred, the formatting commits can be dropped — the functional changes are small and easy to separate.Closes part of #352.