Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 705 Bytes

summarize.rst

File metadata and controls

27 lines (18 loc) · 705 Bytes

Summarize

Warning

⚠️ UserWarning: register 'summarize' function for type ndarray.

To correct this warning, we need to implement summarize. First, we import:

from orangewidget.utils.signals import summarize, PartialSummary

Then we implement:

@summarize.register
def summarize_ndarray(a: np.ndarray):
    return PartialSummary(f"{a.shape[0]}x{a.shape[1]}", f"Image of size {a.shape[0]}x{a.shape[1]}")

When we run orange-canvas we see the partial summary under the info box, and if we click on it, we get whole summary:

Image size summary.