internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: biolab/orange3

Issue:
Box Plot: enable shrinking further after hiding control area
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.15.dev

##### Expected behavior
Can shrink box plot.


##### Actual behavior
When hiding control area, the widget still cannot be resized.

##### Steps to reproduce the behavior
File - Box Plot - hide control area, try to shrink.

##### Additional info (worksheets, data, screenshots, ...)




Discussion:

Resolving patch:
diff --git a/Orange/widgets/widget.py b/Orange/widgets/widget.py
--- a/Orange/widgets/widget.py
+++ b/Orange/widgets/widget.py
@@ -479,6 +479,12 @@ def copy_to_clipboard(self):
     def storeControlAreaVisibility(self, visible):
         self.controlAreaVisible = visible
 
+        # Set minimum width to 1 (overrides minimumSizeHint) when control area
+        # is not visible to allow the main area to shrink further. Reset the minimum
+        # width with a 0 if control area is visible.
+        self.__splitter.widget(0).setMinimumWidth(int(not visible))
+        self.updateGeometry()
+
     def __restoreWidgetGeometry(self, geometry):
         # type: (bytes) -> bool
         def _fullscreen_to_maximized(geometry):


Test patch:
Repository: biolab/orange3

Issue:
FreeViz: show class density bug

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.10.dev

##### Expected behavior
FreeViz expands class density across the plot.


##### Actual behavior
FreeViz limits class density to a window and expands it only with Optimization.


##### Steps to reproduce the behavior
File (iris) - FreeViz (tick class density) - change dataset to zoo


##### Additional info (worksheets, data, screenshots, ...)
<img width="1200" alt="screen shot 2018-02-16 at 14 45 17" src="https://user-images.githubusercontent.com/12524972/36310547-b42c0220-1328-11e8-9d20-40136eb6de52.png">





Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owfreeviz.py b/Orange/widgets/visualize/owfreeviz.py
--- a/Orange/widgets/visualize/owfreeviz.py
+++ b/Orange/widgets/visualize/owfreeviz.py
@@ -224,7 +224,7 @@ def __init__(self, scatter_widget, parent=None, name="None", view_box=None):
         for axis_loc in ["left", "bottom"]:
             self.plot_widget.hideAxis(axis_loc)
 
-    def update_data(self, attr_x, attr_y, reset_view=True):
+    def update_data(self, attr_x, attr_y, reset_view=False):
         super().update_data(attr_x, attr_y, reset_view=reset_view)
         for axis in ["left", "bottom"]:
             self.plot_widget.hideAxis(axis)
@@ -736,7 +736,7 @@ def setup_plot(self, reset_view=True):
         if reset_view:
             self.viewbox.setRange(RANGE)
             self.viewbox.setAspectLocked(True, 1)
-        self.plot(reset_view=reset_view)
+        self.plot()
 
     def randomize_indices(self):
         X = self._X
@@ -798,7 +798,7 @@ def plot(self, reset_view=False, show_anchors=True):
     def reset_graph_data(self, *_):
         if self.data is not None:
             self.graph.rescale_data()
-            self._update_graph()
+            self._update_graph(reset_view=False)
 
     def _update_graph(self, reset_view=True, **_):
         self.graph.zoomStack = []


Test patch:
Repository: biolab/orange3

Issue:
Rank: suspiciously slow on some computers
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.15.dev

##### Expected behavior
Rank works reasonably fast on computers with sufficient RAM.


##### Actual behavior
Rank is slow on some machines. It worked fine on a PC with 2GB RAM, while it took forever on two with 8GB RAM. All machines are Windows, but it is probably not OS dependent.


##### Steps to reproduce the behavior
Try to rank [blood-loneliness.tab](http://file.biolab.si/datasets/blood-loneliness-GDS3898.tab) with 19335 features.


##### Additional info (worksheets, data, screenshots, ...)





Discussion:
This dataset has continuous features and a discrete class. The only "out of the box" feature scoring method that is available is ANOVA. Other methods have to discretize the features behind the scene. 

There's a problem with feature "ABHD11" - it is always nan (in fact, there's 860 such features). This could potentially trip up imputation, discretization or the feature scoring method. 

We could adapt RemoveConstant for this purpose.

Resolving patch:
diff --git a/Orange/preprocess/score.py b/Orange/preprocess/score.py
--- a/Orange/preprocess/score.py
+++ b/Orange/preprocess/score.py
@@ -8,7 +8,7 @@
 from Orange.data import Domain, Variable, DiscreteVariable, ContinuousVariable
 from Orange.data.filter import HasClass
 from Orange.misc.wrapper_meta import WrapperMeta
-from Orange.preprocess.preprocess import Discretize, Impute
+from Orange.preprocess.preprocess import Discretize, SklImpute
 from Orange.preprocess.util import _RefuseDataInConstructor
 from Orange.statistics import contingency, distribution
 from Orange.util import Reprable
@@ -86,7 +86,7 @@ class SklScorer(Scorer, metaclass=WrapperMeta):
     supports_sparse_data = True
 
     preprocessors = Scorer.preprocessors + [
-        Impute()
+        SklImpute()
     ]
 
     def score_data(self, data, feature):


Test patch:
Repository: biolab/orange3

Issue:
Value.__hash__ is wrong
Hash function should return the same value for all objects that are considered equal.

steps to reproduce:
```
from Orange.data.variable import StringVariable, Value
val = Value(StringVariable("s"), "test")
val == "test"
# True
hash(val) == hash("test")
# False
```


Discussion:
> Hash function should return the same value for all objects that are considered equal.

Could you back this claim?
[`https://docs.python.org/3/reference/datamodel.html#object.__hash__`](https://docs.python.org/3/reference/datamodel.html#object.__hash__)

Resolving patch:
diff --git a/Orange/data/variable.py b/Orange/data/variable.py
--- a/Orange/data/variable.py
+++ b/Orange/data/variable.py
@@ -207,10 +207,15 @@ def __contains__(self, other):
         raise TypeError("invalid operation on Value()")
 
     def __hash__(self):
+        if self.variable.is_discrete:
+            # It is not possible to hash the id and the domain value to the same number as required by __eq__.
+            # hash(1) == hash(Value(DiscreteVariable("var", ["red", "green", "blue"]), 1)) == hash("green")
+            # User should hash directly ids or domain values instead.
+            raise TypeError("unhashable type - cannot hash values of discrete variables!")
         if self._value is None:
             return super().__hash__()
         else:
-            return hash((super().__hash__(), self._value))
+            return hash(self._value)
 
     @property
     def value(self):


Test patch:
diff --git a/Orange/tests/test_value.py b/Orange/tests/test_value.py
--- a/Orange/tests/test_value.py
+++ b/Orange/tests/test_value.py
@@ -5,7 +5,8 @@
 import unittest
 import numpy as np
 
-from Orange.data import Table, Domain, DiscreteVariable
+from Orange.data import Table, Domain, Value,\
+    DiscreteVariable, ContinuousVariable, StringVariable, TimeVariable
 
 
 class TestValue(unittest.TestCase):
@@ -50,3 +51,16 @@ def test_compare_string(self):
         zoo2 = zoo[1]['name']  # antelope
         self.assertTrue(zoo1 < zoo2)
         self.assertTrue(zoo1 >= "aardvark")
+
+    def test_hash(self):
+        v = 1234.5
+        val = Value(ContinuousVariable("var"), v)
+        self.assertTrue(val == v and hash(val) == hash(v))
+        v = "test"
+        val = Value(StringVariable("var"), v)
+        self.assertTrue(val == v and hash(val) == hash(v))
+        v = 1234.5
+        val = Value(TimeVariable("var"), v)
+        self.assertTrue(val == v and hash(val) == hash(v))
+        val = Value(DiscreteVariable("var", ["red", "green", "blue"]), 1)
+        self.assertRaises(TypeError, hash, val)
Repository: biolab/orange3

Issue:
Case sensitive filter in VizRank dialog(s)
Filter in VizRank should be case insensitive.


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/utils/__init__.py b/Orange/widgets/visualize/utils/__init__.py
--- a/Orange/widgets/visualize/utils/__init__.py
+++ b/Orange/widgets/visualize/utils/__init__.py
@@ -116,7 +116,8 @@ def __init__(self, master):
         self.setFocus(Qt.ActiveWindowFocusReason)
 
         self.rank_model = QStandardItemModel(self)
-        self.model_proxy = QSortFilterProxyModel(self)
+        self.model_proxy = QSortFilterProxyModel(
+            self, filterCaseSensitivity=False)
         self.model_proxy.setSourceModel(self.rank_model)
         self.rank_table = view = QTableView(
             selectionBehavior=QTableView.SelectRows,


Test patch:
Repository: biolab/orange3

Issue:
Louvain clustering reruns on every PCA components change
Louvain clustering re-runs every time the PCA components slider is changed, even if Apply PCA preprocessing is disabled.

##### Orange version
master


##### Expected behavior
Only re-run if Appy PCA processing is enabled.


##### Steps to reproduce the behavior
1. Uncheck Apply PCA preprocessing
2. Check Apply automatically
3. Change PCA components slider





Discussion:

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owlouvainclustering.py b/Orange/widgets/unsupervised/owlouvainclustering.py
--- a/Orange/widgets/unsupervised/owlouvainclustering.py
+++ b/Orange/widgets/unsupervised/owlouvainclustering.py
@@ -136,6 +136,9 @@ def __init__(self):
 
     def _invalidate_pca_projection(self):
         self.pca_projection = None
+        if not self.apply_pca:
+            return
+
         self._invalidate_graph()
         self._set_modified(True)
 


Test patch:
diff --git a/Orange/widgets/unsupervised/tests/test_owlouvain.py b/Orange/widgets/unsupervised/tests/test_owlouvain.py
--- a/Orange/widgets/unsupervised/tests/test_owlouvain.py
+++ b/Orange/widgets/unsupervised/tests/test_owlouvain.py
@@ -100,6 +100,38 @@ def test_do_not_recluster_on_same_data(self):
             self.commit_and_wait()
             self.assertEqual(call_count + 1, commit.call_count)
 
+    def test_only_recluster_when_necessary_pca_components_change(self):
+        # Compute clustering on some data
+        self.send_signal(self.widget.Inputs.data, self.iris)
+
+        # When PCA checkbox is ticked, any update to slider should invalidate results
+        self.widget.apply_pca_cbx.setChecked(True)
+        self.widget.pca_components_slider.setValue(2)
+        self.commit_and_wait()
+
+        with patch.object(self.widget, '_invalidate_output') as invalidate:
+            # Change slider value, this should invalidate output
+            self.widget.pca_components_slider.setValue(4)
+            self.commit_and_wait()
+            self.assertEqual(invalidate.call_count, 1)
+
+        with patch.object(self.widget, '_invalidate_output') as invalidate:
+            # Don't change slider value, this shouldn't do anything
+            self.widget.pca_components_slider.setValue(4)
+            self.commit_and_wait()
+            invalidate.assert_not_called()
+
+        # When PCA checkbox is not ticked updating the slider should have no effect
+        self.widget.apply_pca_cbx.setChecked(False)
+        self.widget.pca_components_slider.setValue(2)
+        self.commit_and_wait()
+
+        with patch.object(self.widget, '_invalidate_output') as invalidate:
+            # Change slider value, this should invalidate output
+            self.widget.pca_components_slider.setValue(4)
+            self.commit_and_wait()
+            invalidate.assert_not_called()
+
     def test_invalidate(self):
         # pylint: disable=protected-access
         data = self.iris
Repository: biolab/orange3

Issue:
Scatter Plot shows wrong tooltips
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->

3.17.0



##### Expected behavior

Correct tool tips for point under the cursor

##### Actual behavior

Wrong tool tips for point under the cursor.

##### Steps to reproduce the behavior

brown-selected.tab -> Scatter Plot 

Select 'spo- mid' and 'heat 20' for x and y axis.

The tool tips for the points marked in the screen shot below are wrong.

##### Additional info (worksheets, data, screenshots, ...)

<img width="488" alt="screen shot 2018-11-05 at 10 20 17" src="https://user-images.githubusercontent.com/4716745/47989173-839bef00-e0e4-11e8-90ed-f1d98b46ecb4.png">
 


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/utils/widget.py b/Orange/widgets/visualize/utils/widget.py
--- a/Orange/widgets/visualize/utils/widget.py
+++ b/Orange/widgets/visualize/utils/widget.py
@@ -320,6 +320,8 @@ def get_tooltip(self, point_ids):
         Returns:
             (str):
         """
+        point_ids = \
+            np.flatnonzero(self.valid_data)[np.asarray(point_ids, dtype=int)]
         text = "<hr/>".join(self._point_tooltip(point_id)
                             for point_id in point_ids[:MAX_POINTS_IN_TOOLTIP])
         if len(point_ids) > MAX_POINTS_IN_TOOLTIP:


Test patch:
diff --git a/Orange/widgets/visualize/tests/test_owprojectionwidget.py b/Orange/widgets/visualize/tests/test_owprojectionwidget.py
--- a/Orange/widgets/visualize/tests/test_owprojectionwidget.py
+++ b/Orange/widgets/visualize/tests/test_owprojectionwidget.py
@@ -102,6 +102,16 @@ def test_get_column_merge_infrequent(self):
         np.testing.assert_almost_equal(get_column(disc), x)
         self.assertEqual(get_column(disc, return_labels=True), disc.values)
 
+    def test_get_tooltip(self):
+        widget = self.widget
+        domain = Domain([ContinuousVariable("v")])
+        widget.data = Table.from_numpy(domain, [[1], [2], [3]])
+        widget.valid_data = np.array([True, False, True])
+        self.assertTrue("3" in widget.get_tooltip([1]))
+        self.assertTrue("1" in widget.get_tooltip([0, 1])
+                        and "3" in widget.get_tooltip([0, 1]))
+        self.assertEqual(widget.get_tooltip([]), "")
+
 
 class TestableDataProjectionWidget(OWDataProjectionWidget):
     def get_embedding(self):
Repository: biolab/orange3

Issue:
File widget gives "reader error" on empty URL
##### Orange version

Any recent.

##### Expected behavior

In the file widget, selecting URL when the line edit is empty should output None as data, but without reporting any error.

##### Actual behavior

The widget informs the user about the error when reading the data.


Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owfile.py b/Orange/widgets/data/owfile.py
--- a/Orange/widgets/data/owfile.py
+++ b/Orange/widgets/data/owfile.py
@@ -120,6 +120,9 @@ class Error(widget.OWWidget.Error):
         sheet_error = widget.Msg("Error listing available sheets.")
         unknown = widget.Msg("Read error:\n{}")
 
+    class NoFileSelected:
+        pass
+
     def __init__(self):
         super().__init__()
         RecentPathsWComboMixin.__init__(self)
@@ -306,6 +309,10 @@ def _try_load(self):
             assert self.reader is not None
         except Exception:
             return self.Error.missing_reader
+        
+        if self.reader is self.NoFileSelected:
+            self.Outputs.data.send(None)
+            return
 
         try:
             self._update_sheet_combo()
@@ -338,6 +345,8 @@ def _get_reader(self):
         """
         if self.source == self.LOCAL_FILE:
             path = self.last_path()
+            if path is None:
+                return self.NoFileSelected
             if self.recent_paths and self.recent_paths[0].file_format:
                 qname = self.recent_paths[0].file_format
                 reader_class = class_from_qualified_name(qname)
@@ -351,6 +360,8 @@ def _get_reader(self):
             url = self.url_combo.currentText().strip()
             if url:
                 return UrlReader(url)
+            else:
+                return self.NoFileSelected
 
     def _update_sheet_combo(self):
         if len(self.reader.sheets) < 2:


Test patch:
diff --git a/Orange/widgets/data/tests/test_owfile.py b/Orange/widgets/data/tests/test_owfile.py
--- a/Orange/widgets/data/tests/test_owfile.py
+++ b/Orange/widgets/data/tests/test_owfile.py
@@ -176,6 +176,19 @@ def test_file_not_found(self):
         self.open_dataset("iris")
         self.assertFalse(self.widget.Error.file_not_found.is_shown())
 
+    def test_nothing_selected(self):
+        widget = self.widget = \
+            self.create_widget(OWFile, stored_settings={"recent_paths": []})
+        
+        widget.Outputs.data.send = Mock()
+        widget._try_load()
+        widget.Outputs.data.send.assert_called_with(None)
+
+        widget.Outputs.data.send.reset_mock()
+        widget.source = widget.URL
+        widget._try_load()
+        widget.Outputs.data.send.assert_called_with(None)
+
     def test_check_column_noname(self):
         """
         Column name cannot be changed to an empty string or a string with whitespaces.
Repository: biolab/orange3

Issue:
IndexError:  index 1 is out of bounds for axis 0 with size 0
https://sentry.io/biolab/orange3/issues/783326802/?referrer=github_plugin

```
IndexError:  index 1 is out of bounds for axis 0 with size 0
  Module "Orange.widgets.gui", line 2318, in __call__

    self.func(**kwds)
  Module "Orange.widgets.visualize.owscatterplot", line 430, in attr_changed

    self.setup_plot()
  Module "Orange.widgets.visualize.owscatterplot", line 434, in setup_plot

    super().setup_plot()
  Module "Orange.widgets.visualize.utils.widget", line 455, in setup_plot

    self.apply_selection()
  Module "Orange.widgets.visualize.utils.widget", line 465, in apply_selection

    selection[index_group[0]] = index_group[1]
```


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/utils/widget.py b/Orange/widgets/visualize/utils/widget.py
--- a/Orange/widgets/visualize/utils/widget.py
+++ b/Orange/widgets/visualize/utils/widget.py
@@ -490,11 +490,10 @@ def setup_plot(self):
 
     # Selection
     def apply_selection(self):
-        if self.data is not None and self.__pending_selection is not None \
-                and self.graph.n_valid:
-            index_group = [(index, group) for index, group in
-                           self.__pending_selection if index < len(self.data)]
-            index_group = np.array(index_group).T
+        pending = self.__pending_selection
+        if self.data is not None and pending is not None and len(pending) \
+                and max(i for i, _ in pending) < self.graph.n_valid:
+            index_group = np.array(pending).T
             selection = np.zeros(self.graph.n_valid, dtype=np.uint8)
             selection[index_group[0]] = index_group[1]
 


Test patch:
diff --git a/Orange/widgets/visualize/tests/test_owscatterplot.py b/Orange/widgets/visualize/tests/test_owscatterplot.py
--- a/Orange/widgets/visualize/tests/test_owscatterplot.py
+++ b/Orange/widgets/visualize/tests/test_owscatterplot.py
@@ -282,9 +282,10 @@ def test_invalid_points_selection(self):
             OWScatterPlot, stored_settings={
                 "selection_group": [(i, 1) for i in range(50)]}
         )
-        self.send_signal(self.widget.Inputs.data, self.data[:10])
-        selected_data = self.get_output(self.widget.Outputs.selected_data)
-        self.assertEqual(len(selected_data), 10)
+        data = self.data.copy()[:11]
+        data[0, 0] = np.nan
+        self.send_signal(self.widget.Inputs.data, data)
+        self.assertIsNone(self.get_output(self.widget.Outputs.selected_data))
 
     def test_set_strings_settings(self):
         """
Repository: biolab/orange3

Issue:
Merge Data removes table meta attributes 
##### Orange version
3.16

##### Expected behavior
Merge data should retain table meta attributes (like taxonomy id) from the primary Data Table.

##### Actual behavior
Merge data throws away table meta attributes. 

##### Steps to reproduce the behavior
Run this workflow: [test.ows.zip](https://github.com/biolab/orange3/files/2449733/test.ows.zip) and compare the two Data Infos.
(Requires scOrange).


Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owmergedata.py b/Orange/widgets/data/owmergedata.py
--- a/Orange/widgets/data/owmergedata.py
+++ b/Orange/widgets/data/owmergedata.py
@@ -369,7 +369,11 @@ def _join_table_by_indices(self, reduced_extra, indices):
         string_cols = [i for i, var in enumerate(domain.metas) if var.is_string]
         metas = self._join_array_by_indices(
             self.data.metas, reduced_extra.metas, indices, string_cols)
-        return Orange.data.Table.from_numpy(domain, X, Y, metas)
+        table = Orange.data.Table.from_numpy(domain, X, Y, metas)
+        table.name = getattr(self.data, 'name', '')
+        table.attributes = getattr(self.data, 'attributes', {})
+        table.ids = self.data.ids
+        return table
 
     @staticmethod
     def _join_array_by_indices(left, right, indices, string_cols=None):


Test patch:
diff --git a/Orange/widgets/data/tests/test_owmergedata.py b/Orange/widgets/data/tests/test_owmergedata.py
--- a/Orange/widgets/data/tests/test_owmergedata.py
+++ b/Orange/widgets/data/tests/test_owmergedata.py
@@ -32,7 +32,11 @@ def setUpClass(cls):
         yB = np.array([np.nan, 1, 0])
         metasB = np.array([[np.nan], [1], [0]]).astype(object)
         cls.dataA = Table(domainA, XA, yA, metasA)
+        cls.dataA.name = 'dataA'
+        cls.dataA.attributes = 'dataA attributes'
         cls.dataB = Table(domainB, XB, yB, metasB)
+        cls.dataB.name = 'dataB'
+        cls.dataB.attributes = 'dataB attributes'
 
     def setUp(self):
         self.widget = self.create_widget(OWMergeData)
@@ -231,7 +235,11 @@ def test_output_merge_by_attribute_left(self):
         self.widget.attr_augment_data = domainA[0]
         self.widget.attr_augment_extra = domainB[0]
         self.widget.commit()
-        self.assertTablesEqual(self.get_output(self.widget.Outputs.data), result)
+        output = self.get_output(self.widget.Outputs.data)
+        self.assertTablesEqual(output, result)
+        self.assertEqual(output.name, self.dataA.name)
+        np.testing.assert_array_equal(output.ids, self.dataA.ids)
+        self.assertEqual(output.attributes, self.dataA.attributes)
 
     def test_output_merge_by_attribute_inner(self):
         """Check output for merging option 'Find matching rows' by attribute"""