-
Notifications
You must be signed in to change notification settings - Fork 386
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
canmatrix.py --> decimal.InvalidOperation: [<class 'decimal.DivisionUndefined'>] #773
Comments
issue #766 looks similar |
Some Idea: canmatrix for now only uses Maybe your ARXML uses |
I used dbc file as input not an ARXML |
Oh sorry you are right... Do you have a chance to check the dbc itself? |
So, I checked the DBC file now and identified, that the DBC is buggy. According the documentation in https://www.influxtechnology.com/post/understanding-can-dbc So, I presume this definition of a DBC file I received is wrong, right? So the question to me is if such an issue shall be handled in the library. I don't know as well if the scaling factor shall not be 0. So far, I didn't find any CANdbc file spec. But what I see from Vectors CANdb++ tool, the factor for the given signal was interpreted as 1. |
Hi @daestx thanks for your analysis. Maybe I'll add some warning if scale is 0 and set it to 1 |
should be merged |
I have an issue with doing a diff on two DBC files. I get following debug info:
File "canmatrix\formats_init_.py", line 79, in loadp_flat
File "canmatrix\formats_init_.py", line 71, in loadp
File "canmatrix\formats_init_.py", line 90, in load
File "canmatrix\formats\dbc.py", line 960, in load
File "canmatrix\canmatrix.py", line 450, in phys2raw
decimal.InvalidOperation: [<class 'decimal.DivisionUndefined'>]
coming from this line
raw_value = (self.float_factory(value) - self.float_factory(self.offset)) / self.float_factory(self.factor)
obviously, division by 0 is not handled correctly.
I changed the code as workaround
please check if there is a better solution
The text was updated successfully, but these errors were encountered: