Skip to content

Commit 3a22dd4

Browse files
Fix error on yakut/cmd/monitor/_model.py (#108)
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]> Co-authored-by: Pavel Kirienko <[email protected]>
1 parent 15949ea commit 3a22dd4

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/test-and-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Test and Release Yakut'
2-
on: push
1+
name: 'Test and release Yakut'
2+
on: [ push, pull_request ]
33

44
# Ensures that only one workflow is running at a time
55
concurrency:
@@ -9,6 +9,8 @@ concurrency:
99
jobs:
1010
yakut-test:
1111
name: Test Yakut
12+
# https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request
13+
if: (github.event_name == 'push') || github.event.pull_request.head.repo.fork
1214
strategy:
1315
fail-fast: false
1416
matrix:
@@ -71,7 +73,9 @@ jobs:
7173
yakut-release:
7274
name: Release Yakut
7375
runs-on: ubuntu-latest
74-
if: contains(github.event.head_commit.message, '#release') || contains(github.ref, '/main')
76+
if: >
77+
(github.event_name == 'push') &&
78+
(contains(github.event.head_commit.message, '#release') || contains(github.ref, '/main'))
7579
needs: yakut-test
7680
steps:
7781
- name: Check out

yakut/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.13.2
1+
0.13.3

yakut/cmd/monitor/_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def __repr__(self) -> str:
191191
def expand_subjects(m: uavcan.node.port.SubjectIDList_1) -> AbstractSet[int]:
192192
if m.sparse_list is not None:
193193
return frozenset(int(x.value) for x in m.sparse_list)
194-
if m.mask:
195-
return expand_mask(m.mask)
194+
if m.mask is not None and m.mask.any():
195+
return expand_mask(m.mask)
196196
if m.total:
197197
return _COMPLETE_SUBJECT_SET
198198
assert False

0 commit comments

Comments
 (0)