Skip to content

Replace assert with ValueError in create_message() #51

@Dpakkk

Description

@Dpakkk

Problem

In helper.py:30, an assert statement is used for input validation:

assert frames.ndim == 4, f"{frames.ndim=}, expected (N, C, H, W)"

Assert statements can be disabled with python -O flag, which would silently skip validation.

Suggested Fix

Replace with explicit ValueError:

if frames.ndim != 4:
    raise ValueError(f"frames.ndim={frames.ndim}, expected 4 (N, C, H, W)")

Note

I already submitted PR #50 for this fix before creating this issue - apologies for not following the proper contribution process. Happy to close the PR if you'd prefer to discuss first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions