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

Fix error on yakut/cmd/monitor/_model.py #108

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

VasileiosVasilopoulos
Copy link
Contributor

System Configuration:

Ubuntu -> 24.04 LTS
Python -> 3.12.3
Interface -> Cyphal Serial

While passing a Node List (7519.List.1.0.dsdl) from a hardware node to Ubuntu, yakut monitor produces the following error:

pycyphal.util._broadcast: Unhandled exception in <bound method Avatar._on_trace of Avatar(node_id=219)>: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
File "/home/$USER/.local/lib/python3.12/site-packages/yakut/cmd/monitor/_model.py", line 195, in expand_subjects
if m.mask:
^^^^^^
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The node list is produced using .h files produced by nnvg and the "mask_bitpacked_" field is used instead of "sparse_list" The error is solved by first checking that the mask is not None and then checking if it is empty with .any().


Authored-by" Vasileios Vasilopoulos[email protected]

System Configuration:

Ubuntu    -> 24.04 LTS
Python    -> 3.12.3
Interface -> Cyphal Serial

While passing a Node List (7519.List.1.0.dsdl) from a hardware node
to Ubuntu, yakut monitor produces the following error:

pycyphal.util._broadcast: Unhandled exception in <bound method Avatar._on_trace of Avatar(node_id=219)>:
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  File "/home/$USER/.local/lib/python3.12/site-packages/yakut/cmd/monitor/_model.py", line 195, in expand_subjects
    if m.mask:
       ^^^^^^
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The node list is produced using .h files produced by nnvg and the "mask_bitpacked_" field is used instead of "sparse_list"
The error is solved by first checking that the mask is not None and then checking if it is empty with .any().

---------

Authored-by" Vasileios Vasilopoulos<[email protected]>
Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful. Please bump the patch version and we'll merge it.

yakut/cmd/monitor/_model.py Outdated Show resolved Hide resolved
Runs on PRs from forks
@pavel-kirienko pavel-kirienko enabled auto-merge (squash) July 29, 2024 11:07
@pavel-kirienko
Copy link
Member

The CI failure is due to a DSDL upgrade not related to this changeset, so I will merge it anyway.

@pavel-kirienko pavel-kirienko disabled auto-merge July 29, 2024 12:27
@pavel-kirienko pavel-kirienko merged commit 3a22dd4 into OpenCyphal:main Jul 29, 2024
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants