-
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
Casting the frame id from scientific number format fails #778
Comments
I guest this is the precision issue of the library decimal |
Are there more possible workarounds ? |
I don't know a better workaround.
|
Thanks for fixing. Probably you have a clean database example without scientific numbers. I'll give you short exctract from the dbc in my case: BA_ "GenMsgCycleTime" BO_ 2360127010 100; As you can see the attribute "GenMsgSendType" is marginally small number and could surely be replaced by zero, but this would require manual post-editing in an ASCII text editor after each change of the database in Vector DB Editor. |
@ebroecker, when are you planning to merge the current branch into master ? |
should be merged, if not please blame me |
db.enum_attribs_to_values()
File "C:\…\MdfMetaData.venv\Lib\site-packages\canmatrix\canmatrix.py", line 2317, in e
num_attribs_to_values
frame.attributes[define] = self.frame_defines[define].values[int(frame.attributes[define])]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '8.52715012702708E-317'
Please consider the casting to float before int. Example:
frame.attributes[define] = self.frame_defines[define].values[int(float(frame.attributes[define]))]
The text was updated successfully, but these errors were encountered: