Skip to content

xdd: Implement option to load object dictionary from XDD file.#614

Open
zaporozhets wants to merge 1 commit intocanopen-python:masterfrom
zaporozhets:feat/add_xdd_parser
Open

xdd: Implement option to load object dictionary from XDD file.#614
zaporozhets wants to merge 1 commit intocanopen-python:masterfrom
zaporozhets:feat/add_xdd_parser

Conversation

@zaporozhets
Copy link

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

@zaporozhets zaporozhets force-pushed the feat/add_xdd_parser branch 2 times, most recently from ea733fe to 466b1b2 Compare September 11, 2025 17:14
@codecov
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 70.28302% with 63 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
canopen/objectdictionary/xdd.py 68.61% 44 Missing and 15 partials ⚠️
canopen/utils.py 76.47% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@zaporozhets zaporozhets marked this pull request as ready for review September 25, 2025 15:52
@zaporozhets
Copy link
Author

Hi @acolomb, could you please take a look?

@acolomb
Copy link
Member

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.utils module, 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.xdd file? 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.

Copy link
Member

@acolomb acolomb left a 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.

@tomasbarton-stemcell
Copy link

hi @zaporozhets, thanks for the work on this PR! Are you still planning to continue with it? I have a project where I could really use xdd/xdc parsing right now, so I'd be glad to pick up where you left off and contribute to this effort if you don't have the bandwidth.

@zaporozhets
Copy link
Author

@acolomb, thank you for the review, and @tomasbarton-stemcell for your interest in this feature.

I was extremely busy last year and didn’t have the chance to address all the comments.

I’m currently on sick leave until Monday, so I finally have some time to catch up. Please give me a few days to refresh my memory and go through all the suggestions. I’ll keep you posted. I’ll definitely appreciate a thorough review here, as Python isn’t really my main area of expertise.

BR,
Taras

@zaporozhets zaporozhets force-pushed the feat/add_xdd_parser branch 3 times, most recently from 3070327 to 47656be Compare March 17, 2026 20:30
Signed-off-by: Taras Zaporozhets <zaporozhets.taras@gmail.com>
@zaporozhets zaporozhets force-pushed the feat/add_xdd_parser branch from 47656be to 95c8be2 Compare March 22, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants