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
@irgolic said that we could get rid of duplicated code for setting and testing summaries (see #5002) by putting the code for setting the summaries and for calling them into Orange.widgets.widget.OWWidget. Discussion (@irgolic, @markotoplak, @janezd) led to the following.
Summary is set automatically under the following conditions:
widget has the default signal
the default signal is of type Table
widget does not set the flag, named sth like auto_set_summary (but better) to False (default is True).
For the sake of backward compatilibility or perhaps also for future convenience, calling set_input_summary/set_output_summary sets this flag to False.
Output is easy. The obvious place to trigger this for output is Orange.widgets.widget.OWWidget.send.
For input, there is no such spot. orangewidget.utils.signals.InputSignal.__call__ is a decorator that registers input, but returns the method essentially undecorated. We could derive a new class, Orange.widgets.widget.Input that would wrap the method into one that would call set_input_summary. However, this solution not only introduces magic, but may also be inconsistent with what happens in the widget: the input signal handler may reject the data (e.g. sth. like self.data = None), but the summary would still be set.
The text was updated successfully, but these errors were encountered:
@irgolic said that we could get rid of duplicated code for setting and testing summaries (see #5002) by putting the code for setting the summaries and for calling them into
Orange.widgets.widget.OWWidget
. Discussion (@irgolic, @markotoplak, @janezd) led to the following.Table
auto_set_summary
(but better) toFalse
(default isTrue
).set_input_summary
/set_output_summary
sets this flag toFalse
.Afterthoughts:
If we do this, we can probably close biolab/orange-widget-base#101?
Output is easy. The obvious place to trigger this for output is
Orange.widgets.widget.OWWidget.send
.For input, there is no such spot.
orangewidget.utils.signals.InputSignal.__call__
is a decorator that registers input, but returns the method essentially undecorated. We could derive a new class,Orange.widgets.widget.Input
that would wrap the method into one that would callset_input_summary
. However, this solution not only introduces magic, but may also be inconsistent with what happens in the widget: the input signal handler may reject the data (e.g. sth. likeself.data = None
), but the summary would still be set.The text was updated successfully, but these errors were encountered: