Fix error on yakut/cmd/monitor/_model.py #108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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]