You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use clear errors for invalid annotation writer inputs #797
write_annotations and Annotation.write pass some validation failures through from the legacy annotation writer as tuple-valued exceptions. The new path-based API should report plain, specific messages.
Examples:
wfdb.Annotation("x", "atr", np.array([1])).write("x.atr")
# Exception: ('At least one annotation label field is required ...', (...))wfdb.Annotation("x", "atr", [], symbol=[]).write("x.atr")
# TypeError: ('The sample field must be one of the following types:', (...))
The first case should raise ValueError explaining that a non-empty annotation needs a label field. The second should raise TypeError explaining that sample must be a one-dimensional NumPy array. Keep validation and error messages consistent between write_annotations and Annotation.write; add focused tests for both cases.
Follow-up to #796. Empty annotations are valid there; this issue concerns invalid inputs to the new writers.
Activity