biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Scatter Plot: "No data on input" signal summary #5834

Closed mw25 closed 2 years ago

mw25 commented 2 years ago

What's wrong? Scatter Plot doesn't show the correct input signal summary. It always says "No data on input": image

How can we reproduce the problem?

See screenshot. Error is independent of whether the data subset input is used or not.

What's your environment?

VesnaT commented 2 years ago

This stopped working in version 4.14.1 of orange-widget-base (e48b9c78).

It happens to all widgets that override set_data (could be any other handler) and invoke parents method within, e.g. SVM:

    def set_data(self, data):
        self.Warning.sparse_data.clear()
        super().set_data(data)
        if self.data and sp.issparse(self.data.X):
            self.Warning.sparse_data()
janezd commented 2 years ago

The problem is that widgets that override a handler must also redecorate it (in this case, with @Inputs.data). The test for this feature does it (https://github.com/biolab/orange-widget-base/commit/fe176f71547ff0dcd15e9b77a71ddbf3d7aabcdc#diff-37fa07c738eae3e261e558e3f3eed3bcfb6be97674f74348daf50a8a4d2d0c0fR495), while OWScatteplotGraph does not.

Alternatively, the summarize wrapper could use some more advanced test for whether the method was overriden but not redecorated, but this could be more complicated (I suppose it would involve checking the mro) and prone to fail. I'd suggest we just add decorators where needed.