-
Notifications
You must be signed in to change notification settings - Fork 81
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
Miscellaneous fixes #386
Miscellaneous fixes #386
Conversation
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
…inition if the specification has not yet been resolved when accesing `.short_name` an exception will be raised (though luck) Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
@@ -1094,7 +1096,8 @@ class SomersaultSID(IntEnum): | |||
oid=None, | |||
odx_id=OdxLinkId("somersault.struct.recall.forward_flips_grudgingly_done", doc_frags), | |||
parameters=somersault_positive_responses["forward_flips_grudgingly_done"].parameters, | |||
byte_size=None), | |||
byte_size=None, | |||
is_visible_raw=None), |
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.
And this is why I hate when they are not used
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 can add them to whole codebase if you want, but that's for another PR...
|
||
# ODXLINK IDs allow dots and hyphens, but short names do not. | ||
# (This should not happen anyway in a correct PDX...) | ||
return self.spec_ref.ref_id.replace(".", "__").replace("-", "_") |
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.
Why?
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.
because accessing the short name before reference resolution IMO ought not to be supported. In particular because the short name would change depending on references have been resolved or not, so this IMO constitutes a medium-sized footgun...
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.
self.spec
is not available during object creation, but short name is used during object creation to populate the named list
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 what I mean with "footgun": if this was done this way, the NamedList
would feature incorrect names because after reference resolution, the short_name
attributes change whilst the list stays the same. This is the reason why the NamedItemList
of ComparamInstance
objects is only created after ODXLINK resolution. My point is that is better to get an exception if the code is incorrect rather than incorrect results...
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
this is probably quite difficult to implement Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
i.e., add deprecated properties using the old name for `.dop`. thanks to [at]kayoub5 for the catch. Signed-off-by: Andreas Lauser <[email protected]>
the nesting was wrong... Signed-off-by: Andreas Lauser <[email protected]>
@kayoub5: do you see any issues which should prevent merging this? |
@nada-ben-ali could you cross this PR against the files we have? I have a feeling one of those many small changes that are standard compliant may not align with real world files. |
@kayoub5 the tests failed for three DIDs. I'm checking the root cause... |
any news on this front @nada-ben-ali? |
I got the following error while encoding: @andlaus I think it's: right? |
@nada-ben-ali what was the "base_type_encoding" used by the ODX file? |
|
thanks to [at]nada-ben-ali for finding this! Signed-off-by: Andreas Lauser <[email protected]>
these encoding issues are probably due to #381, not this PR!? Do you have any idea what actually goes wrong? IIRC, I added comprehensive unit tests for all base type encodings (cf https://github.com/mercedes-benz/odxtools/blob/main/tests/test_encoding.py#L93-L437), but possibly I made a few mistakes there... |
I think we need to fix it here too odxtools/odxtools/encodestate.py Line 160 in 3b369b5
|
as the previous commit, this only affects the non-strict mode. (This time I also checked that there are no more instances of this and that the the reverse does not happen in the inverse function of `DecodeState`... again, thanks to [at]nada-ben-ali for finding this! Signed-off-by: Andreas Lauser <[email protected]>
oops, right. Fixed: a8edd4b (I hope that I did not miss another instance of this...) |
yes it must be due to #381 , we didn't get this issue using release 9.3.0. |
let's get it fixed ASAP... |
@andlaus but I think it's a Pdx file issue, for :
Introducing all encodings of base data type highlighted the Pdx issue, but using the latest fix for @kayoub5 what do you think? |
I agree. Maybe we can allow the BCD encodings for INT32. The spec disallows this, probably because BCD cannot represent negative values, but I have a feeling that negative values are rarely transmitted over the wire anyway... UINT32 using two-complement encoding obviously does not make any sense because UINT32 obviously only works for positive numbers. The question is what ought to happen in such a case if a value where the most significant bit is set is encountered. |
My feeling on this is that someone is not likely to put 2C as encoding by accident (since it's optional), but they may put UINT32 instead of INT32 by accident. |
sounds reasonable. That said, what do the existing commercial tools do in that case and do all that claim to be compliant behave the same? Since this is undefined behaviour, I think odxtools should continue to raise a |
that's ok as well |
@andlaus Could we please have a new release today? The latest changes are urgently required. |
This PR contains a large number of patches for smaller issues which IMO do not merit separate pull requests. Since all patches of this series are self-contained, please let me know if you prefer it to be split into two or three PRs...
Andreas Lauser <[email protected]>, on behalf of MBition GmbH.
Provider Information