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

Issue:
BUG: UI annoyance - Predictions Widget measures grid squashing
This is not a classic bug, but rather big visual annoyance: Predictions Widget squashes the grid with measures every time I retrain anything that sends data to it - like NN or LR. It seems that it chooses column widths based on the header text width and ignores the text in the cells below. Once I click on the model column heading or any other column to sort it, it unsquashes it - that is, it considers cells text width as well. Can we have that not squashed every time retraining is requested? It seems that it does remember its column order although sort column does not have that triangle shown after being squashed, thus I do not know which column was used for sorting in the first place. Thank you n advance for fixing this.

[1] Sqaushed
![image](https://user-images.githubusercontent.com/32625394/152621624-e29d79d4-2f91-4963-b2ba-1efb12a4e4b9.png)

[2] Unsqaushed
![image](https://user-images.githubusercontent.com/32625394/152621638-728badab-7b62-46bc-8568-a697a171ef7a.png)



Discussion:

Resolving patch:
diff --git a/Orange/widgets/evaluate/utils.py b/Orange/widgets/evaluate/utils.py
--- a/Orange/widgets/evaluate/utils.py
+++ b/Orange/widgets/evaluate/utils.py
@@ -194,10 +194,10 @@ def update(col_name, checked):
     def _update_shown_columns(self):
         # pylint doesn't know that self.shown_scores is a set, not a Setting
         # pylint: disable=unsupported-membership-test
+        self.view.resizeColumnsToContents()
         header = self.view.horizontalHeader()
         for section, col_name in enumerate(self._column_names(), start=1):
             header.setSectionHidden(section, col_name not in self.shown_scores)
-        self.view.resizeColumnsToContents()
         self.shownScoresChanged.emit()
 
     def update_header(self, scorers):


Test patch:
Repository: biolab/orange3

Issue:
Correlations: center variable names
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
Variable names are currently top aligned vertically, meaning they are at the top edge of the cell. Align them centrally, so that there is equal space on top and below the variable name.




**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
Open Correlations.
<img width="350" alt="Screen Shot 2022-03-03 at 15 02 29" src="https://user-images.githubusercontent.com/12524972/156580071-c1dac9df-a993-4128-bf74-e0da40f9eb0a.png">





**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: OSx
- Orange version: 3.32.dev
- How you installed Orange: pip



Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owcorrelations.py b/Orange/widgets/data/owcorrelations.py
--- a/Orange/widgets/data/owcorrelations.py
+++ b/Orange/widgets/data/owcorrelations.py
@@ -156,7 +156,7 @@ def row_for_state(self, score, state):
         for attr in attrs:
             item = QStandardItem(attr.name)
             item.setData(attrs, self._AttrRole)
-            item.setData(Qt.AlignLeft + Qt.AlignTop, Qt.TextAlignmentRole)
+            item.setData(Qt.AlignLeft + Qt.AlignCenter, Qt.TextAlignmentRole)
             item.setToolTip(attr.name)
             attr_items.append(item)
         correlation_item = QStandardItem("{:+.3f}".format(score[1]))


Test patch:
Repository: biolab/orange3

Issue:
Tree Viewer: display of <, >
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
Tree Viewer doesn't properly format the tooltip.
<img width="464" alt="Screen Shot 2022-03-04 at 19 19 44" src="https://user-images.githubusercontent.com/12524972/156820102-ea554ffb-9633-4a0a-90df-8d7971af133c.png">



**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
File (iris) - Tree - Tree Viewer. Hover over a child node.



**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: OSX
- Orange version: 3.32.dev
- How you installed Orange: pip



Discussion:

Resolving patch:
diff --git a/Orange/widgets/utils/__init__.py b/Orange/widgets/utils/__init__.py
--- a/Orange/widgets/utils/__init__.py
+++ b/Orange/widgets/utils/__init__.py
@@ -37,9 +37,8 @@ def getdeepattr(obj, attr, *arg, **kwarg):
 
 
 def to_html(s):
-    return s.replace("<=", "&#8804;").replace(">=", "&#8805;"). \
-        replace("<", "&#60;").replace(">", "&#62;").replace("=\\=", "&#8800;")
-
+    return s.replace("<=", "≤").replace(">=", "≥"). \
+        replace("<", "&lt;").replace(">", "&gt;").replace("=\\=", "≠")
 
 getHtmlCompatibleString = to_html
 
diff --git a/Orange/widgets/visualize/owtreeviewer.py b/Orange/widgets/visualize/owtreeviewer.py
--- a/Orange/widgets/visualize/owtreeviewer.py
+++ b/Orange/widgets/visualize/owtreeviewer.py
@@ -313,8 +313,9 @@ def walkcreate(self, node, parent=None):
         return node_obj
 
     def node_tooltip(self, node):
-        return "<br>".join(to_html(str(rule))
-                           for rule in self.tree_adapter.rules(node.node_inst))
+        return "<p>" + "<br>".join(
+            to_html(str(rule))
+            for rule in self.tree_adapter.rules(node.node_inst)) + "</p>"
 
     def update_selection(self):
         if self.model is None:


Test patch:
Repository: biolab/orange3

Issue:
Silhouette plot should show statistics for groups
**What's your use case?**

A student who analyzed some data about habits and preferences of students wrote something to the effect of "all men are alike, while women differ from each other". This could be verified by Silhouette if it showed silhouette scores for each group.

**What's your proposed solution?**

Given the widget's current layout, the simplest place to show this would be in control area. The problem is that this cannot be copied, so don't forget to include this info in report.

**Alternative solutions?**

Observe the silhouette as it this. It would seem that the opposite is true, though the difference is small.


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owsilhouetteplot.py b/Orange/widgets/visualize/owsilhouetteplot.py
--- a/Orange/widgets/visualize/owsilhouetteplot.py
+++ b/Orange/widgets/visualize/owsilhouetteplot.py
@@ -762,9 +762,10 @@ def __setup(self):
 
             if group.label:
                 layout.addItem(Line(orientation=Qt.Vertical), i + 1, 1)
-                label = QGraphicsSimpleTextItem(
-                    "{} ({})".format(group.label, len(group.scores)), self
-                )
+                text = group.label
+                if group.scores.size:
+                    text += f" ({np.mean(group.scores):.3f})"
+                label = QGraphicsSimpleTextItem(text, self)
                 label.setBrush(foreground)
                 label.setPen(QPen(Qt.NoPen))
                 label.setRotation(-90)


Test patch:
Repository: biolab/orange3

Issue:
Distributions: changing bin width
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
I'll call a bug on this one.
When I open Distributions for the first time, Age attribute is selected and it has three bins. Then I change to a different variable and back to Age. Now Age has 10 bins.


https://user-images.githubusercontent.com/12524972/160869888-55876278-06a9-4610-b779-bd009a41a9a2.mov




**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
Datasets (Employee Attrition) - Distributions.
Switch to some other variable, then back to Age.




**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: OSX
- Orange version: 3.32.dev
- How you installed Orange: pip



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
@@ -903,6 +903,7 @@ def recompute_binnings(self):
         self.controls.number_of_bins.setMaximum(max_bins)
         self.number_of_bins = min(
             max_bins, self._user_var_bins.get(self.var, self.number_of_bins))
+        self._user_var_bins[self.var] = self.number_of_bins
         self._set_bin_width_slider_label()
 
     @staticmethod


Test patch:
Repository: biolab/orange3

Issue:
Allow vertical minimization of Paint Data window
Paint Data widget prevents me to make its window really small. I can minimize it any way I want to horizontally, but vertically it resists.

![image](https://user-images.githubusercontent.com/726604/172704742-9ba55889-0b78-4baf-83b1-4c6c8df408e8.png)

For instance, I can make Scatter Plot window much smaller, both directions.

![image](https://user-images.githubusercontent.com/726604/172707164-a79bc01a-bf27-4322-919d-c33740a7b7fe.png)

**What's your use case?**

The feature is needed if one wants to showcase the effects of different painted data and needs space on the screen for other widgets.

**What's your proposed solution?**

Allow vertical minimization of the window.

**Are there any alternative solutions?**

No. :).


Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owpaintdata.py b/Orange/widgets/data/owpaintdata.py
--- a/Orange/widgets/data/owpaintdata.py
+++ b/Orange/widgets/data/owpaintdata.py
@@ -980,7 +980,7 @@ def set_dimensions(self):
         if self.hasAttr2:
             self.plot.setYRange(0, 1, padding=0.01)
             self.plot.showAxis('left')
-            self.plotview.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
+            self.plotview.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
         else:
             self.plot.setYRange(-.5, .5, padding=0.01)
             self.plot.hideAxis('left')


Test patch:
Repository: biolab/orange3

Issue:
Line Chart: improve ticks on single date, multiple hours
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->

##### Timeseries version
master since biolab/orange3-timeseries#220 


##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.32.dev

##### Expected behavior
When the timeseries data belongs to a single date but to multiple hours, ticks should display only hours, i.e. 23:00.


##### Actual behavior
Ticks display the day + hour, which is quite unintuitive.


##### Steps to reproduce the behavior
[NewLog3.txt](https://github.com/biolab/orange3-timeseries/files/9251181/NewLog3.txt)
File - Line Chart.


##### Additional info (worksheets, data, screenshots, ...)
This is not major. It only happens after a certain width of the widget. When shrunk, the widget displays only hours.
<img width="1009" alt="Screenshot 2022-08-03 at 14 19 33" src="https://user-images.githubusercontent.com/12524972/182606012-4546c21a-3095-49cd-8853-4c6fcf5a14c0.png">





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
@@ -344,6 +344,11 @@ def tickValues(self, minVal, maxVal, size):
             return super().tickValues(minVal, maxVal, size)
 
         ticks = bins.thresholds
+        # Remove ticks that will later be removed in AxisItem.generateDrawSpecs
+        # because they are out of range. Removing them here is needed so that
+        # they do not affect spaces and label format
+        ticks = ticks[(ticks[0] < minVal)
+                      :len(ticks) - (ticks[-1] > maxVal)]
 
         max_steps = max(int(size / self._label_width), 1)
         if len(ticks) > max_steps:


Test patch:
Repository: biolab/orange3

Issue:
Hard to guess what is the role of Predictions and Probabilities check box in Confusion Matrix
In some older implementation Predictions and Probabilities check box were enclosed with an Output box, giving these two a meaning. Without this box it is hard to guess what role these check boxes play, as changing them does not change anything in the user interface. I would suggest adding back the surrounding box.

<img width="791" alt="image" src="https://user-images.githubusercontent.com/726604/187956468-09b4298a-7a13-40da-bc49-624263a647cb.png">



Discussion:

Resolving patch:
diff --git a/Orange/widgets/evaluate/owconfusionmatrix.py b/Orange/widgets/evaluate/owconfusionmatrix.py
--- a/Orange/widgets/evaluate/owconfusionmatrix.py
+++ b/Orange/widgets/evaluate/owconfusionmatrix.py
@@ -136,7 +136,7 @@ def __init__(self):
         )
 
         self.outputbox = gui.vBox(self.buttonsArea)
-        box = gui.hBox(self.outputbox)
+        box = gui.vBox(self.outputbox, box="Output")
         gui.checkBox(box, self, "append_predictions",
                      "Predictions", callback=self._invalidate)
         gui.checkBox(box, self, "append_probabilities",


Test patch:
Repository: biolab/orange3

Issue:
Scatter Plot: Crash with time data
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
```
Traceback (most recent call last):
  File "/Users/vesna/pyqtgraph/pyqtgraph/graphicsItems/AxisItem.py", line 636, in paint
    specs = self.generateDrawSpecs(painter)
  File "/Users/vesna/pyqtgraph/pyqtgraph/graphicsItems/AxisItem.py", line 955, in generateDrawSpecs
    tickLevels = self.tickValues(self.range[0], self.range[1], lengthInPixels)
  File "/Users/vesna/orange3/Orange/widgets/visualize/owscatterplotgraph.py", line 354, in tickValues
    spacing = min(b - a for a, b in zip(ticks[:-1], ticks[1:]))
ValueError: min() arg is an empty sequence
```

**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
Database (Online Retail) -> resize the ScatterPlot widget to the minimum width -> ScatterPlot (set x axis to InvoiceDate) -> crash

![image](https://user-images.githubusercontent.com/11465003/182340768-72dff9ef-512b-42f9-80d2-ecb442ce0f80.png)






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
@@ -302,7 +302,10 @@ def tickValues(self, minVal, maxVal, size):
             step = int(np.ceil(float(len(ticks)) / max_steps))
             ticks = ticks[::step]
 
-        spacing = min(b - a for a, b in zip(ticks[:-1], ticks[1:]))
+        # In case of a single tick, `default` will inform tickStrings
+        # about the appropriate scale.
+        spacing = min((b - a for a, b in zip(ticks[:-1], ticks[1:])),
+                      default=maxVal - minVal)
         return [(spacing, ticks)]
 
     def tickStrings(self, values, scale, spacing):


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
@@ -1130,6 +1130,10 @@ def test_time_axis(self):
         with self.assertRaises(ValueError):
             float(ticks[0])
 
+        spacing, ticks = x_axis.tickValues(1581953776, 1582953776, 10)[0]
+        self.assertEqual(spacing, 1582953776 - 1581953776)
+        self.assertTrue(not ticks.size or 1581953776 <= ticks[0] <= 1582953776)
+
     def test_clear_plot(self):
         self.widget.cb_class_density.setChecked(True)
         self.send_signal(self.widget.Inputs.data, self.data)
Repository: biolab/orange3

Issue:
Distances: wrong error in Mahalanobis
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
When selecting Mahalanobis distance and feeding the widget more than 1000 rows/columns, the widget should (according to source code, L186) raise an error.

1. For Rows, it does not raise an error at all and proceeds with computation.
2. For Columns, it raises an error, but the error says "rows" in the text. The axis number is wrong.



**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
Datasets (wine quality) - Distances.



Discussion:
Correction, this only concerns columns computation, where the size of the matrix should be <100 rows if there are more than 1000 columns. In theory. However, I can use Mahalanobis just fine on 1001x1001 data set.

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owdistances.py b/Orange/widgets/unsupervised/owdistances.py
--- a/Orange/widgets/unsupervised/owdistances.py
+++ b/Orange/widgets/unsupervised/owdistances.py
@@ -185,8 +185,8 @@ def _fix_missing():
 
         def _check_tractability():
             if metric is distance.Mahalanobis:
-                if self.axis == 1:
-                    # when computing distances by columns, we want < 100 rows
+                if self.axis == 0:
+                    # when computing distances by columns, we want < 1000 rows
                     if len(data) > 1000:
                         self.Error.data_too_large_for_mahalanobis("rows")
                         return False


Test patch:
diff --git a/Orange/widgets/unsupervised/tests/test_owdistances.py b/Orange/widgets/unsupervised/tests/test_owdistances.py
--- a/Orange/widgets/unsupervised/tests/test_owdistances.py
+++ b/Orange/widgets/unsupervised/tests/test_owdistances.py
@@ -214,15 +214,17 @@ def assert_no_error():
 
         # by columns -- cannot handle too many rows
         self.send_signal(self.widget.Inputs.data, bigrows)
-        assert_error_shown()
-        axis_buttons[0].click()
         assert_no_error()
-        axis_buttons[1].click()
+        axis_buttons[0].click()
         assert_error_shown()
+        axis_buttons[1].click()
+        assert_no_error()
 
         self.send_signal(self.widget.Inputs.data, bigcols)
-        assert_no_error()
+        assert_error_shown()
         axis_buttons[0].click()
+        assert_no_error()
+        axis_buttons[1].click()
         assert_error_shown()
 
         self.send_signal(widget.Inputs.data, self.iris)
Repository: biolab/orange3

Issue:
Tree Viewer: Tooltips should skip empty classes
**What's your use case?**

See the screenshot: one has to find the two classes that are not empty.

<img width="241" alt="Screen Shot 2022-11-04 at 15 39 29" src="https://user-images.githubusercontent.com/2387315/200002288-aa1f3737-1b12-4924-ad08-539a6a838a19.png">
>

**What's your proposed solution?**

Skip empty classes.

Bonus points: add some alignment. Put numbers and proportions before labels if necessary.

**Are there any alternative solutions?**

Perhaps keep empty classes for binary problems or, perhaps, when there are less than, say, four classes.







Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owtreeviewer.py b/Orange/widgets/visualize/owtreeviewer.py
--- a/Orange/widgets/visualize/owtreeviewer.py
+++ b/Orange/widgets/visualize/owtreeviewer.py
@@ -342,13 +342,21 @@ def node_tooltip(self, node):
         name = escape(class_var.name)
         if self.domain.class_var.is_discrete:
             total = float(sum(distr)) or 1
+            show_all = len(distr) <= 2
             content = f"{nbp}<b>Distribution of</b> '{name}'</p><p>" \
-                + "<br/>".join(
-                    f"{indent}<span style='color: {color_to_hex(color)}'>◼</span> "
-                    f"{escape(value)}: {prop:g} ({prop / total * 100:.1f} %)"
+                + "<table>" + "".join(
+                    "<tr>"
+                    f"<td><span style='color: {color_to_hex(color)}'>◼</span> "
+                    f"{escape(value)}</td>"
+                    f"<td>{indent}</td>"
+                    f"<td align='right'>{prop:g}</td>"
+                    f"<td>{indent}</td>"
+                    f"<td align='right'>{prop / total * 100:.1f} %</td>"
+                    "</tr>"
                     for value, color, prop
-                    in zip(class_var.values, class_var.colors, distr)) \
-                + "</p>"
+                    in zip(class_var.values, class_var.colors, distr)
+                    if show_all or prop > 0) \
+                + "</table>"
         else:
             mean, var = distr
             content = f"{nbp}{class_var.name} = {mean:.3g} ± {var:.3g}<br/>" + \


Test patch: