Skip to content

gesturerec/data.py: get_gesture_names_filtered self-appends; get_random_gesture_set defined twice #21

Description

@jonfroehlich

Found in the #16 correctness/prose/comments audit (verified). Two latent defects in Projects/GestureRecognizer/gesturerec/data.py. Neither is hit by the current notebooks, but both will bite anyone who uses these helpers.

1. get_gesture_names_filtered appends the list to itself (data.py ~line 360):

for gesture_name in self.map_gestures_to_trials.keys():
    if gesture_name not in filter_names:
        gesture_names.append(gesture_names)   # <-- should be gesture_name
return sorted(gesture_names)

It appends the accumulator list to itself instead of the name, so the function returns garbage (and sorted would raise on the nested list). Fix: gesture_names.append(gesture_name).

2. get_random_gesture_set is defined twice (data.py ~lines 371 and 418). The second definition shadows the first; both work, but the duplicate is dead/confusing. Remove one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions