Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically set input/output summary #5108

Closed
janezd opened this issue Dec 4, 2020 · 1 comment
Closed

Automatically set input/output summary #5108

janezd opened this issue Dec 4, 2020 · 1 comment
Assignees

Comments

@janezd
Copy link
Contributor

janezd commented Dec 4, 2020

@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.

  1. 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).
  2. For the sake of backward compatilibility or perhaps also for future convenience, calling set_input_summary/set_output_summary sets this flag to False.
  3. The redundant code is removed from widgets, together with corresponding tests (see Assert minus, not empty string for empty brief msg #5002).

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 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.

@janezd janezd added the needs discussion Core developers need to discuss the issue label Jan 29, 2021
@janezd janezd removed the needs discussion Core developers need to discuss the issue label Feb 11, 2021
@janezd janezd self-assigned this Mar 4, 2021
@janezd
Copy link
Contributor Author

janezd commented May 7, 2021

Done in #5308.

@janezd janezd closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant