-
Notifications
You must be signed in to change notification settings - Fork 82
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
comparaminstance.spec property is not available during object creation #392
comparaminstance.spec property is not available during object creation #392
Conversation
can you provide a traceback? (does the exception happen in your own code or somewhere within odxtools.) The point with this is that using |
The traceback is already included (screenshot) This PR just reverts the change from https://github.com/mercedes-benz/odxtools/pull/386/files#r1952936788 to unblock the situation. you can do a follow up PR with a more proper fix. |
Yes, but I'm a bit confused: for me, loading a PDX file works fine using the current |
@andlaus In Line 154 in 1e5f030
Creating the NamedItemList causes short_name getter to be called |
I understand. What I don't get is why this is a problem: the spec_ref of the comparam_refs is exclusively resolved in _resolve_odxlinks() and |
@andlaus the files that reported this issue have model version "2.0.1". For the files with model version "2.2.0", the issue is not reproducible. |
okay, thanks for the info. can you dig a deeper into what causes this? I still cannot explain it because regardless of the model version, the odxlink references should be resolved when this |
@andlaus the issue is that while resolving the odxlinks, the comparams were not resolved because:
|
@nada-ben-ali: that sounds a lot like an unrelated issue with the dataset which was uncovered by that change? what do you think about changing the fallback code for ODXLINK resolution if the reference was not found in the specified document fragment to "use the first document fragment which has an object with the specified ID"? |
cool, now I'm happy! thanks for your patience :) |
# In ODX 2.0, COMPARAM-SPEC is used, whereas in ODX 2.2, it refers to something else and has been replaced by COMPARAM-SUBSET. | ||
# - If 'category' is missing (ODX 2.0), use COMPARAM_SPEC, | ||
# - else (ODX 2.2), use COMPARAM_SUBSET. | ||
doc_type = DocType.COMPARAM_SUBSET if category else DocType.COMPARAM_SPEC |
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.
small question (now irrelevant because the PR is already merged): isn't it possible to simply look at et_element.tag
, i.e.
doc_type = DocType.COMPARAM_SUBSET if et_element.tag == "COMPARAM_SUBSET" else DocType.COMPARAM_SPEC
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.
possible
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.
yess, it works as well (the tag is "COMPARAM-SUBSET" instead of "COMPARAM_SUBSET").
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.
I supppose that would be less hacky, but I don't mind if you want to leave it as-is...
Although I tested the changes introduced in #386, after upgrading to the latest odxtools version 9.4.0, we got the issue:
I believe not encountering the issue during testing was due to a Git branching issue :( .