-
Notifications
You must be signed in to change notification settings - Fork 221
Comments
xdd: Implement option to load object dictionary from XDD file.#614
xdd: Implement option to load object dictionary from XDD file. #614zaporozhets wants to merge 1 commit intocanopen-python:master from
Conversation
505c938 to
ea733fe
Compare
Signed-off-by: Taras Zaporozhets <zaporozhets.taras@gmail.com>
ea733fe to
466b1b2
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
zaporozhets
commented
Oct 16, 2025
Hi @acolomb, could you please take a look?
acolomb
commented
Oct 26, 2025
Thank you very much for this contribution. Happy to see some progress on the XDD front. I started taking a look and overall I think it's going in a good direction.
Need to take some more time to put down my thoughts in detail, but some high-level pointers first:
- For new code, we expect to have full type annotations. The mypy linter run in the PR checks can give you hints about what needs improvement, or best run it locally. Note that any functions without argument or return type annotations are not even checked by default.
- I don't like the idea of inflating the
canopen.utilsmodule, even though avoiding code duplication is a worthy goal. I'll try to come up with a simplification soon. - Where I do want less duplication is the object code constants declared in both eds.py and xdd.py. Have a look at commits 7c6dee5 and db9110e in master, those can be cherry-picked easily.
- A little more attention to code formatting would be nice. I use flake8 locally and try to keep it from complaining. Will report any outstanding issues during more thorough review.
- I assume there is no copyright involved for the
sample.xddfile? I don't know where the CANopenNode project got its references from, but just trying to be careful about legal issues with files we include here.
@acolomb
acolomb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a partial review again, but I hope you get the general idea... More to come when I get another look with a fresher brain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a leftover from eds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With static type hints, something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No logging of this failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the names slightly shorter, it's all already in the context of the OD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified in many places, no need for a lambda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could create a autoint = functools.partial(int, base=0) constructor once in this module, then use it to simplify in these cases.
Hi All,
This is a WIP merge request that adds support for XDD import to CANopen. I'm still in the process of testing and making improvements, but I’d appreciate any feedback you might have in the meantime.
Feel free to share any questions or suggestions.
Best regards,
Taras