Skip to content
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

Convert DBC to arxml failed #756

Open
hejiashou opened this issue Jan 4, 2024 · 3 comments
Open

Convert DBC to arxml failed #756

hejiashou opened this issue Jan 4, 2024 · 3 comments
Assignees
Labels

Comments

@hejiashou
Copy link

Traceback (most recent call last):
File "/home/hjs/.local/bin/canconvert", line 8, in
sys.exit(cli_convert())
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/cli/convert.py", line 158, in cli_convert
canmatrix.convert.convert(infile, outfile, **options)
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/convert.py", line 351, in convert
canmatrix.formats.dumpp(out_dbs, out_file_name, **options)
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/formats/init.py", line 119, in dumpp
dump(can_cluster, file_object, export_type, **options)
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/formats/init.py", line 106, in dump
module_instance.dump(can_matrix_or_cluster, file_object, **options) # type: ignore
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/formats/arxml.py", line 800, in dump
for value in sorted(signal.values, key=lambda x: int(x, 0)):
File "/home/hjs/.local/lib/python3.10/site-packages/canmatrix/formats/arxml.py", line 800, in
for value in sorted(signal.values, key=lambda x: int(x, 0)):
TypeError: int() can't convert non-string with explicit base

@pempem98
Copy link
Contributor

pempem98 commented Jan 4, 2024

@hejiashou let try to use int(x) instead of int(x, 0)

@ebroecker ebroecker self-assigned this Jan 12, 2024
@ebroecker ebroecker added the bug label Jan 12, 2024
@bijeshmohan
Copy link

bijeshmohan commented Jan 18, 2024

I am also experiencing this issue! When can we expect this to be resolved? With proper guidance I might also be able to fix this.

INFO - convert - done

INFO - convert - Exporting easy.arxml ...
INFO - convert -
INFO - convert - 2 Frames found
Traceback (most recent call last):
  File "/home/bijesh/Playground/python/can/venv/bin/canconvert", line 8, in <module>
    sys.exit(cli_convert())
             ^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/cli/convert.py", line 158, in cli_convert
    canmatrix.convert.convert(infile, outfile, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/convert.py", line 351, in convert
    canmatrix.formats.dumpp(out_dbs, out_file_name, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/__init__.py", line 119, in dumpp
    dump(can_cluster, file_object, export_type, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/__init__.py", line 106, in dump
    module_instance.dump(can_matrix_or_cluster, file_object, **options)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/arxml.py", line 800, in dump
    for value in sorted(signal.values, key=lambda x: int(x, 0)):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/arxml.py", line 800, in <lambda>
    for value in sorted(signal.values, key=lambda x: int(x, 0)):
                                                     ^^^^^^^^^
TypeError: int() can't convert non-string with explicit base```

@pempem98
Copy link
Contributor

I am also experiencing this issue! When can we expect this to be resolved? With proper guidance I might also be able to fix this.

INFO - convert - done

INFO - convert - Exporting easy.arxml ...
INFO - convert -
INFO - convert - 2 Frames found
Traceback (most recent call last):
  File "/home/bijesh/Playground/python/can/venv/bin/canconvert", line 8, in <module>
    sys.exit(cli_convert())
             ^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/cli/convert.py", line 158, in cli_convert
    canmatrix.convert.convert(infile, outfile, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/convert.py", line 351, in convert
    canmatrix.formats.dumpp(out_dbs, out_file_name, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/__init__.py", line 119, in dumpp
    dump(can_cluster, file_object, export_type, **options)
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/__init__.py", line 106, in dump
    module_instance.dump(can_matrix_or_cluster, file_object, **options)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/arxml.py", line 800, in dump
    for value in sorted(signal.values, key=lambda x: int(x, 0)):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bijesh/Playground/python/can/venv/lib/python3.11/site-packages/canmatrix/formats/arxml.py", line 800, in <lambda>
    for value in sorted(signal.values, key=lambda x: int(x, 0)):
                                                     ^^^^^^^^^
TypeError: int() can't convert non-string with explicit base```

Can I have the input DBC of this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants