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

Issue:
PCA does not clear output
PCA widget does not clear output after the input data is removed.

**To reproduce:**
File -> Iris -> PCA -> Data Table -> Remove connection between File and PCA


Discussion:

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owpca.py b/Orange/widgets/unsupervised/owpca.py
--- a/Orange/widgets/unsupervised/owpca.py
+++ b/Orange/widgets/unsupervised/owpca.py
@@ -116,6 +116,8 @@ def set_data(self, data):
         self.clear()
         self.information()
         self.data = None
+        if not data:
+            self.clear_outputs()
         if isinstance(data, SqlTable):
             if data.approx_len() < AUTO_DL_LIMIT:
                 data = Table(data)


Test patch:
diff --git a/Orange/widgets/unsupervised/tests/test_owpca.py b/Orange/widgets/unsupervised/tests/test_owpca.py
--- a/Orange/widgets/unsupervised/tests/test_owpca.py
+++ b/Orange/widgets/unsupervised/tests/test_owpca.py
@@ -248,6 +248,10 @@ def test_output_data(self):
         self.assertEqual(trans.domain.attributes, outdom.metas[1:])
         np.testing.assert_equal(trans.X, output.metas[:, 1:])
 
+        self.send_signal(widget.Inputs.data, None)
+        output = self.get_output(widget.Outputs.data)
+        self.assertIsNone(output)
+
 
 if __name__ == "__main__":
     unittest.main()
Repository: biolab/orange3

Issue:
Add 'Histogram' keyword to Distributions widget



Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owdistributions.py b/Orange/widgets/visualize/owdistributions.py
--- a/Orange/widgets/visualize/owdistributions.py
+++ b/Orange/widgets/visualize/owdistributions.py
@@ -249,7 +249,7 @@ class OWDistributions(OWWidget):
     description = "Display value distributions of a data feature in a graph."
     icon = "icons/Distribution.svg"
     priority = 120
-    keywords = []
+    keywords = ["histogram"]
 
     class Inputs:
         data = Input("Data", Table, doc="Set the input dataset")


Test patch:
Repository: biolab/orange3

Issue:
MDS: pair lines don't follow jittering
When setting jittering on points in MDS, the lines connecting similar pairs don't follow the points. When re-setting the Show similar pairs slider, they get updated.

To reproduce:
Datasets (zoo) - MDS. Jitter the points. Lines are not properly placed after jittering.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owmds.py b/Orange/widgets/unsupervised/owmds.py
--- a/Orange/widgets/unsupervised/owmds.py
+++ b/Orange/widgets/unsupervised/owmds.py
@@ -102,6 +102,10 @@ def update_coordinates(self):
         super().update_coordinates()
         self.update_pairs(reconnect=False)
 
+    def update_jittering(self):
+        super().update_jittering()
+        self.update_pairs(reconnect=False)
+
     def update_pairs(self, reconnect):
         if self.pairs_curve:
             self.plot_widget.removeItem(self.pairs_curve)


Test patch:
Repository: biolab/orange3

Issue:
Rank: use PCA by default on unsupervised data
**Is your feature request related to a problem? Please describe.**

It is unclear how to do unsupervised ranking.

**Describe the solution you'd like**

Use PCA ranking as a default for unsupervised data sets.

**Additional information**

While at it, make attribute selection stick to the top of the widget, not the bottom.


Discussion:
Hm, what is the use case for PCA ranking, actually? What does ranking mean, in the context of unsupervised data?
Remove the tip about PCA from Rank Widget's tooltip and documentation.

Resolving patch:
diff --git a/Orange/widgets/data/owrank.py b/Orange/widgets/data/owrank.py
--- a/Orange/widgets/data/owrank.py
+++ b/Orange/widgets/data/owrank.py
@@ -199,9 +199,7 @@ class Outputs:
     selectionMethod = ContextSetting(SelectNBest)
 
     class Information(OWWidget.Information):
-        no_target_var = Msg("Data does not have a single target variable. "
-                            "You can still connect in unsupervised scorers "
-                            "such as PCA.")
+        no_target_var = Msg("Data does not have a (single) target variable.")
         missings_imputed = Msg('Missing values will be imputed as needed.')
 
     class Error(OWWidget.Error):


Test patch:
Repository: biolab/orange3

Issue:
Reset zoom not working on color regions
**What's wrong?**
Reset zoom is not working when `Show color regions` is selected. Every time you click on it, it even extends the range slightly.

**How can we reproduce the problem?** 
File (Iris) -> Scatter Plot -> select Show color regions -> Zoom out -> click Reset Zoom

**Which version of Orange are you using? How did you install Orange?**
Orange version: master
OS: Ubuntu 16.04


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py
--- a/Orange/widgets/visualize/owscatterplotgraph.py
+++ b/Orange/widgets/visualize/owscatterplotgraph.py
@@ -1157,7 +1157,7 @@ def update_density(self):
             self.density_img = classdensity.class_density_image(
                 min_x, max_x, min_y, max_y, self.resolution,
                 x_data[mask], y_data[mask], rgb_data)
-            self.plot_widget.addItem(self.density_img)
+            self.plot_widget.addItem(self.density_img, ignoreBounds=True)
 
     def update_selection_colors(self):
         """


Test patch:
Repository: biolab/orange3

Issue:
Neighbors widget spoils output domain
**What's wrong?**

Neighbors widget fails to work with data visualisation widgets and sends out the output data that is not compatible with domain of original data set.

**How can we reproduce the problem?**

<img width="1001" alt="image" src="https://user-images.githubusercontent.com/726604/94239133-a2dada00-ff11-11ea-917a-e68506a6d01e.png">

[neighbors-to-scatter.ows.zip](https://github.com/biolab/orange3/files/5281237/neighbors-to-scatter.ows.zip)






Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owneighbors.py b/Orange/widgets/data/owneighbors.py
--- a/Orange/widgets/data/owneighbors.py
+++ b/Orange/widgets/data/owneighbors.py
@@ -182,6 +182,7 @@ def _data_with_similarity(self, indices):
         if data.domain.metas:
             data_metas = np.hstack((data.metas[indices], data_metas))
         neighbors = Table(domain, data.X[indices], data.Y[indices], data_metas)
+        neighbors.ids = data.ids[indices]
         neighbors.attributes = self.data.attributes
         return neighbors
 


Test patch:
diff --git a/Orange/widgets/data/tests/test_owneighbors.py b/Orange/widgets/data/tests/test_owneighbors.py
--- a/Orange/widgets/data/tests/test_owneighbors.py
+++ b/Orange/widgets/data/tests/test_owneighbors.py
@@ -54,11 +54,14 @@ def test_output_neighbors(self):
         """Check if neighbors are on the output after apply"""
         widget = self.widget
         self.assertIsNone(self.get_output("Neighbors"))
-        self.send_signal(widget.Inputs.data, self.iris)
-        self.send_signal(widget.Inputs.reference, self.iris[:10])
+        self.send_signals(((widget.Inputs.data, self.iris),
+                           (widget.Inputs.reference, self.iris[:10])))
         widget.apply_button.button.click()
         self.assertIsNotNone(self.get_output("Neighbors"))
         self.assertIsInstance(self.get_output("Neighbors"), Table)
+        self.assertTrue(all([i in self.iris.ids for i in
+                             self.get_output(widget.Outputs.data).ids])
+                        )
 
     def test_settings(self):
         """Check neighbors for various distance metrics"""
Repository: biolab/orange3

Issue:
Some shapes don't convey selection well
In Scatter Plot, some shapes look almost identical when selected or not selected.
Specifically, the X and the + signs.

![Screenshot 2020-09-04 at 13 28 35](https://user-images.githubusercontent.com/24586651/92234574-9505dc00-eeb2-11ea-8a04-a5b1431728e7.png)
![Screenshot 2020-09-04 at 13 31 03](https://user-images.githubusercontent.com/24586651/92234751-e31adf80-eeb2-11ea-8c66-604473fec375.png)



Discussion:
...I can't reproduce this, selection for me is now orange circles.

<img width="77" alt="Screenshot 2020-09-26 at 20 12 39" src="https://user-images.githubusercontent.com/24586651/94347451-a1ee9900-0034-11eb-8ec6-da922b03520a.png">

Did we make this change recently?
Ah nevermind, I wrote a bad issue. This is about connecting a signal to 'Data Subset', not about selecting on the plot itself.

Resolving patch:
diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py
--- a/Orange/widgets/visualize/owscatterplotgraph.py
+++ b/Orange/widgets/visualize/owscatterplotgraph.py
@@ -256,10 +256,26 @@ def _define_symbols():
     path.lineTo(0.5, 0.5)
     Symbols["?"] = path
 
+    path = QPainterPath()
+    plusCoords = [
+        (-0.5, -0.1), (-0.5, 0.1), (-0.1, 0.1), (-0.1, 0.5),
+        (0.1, 0.5), (0.1, 0.1), (0.5, 0.1), (0.5, -0.1),
+        (0.1, -0.1), (0.1, -0.5), (-0.1, -0.5), (-0.1, -0.1)
+    ]
+    path.moveTo(*plusCoords[0])
+    for x, y in plusCoords[1:]:
+        path.lineTo(x, y)
+    path.closeSubpath()
+    Symbols["+"] = path
+
     tr = QTransform()
     tr.rotate(180)
     Symbols['t'] = tr.map(Symbols['t'])
 
+    tr = QTransform()
+    tr.rotate(45)
+    Symbols['x'] = tr.map(Symbols["+"])
+
 
 _define_symbols()
 


Test patch:
Repository: biolab/orange3

Issue:
Distance Matrix: tries to color by label and crashes on string
- [ ] **What's wrong?**
Distance Matrix crashes when selecting a string label. It also seems to color the headers, which IMHO, doesn't make sense.

- [ ] **How can we reproduce the problem?** 
Datasets (Grades data set) - Distances - Distance Matrix. Select label = name.

- [ ] **Which version of Orange are you using? How did you install Orange?**
3.27.1

- [ ] **What is your operating system?**
OSX



Discussion:

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owdistancematrix.py b/Orange/widgets/unsupervised/owdistancematrix.py
--- a/Orange/widgets/unsupervised/owdistancematrix.py
+++ b/Orange/widgets/unsupervised/owdistancematrix.py
@@ -7,7 +7,7 @@
 from AnyQt.QtCore import Qt, QAbstractTableModel, QModelIndex, \
     QItemSelectionModel, QItemSelection, QSize
 
-from Orange.data import Table, Variable
+from Orange.data import Table, Variable, StringVariable
 from Orange.misc import DistMatrix
 from Orange.widgets import widget, gui
 from Orange.widgets.data.owtable import ranges
@@ -46,7 +46,8 @@ def set_labels(self, labels, variable=None, values=None):
         self.labels = labels
         self.variable = variable
         self.values = values
-        if self.values is not None:
+        if self.values is not None and not isinstance(self.variable,
+                                                      StringVariable):
             self.label_colors = variable.palette.values_to_qcolors(values)
         else:
             self.label_colors = None


Test patch:
diff --git a/Orange/widgets/unsupervised/tests/test_owdistancematrix.py b/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
--- a/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
+++ b/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
@@ -36,3 +36,13 @@ def test_unconditional_commit_on_new_signal(self):
             commit.reset_mock()
             self.send_signal(self.widget.Inputs.distances, self.distances)
             commit.assert_called()
+
+    def test_labels(self):
+        grades = Table.from_url("https://datasets.biolab.si/core/grades-two.tab")
+        distances = Euclidean(grades)
+        self.widget.set_distances(distances)
+        ac = self.widget.annot_combo
+        idx = ac.model().indexOf(grades.domain.metas[0])
+        ac.setCurrentIndex(idx)
+        ac.activated.emit(idx)
+        self.assertIsNone(self.widget.tablemodel.label_colors)
Repository: biolab/orange3

Issue:
AdaBoost Model - Max Number of Estimator is 100
- [ ] **What's wrong?**
when i drop The AdaBoost  model and open it the max number of Estimators is 100 , I think this should be changeable to higher values, as in lib sklearn.

![image](https://user-images.githubusercontent.com/802882/103368266-e4959680-4aa5-11eb-8765-f942a513e8b8.png)

<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->


- [ ] **How can we reproduce the problem?** 
Just Open a AdaBoost Model in a new .ows.


- [ ] **What's your environment?**
- Operating system: Windows 10
- Orange version: 3.27.1
- How you installed Orange: from Anaconda Navigator 3.26 after upgrade with pip to 3.27.1



Discussion:

Resolving patch:
diff --git a/Orange/widgets/model/owadaboost.py b/Orange/widgets/model/owadaboost.py
--- a/Orange/widgets/model/owadaboost.py
+++ b/Orange/widgets/model/owadaboost.py
@@ -52,7 +52,7 @@ def add_main_layout(self):
             box, self, "Base estimator: " + self.base_estimator.name.title())
 
         self.n_estimators_spin = gui.spin(
-            box, self, "n_estimators", 1, 100, label="Number of estimators:",
+            box, self, "n_estimators", 1, 10000, label="Number of estimators:",
             alignment=Qt.AlignRight, controlWidth=80,
             callback=self.settings_changed)
         self.learning_rate_spin = gui.doubleSpin(


Test patch:
Repository: biolab/orange3

Issue:
File: ignore value errors in Excel reader
Excel Reader return string column where #VALUE! errors appear. This happens when the formula cannot be properly applies for the cell.

I propose the reader recognizes this and removes #VALUE! fields, treating them as np.nan. Same perhaps for NULL (tbd).


Discussion:

Resolving patch:
diff --git a/Orange/data/io.py b/Orange/data/io.py
--- a/Orange/data/io.py
+++ b/Orange/data/io.py
@@ -275,6 +275,7 @@ class ExcelReader(_BaseExcelReader):
     """Reader for .xlsx files"""
     EXTENSIONS = ('.xlsx',)
     DESCRIPTION = 'Microsoft Excel spreadsheet'
+    ERRORS = ("#VALUE!", "#DIV/0!", "#REF!", "#NUM!", "#NULL!", "#NAME?")
 
     @property
     def workbook(self) -> openpyxl.Workbook:
@@ -296,7 +297,8 @@ def sheets(self) -> List:
 
     def get_cells(self) -> Iterable:
         def str_(x):
-            return str(x) if x is not None else ""
+            return str(x) if x is not None and x not in ExcelReader.ERRORS \
+                else ""
 
         sheet = self._get_active_sheet()
         min_col = sheet.min_column


Test patch:
diff --git a/Orange/tests/test_xlsx_reader.py b/Orange/tests/test_xlsx_reader.py
--- a/Orange/tests/test_xlsx_reader.py
+++ b/Orange/tests/test_xlsx_reader.py
@@ -181,5 +181,12 @@ def test_read(self, reader: Callable[[str], io.FileFormat]):
             table.metas[:, 2], np.array(list("abcdefghijklmnopqrstuvw")))
 
 
+class TestMissingValues(unittest.TestCase):
+    def test_read_errors(self):
+        table = read_file(get_xlsx_reader, "missing")
+        values = table.get_column_view("C")[0]
+        self.assertTrue(np.isnan(values).all())
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/Orange/tests/xlsx_files/missing.xlsx b/Orange/tests/xlsx_files/missing.xlsx
new file mode 100644
Binary files /dev/null and b/Orange/tests/xlsx_files/missing.xlsx differ
Repository: biolab/orange3

Issue:
Pivot table does not show the expected count and value
- [x] **What's wrong?**
The behavior of the pivot table is different from the doc. I am using the last code from the repo, 3.28.

this is what I see in my Orange:
![image](https://user-images.githubusercontent.com/12781437/104557704-a343e000-567c-11eb-8fad-539978accbc3.png)

and this is what shown in the doc:
![](https://orangedatamining.com/widget-catalog/data/images/Pivot-discrete.png)

You see, the "count" and "majority" are both wrong. 

Or am I missing something here?



Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owpivot.py b/Orange/widgets/data/owpivot.py
--- a/Orange/widgets/data/owpivot.py
+++ b/Orange/widgets/data/owpivot.py
@@ -612,8 +612,11 @@ def __set_vertical_headers(self, table):
             self.table_model.setItem(i + 1, 1, item)
 
     def _set_values(self, table):
+        attrs = table.domain.attributes
         for i, j in product(range(len(table)), range(len(table[0]))):
-            item = self._create_value_item(str(table.X[i, j]))
+            # data is read faster when reading directly from table.X
+            value = table.X[i, j] if attrs[j].is_continuous else table[i, j]
+            item = self._create_value_item(str(value))
             self.table_model.setItem(i + self._n_leading_rows,
                                      j + self._n_leading_cols, item)
 


Test patch:
diff --git a/Orange/widgets/data/tests/test_owpivot.py b/Orange/widgets/data/tests/test_owpivot.py
--- a/Orange/widgets/data/tests/test_owpivot.py
+++ b/Orange/widgets/data/tests/test_owpivot.py
@@ -283,6 +283,25 @@ def test_max_values(self):
         self.send_signal(self.widget.Inputs.data, None)
         self.assertFalse(self.widget.Warning.too_many_values.is_shown())
 
+    def test_table_values(self):
+        self.send_signal(self.widget.Inputs.data, self.heart_disease)
+        domain = self.heart_disease.domain
+        self.agg_checkboxes[Pivot.Functions.Majority.value].click()
+        simulate.combobox_activate_item(self.widget.controls.col_feature,
+                                        domain["gender"].name)
+        simulate.combobox_activate_item(self.widget.controls.val_feature,
+                                        domain["thal"].name)
+
+        model = self.widget.table_view.model()
+        self.assertEqual(model.data(model.index(2, 3)), "72.0")
+        self.assertEqual(model.data(model.index(3, 3)), "normal")
+        self.assertEqual(model.data(model.index(4, 3)), "25.0")
+        self.assertEqual(model.data(model.index(5, 3)), "reversable defect")
+        self.assertEqual(model.data(model.index(2, 4)), "92.0")
+        self.assertEqual(model.data(model.index(3, 4)), "normal")
+        self.assertEqual(model.data(model.index(4, 4)), "114.0")
+        self.assertEqual(model.data(model.index(5, 4)), "reversable defect")
+
 
 class TestAggregationFunctionsEnum(unittest.TestCase):
     def test_pickle(self):
Repository: biolab/orange3

Issue:
Rank widget show inconsistent settings
- [ ] **What's wrong?**

Rank widget does not show that Manual selection is active, if:

1. Best ranked was active.
2. I clicked into the white part of the table to deselect.

The "Select Attributes" radio button still has "Best ranked" active, but nothing is selected (and the status bar shows that nothing gets to the output). Instead, the "Select Attributes" radio button should switch to "Manual", as it does when I click on a row.

- [ ] **How can we reproduce the problem?** 

Use Rank on any dataset, select Best ranked and click into empty space on the right.


- [ ] **What's your environment?**

Orange master on Linux.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owrank.py b/Orange/widgets/data/owrank.py
--- a/Orange/widgets/data/owrank.py
+++ b/Orange/widgets/data/owrank.py
@@ -8,7 +8,8 @@
 
 import numpy as np
 from AnyQt.QtCore import (
-    QItemSelection, QItemSelectionModel, QItemSelectionRange, Qt
+    QItemSelection, QItemSelectionModel, QItemSelectionRange, Qt,
+    pyqtSignal as Signal
 )
 from AnyQt.QtGui import QFontMetrics
 from AnyQt.QtWidgets import (
@@ -76,6 +77,8 @@ def from_variable(cls, variable):
 
 
 class TableView(QTableView):
+    manualSelection = Signal()
+
     def __init__(self, parent=None, **kwargs):
         super().__init__(parent=parent,
                          selectionBehavior=QTableView.SelectRows,
@@ -105,6 +108,10 @@ def setVHeaderFixedWidthFromLabel(self, max_label):
         width = QFontMetrics(header.font()).width(max_label)
         header.setFixedWidth(min(width + 40, 400))
 
+    def mousePressEvent(self, event):
+        super().mousePressEvent(event)
+        self.manualSelection.emit()
+
 
 class TableModel(PyTableModel):
     def __init__(self, *args, **kwargs):
@@ -310,7 +317,7 @@ def __init__(self):
         def _set_select_manual():
             self.setSelectionMethod(OWRank.SelectManual)
 
-        view.pressed.connect(_set_select_manual)
+        view.manualSelection.connect(_set_select_manual)
         view.verticalHeader().sectionClicked.connect(_set_select_manual)
         view.horizontalHeader().sectionClicked.connect(self.headerClick)
 


Test patch:
Repository: biolab/orange3

Issue:
OWDatasets: Reduce width
<!--
If something's not right with Orange, fill out the bug report template at:
https://github.com/biolab/orange3/issues/new?assignees=&labels=bug+report&template=bug_report.md&title=

If you have an idea for a new feature, fill out the feature request template at:
https://github.com/biolab/orange3/issues/new?assignees=&labels=&template=feature_request.md&title=
-->

The widget is quite big at the moment, and many of the columns could be narrower by default.

**Current**
![Screenshot 2020-11-19 at 17 00 56](https://user-images.githubusercontent.com/24586651/99690776-cb520100-2a88-11eb-8185-e1efd6975ff5.png)

**Possible solution**
![Screenshot 2020-11-19 at 17 01 11](https://user-images.githubusercontent.com/24586651/99690813-d4db6900-2a88-11eb-9af8-b75bd1ec6f8b.png)

The sizeHint should not be set on the widget itself, it should be set on the table. To calculate it, each column's preferred width should be calculated by checking its values, and it should be clamped to a maximum value (i.e., long titles should elide).


Discussion:
Currently, if using `sizeHintForColumn`, the view doesn't change. I could not find a solution other than hardcoding the upper limit, which I don't think is desirable. Suggestions?
Did you comment out the widget's sizeHint?
Commenting it out just "breaks" the view, not column width. Namely the window isn't wide enough. Columns, when resizing the window, are still too wide.

Resolving patch:
diff --git a/Orange/widgets/data/owdatasets.py b/Orange/widgets/data/owdatasets.py
--- a/Orange/widgets/data/owdatasets.py
+++ b/Orange/widgets/data/owdatasets.py
@@ -377,10 +377,13 @@ def __set_index(self, f):
             self.__on_selection
         )
 
+        scw = self.view.setColumnWidth
+        width = self.view.fontMetrics().width
         self.view.resizeColumnToContents(0)
-        self.view.setColumnWidth(
-            1, min(self.view.sizeHintForColumn(1),
-                   self.view.fontMetrics().width("X" * 37)))
+        scw(self.Header.title, width("X" * 37))
+        scw(self.Header.size, 20 + max(width("888 bytes "), width("9999.9 MB ")))
+        scw(self.Header.instances, 20 + width("100000000"))
+        scw(self.Header.variables, 20 + width("1000000"))
 
         header = self.view.header()
         header.restoreState(self.header_state)


Test patch: