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

Issue:
Fix pd.read_csv deprecation
```
/data/owcsvimport.py:1553: FutureWarning: The prefix argument has been deprecated and will be removed in a future version. Use a list comprehension on the column names in the future.


  df = pd.read_csv(
```


Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owcsvimport.py b/Orange/widgets/data/owcsvimport.py
--- a/Orange/widgets/data/owcsvimport.py
+++ b/Orange/widgets/data/owcsvimport.py
@@ -1554,11 +1554,14 @@ def expand(ranges):
             file, sep=opts.dialect.delimiter, dialect=opts.dialect,
             skipinitialspace=opts.dialect.skipinitialspace,
             header=header, skiprows=skiprows,
-            dtype=dtypes, parse_dates=parse_dates, prefix=prefix,
+            dtype=dtypes, parse_dates=parse_dates,
             na_values=na_values, keep_default_na=False,
             **numbers_format_kwds
         )
 
+        if prefix:
+            df.columns = [f"{prefix}{column}" for column in df.columns]
+
         # for older workflows avoid guessing type guessing
         if not compatibility_mode:
             df = guess_types(df, dtypes, columns_ignored)


Test patch:
Repository: biolab/orange3

Issue:
Strip and Rug plot in Violin plot
**What's wrong?**

Strip plot are dots, and rug plot are lines? I'd expect the opposite, but I may be wrong.

**How can we reproduce the problem?** 

Visualize any data in Violin plot and check Strip plot and/or Rug plot.


Discussion:
@markotoplak pointed out that this corresponds to strip plot and rug plot in Seaborn. In that context, the names make sense because they look like a strip and a rug. In Violin plot, they don't. We can't switch the names, but perhaps we could use some different names. Density dots and density lines?

Resolving patch:
diff --git a/Orange/widgets/visualize/owviolinplot.py b/Orange/widgets/visualize/owviolinplot.py
--- a/Orange/widgets/visualize/owviolinplot.py
+++ b/Orange/widgets/visualize/owviolinplot.py
@@ -850,9 +850,9 @@ def _add_controls(self):
                        sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Maximum))
         gui.checkBox(box, self, "show_box_plot", "Box plot",
                      callback=self.__show_box_plot_changed)
-        gui.checkBox(box, self, "show_strip_plot", "Strip plot",
+        gui.checkBox(box, self, "show_strip_plot", "Density dots",
                      callback=self.__show_strip_plot_changed)
-        gui.checkBox(box, self, "show_rug_plot", "Rug plot",
+        gui.checkBox(box, self, "show_rug_plot", "Density lines",
                      callback=self.__show_rug_plot_changed)
         self._order_violins_cb = gui.checkBox(
             box, self, "order_violins", "Order subgroups",


Test patch:
Repository: biolab/orange3

Issue:
Silhouette Plot inconsistent annotations
Depending on bar width, Silhouette Plot inconsistently displays annotations. 

<img width="771" alt="Screenshot 2023-01-09 at 16 53 37" src="https://user-images.githubusercontent.com/11246045/211350599-32acf000-e9d4-4a17-b505-dea80cb08f10.png">
<img width="771" alt="Screenshot 2023-01-09 at 16 53 28" src="https://user-images.githubusercontent.com/11246045/211350620-f98d17b0-4624-4d38-9a44-e31880c7f715.png">

This happens on a mac using Orange 3.34.1


Discussion:

Resolving patch:
diff --git a/Orange/widgets/utils/graphicstextlist.py b/Orange/widgets/utils/graphicstextlist.py
--- a/Orange/widgets/utils/graphicstextlist.py
+++ b/Orange/widgets/utils/graphicstextlist.py
@@ -209,7 +209,7 @@ def __naturalsh(self) -> QSizeF:
         fm = QFontMetrics(self.font())
         spacing = self.__spacing
         N = self.count()
-        width = self.__width_for_font(self.font())
+        width = self.__width_for_font(self.font()) + 1
         if self.has_color_strip():
             width += int(round((fm.height() + spacing) * 1.3))
         height = N * fm.height() + max(N - 1, 0) * spacing


Test patch:
Repository: biolab/orange3

Issue:
Make Ward Linkage the default method for hierarchical clustering
**What's your proposed solution?**

Make Ward the default.

**Are there any alternative solutions?**

No. :) Besides status quo.



Discussion:

Resolving patch:
diff --git a/Orange/widgets/unsupervised/owhierarchicalclustering.py b/Orange/widgets/unsupervised/owhierarchicalclustering.py
--- a/Orange/widgets/unsupervised/owhierarchicalclustering.py
+++ b/Orange/widgets/unsupervised/owhierarchicalclustering.py
@@ -47,6 +47,8 @@
 
 LINKAGE = ["Single", "Average", "Weighted", "Complete", "Ward"]
 LINKAGE_ARGS = ["single", "average", "weighted", "complete", "ward"]
+DEFAULT_LINKAGE = "Ward"
+
 
 def make_pen(brush=Qt.black, width=1, style=Qt.SolidLine,
              cap_style=Qt.SquareCap, join_style=Qt.BevelJoin,
@@ -187,7 +189,7 @@ class Outputs:
     settingsHandler = _DomainContextHandler()
 
     #: Selected linkage
-    linkage = settings.Setting(1)
+    linkage = settings.Setting(LINKAGE.index(DEFAULT_LINKAGE))
     #: Index of the selected annotation item (variable, ...)
     annotation = settings.ContextSetting("Enumeration")
     #: Out-of-context setting for the case when the "Name" option is available


Test patch:
diff --git a/Orange/widgets/tests/base.py b/Orange/widgets/tests/base.py
--- a/Orange/widgets/tests/base.py
+++ b/Orange/widgets/tests/base.py
@@ -511,6 +511,7 @@ def init(self, same_table_attributes=True, output_all_on_no_selection=False):
         self.output_all_on_no_selection = output_all_on_no_selection
 
     def test_outputs(self, timeout=DEFAULT_TIMEOUT):
+        self.widget.linkage = 1
         self.send_signal(self.signal_name, self.signal_data)
 
         self.wait_until_finished(timeout=timeout)
Repository: biolab/orange3

Issue:
Regression / Curve Fit: provide less cryptic warning when no target variable has been defined
<!-- 
Thanks for taking the time to submit a feature request!
For the best chance at our team considering your request, please answer the following questions to the best of your ability.
-->

**What's your use case?**
Linear Regression and Curve Fit produce a warning "ValueError: Numeric class variable expected" when no target variable has been defined. This is a cryptic and rather contradictory sounding message: what is a numeric class variable? Sounds like a numeric variable that is categorical at the same time. Doesn't seem to make sense.

**What's your proposed solution?**
Provide a clearer message, for instance "No target defined"

**Are there any alternative solutions?**
N/A








Discussion:

Resolving patch:
diff --git a/Orange/regression/base_regression.py b/Orange/regression/base_regression.py
--- a/Orange/regression/base_regression.py
+++ b/Orange/regression/base_regression.py
@@ -11,7 +11,7 @@ def incompatibility_reason(self, domain):
         if len(domain.class_vars) > 1 and not self.supports_multiclass:
             reason = "Too many target variables."
         elif not domain.has_continuous_class:
-            reason = "Numeric class variable expected."
+            reason = "Numeric target variable expected."
         return reason
 
 


Test patch:
Repository: biolab/orange3

Issue:
Select Rows: Remove unused classes does not remove unused classes
**What's wrong?**
If the box "Remove unused classes" in Select Rows is ticked, unused classes are not removed from matching data

**How can we reproduce the problem?** 
See attached example: Connect Select Rows to the Sailing dataset, define a condition "Company | is not | big". Connect the matching data output to Edit Domain, and select the Company variable: the class Company == big is still there.
[Unused classes are kept.ows.zip](https://github.com/biolab/orange3/files/11059926/Unused.classes.are.kept.ows.zip)

**What's your environment?**
- Operating system: Mac OS 13.2.1 (Silicon)
- Orange version: 3.34
- How you installed Orange: from DMG



Discussion:
Company is not a class variable. To remove "big", check "Remove unused features".

But the label is misleading. It removed unused categories from features, or entire features if they have less than two different values. The labels needs to be changed.

Resolving patch:
diff --git a/Orange/widgets/data/owselectrows.py b/Orange/widgets/data/owselectrows.py
--- a/Orange/widgets/data/owselectrows.py
+++ b/Orange/widgets/data/owselectrows.py
@@ -247,7 +247,8 @@ def __init__(self):
 
         box_setting = gui.vBox(self.buttonsArea)
         self.cb_pa = gui.checkBox(
-            box_setting, self, "purge_attributes", "Remove unused features",
+            box_setting, self, "purge_attributes",
+            "Remove unused values and constant features",
             callback=self.conditions_changed)
         self.cb_pc = gui.checkBox(
             box_setting, self, "purge_classes", "Remove unused classes",


Test patch:
Repository: biolab/orange3

Issue:
Save: Retain data types
<!-- 
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 saving data using Save widget, integers are converted to floats.




**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 data with feature with integers and save it. The integer feature is saved as float.
![image](https://github.com/biolab/orange3/assets/11465003/196eaefa-6e27-495a-8aee-22f9225080dc)




**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: macOS
- Orange version: master
- How you installed Orange: from source



Discussion:

Resolving patch:
diff --git a/Orange/data/io_base.py b/Orange/data/io_base.py
--- a/Orange/data/io_base.py
+++ b/Orange/data/io_base.py
@@ -654,7 +654,7 @@ def formatter(cls, var):
         if var.is_time:
             return var.repr_val
         elif var.is_continuous:
-            return lambda value: "" if isnan(value) else value
+            return lambda value: "" if isnan(value) else var.repr_val(value)
         elif var.is_discrete:
             return lambda value: "" if isnan(value) else var.values[int(value)]
         elif var.is_string:


Test patch:
diff --git a/Orange/data/tests/test_io.py b/Orange/data/tests/test_io.py
--- a/Orange/data/tests/test_io.py
+++ b/Orange/data/tests/test_io.py
@@ -135,9 +135,9 @@ def test_write_tab(self):
 c\td\ta\tb
 continuous\tstring\tx y z\tcontinuous
 class\tmeta\t\t
-3.0\tfoo\ty\t0.5
-1.0\tbar\tz\t
-7.0\tbaz\t\t1.0625""".strip())
+3\tfoo\ty\t0.500
+1\tbar\tz\t
+7\tbaz\t\t1.06250""".strip())
         finally:
             os.remove(fname)
Repository: biolab/orange3

Issue:
Please make "Mean Absolute Percentage Error" (MAPE) available in the "Test and Score" widget
Mean Absolute Percentage Error (MAPE) is a common metric that fits in well with the other options available in the Test and Score widget. This is available in [scikit-learn](https://scikit-learn.org/stable/modules/model_evaluation.html) and it appears it would be easy to add. 

There is some older Orange3 documentation that makes it look like it was available at one point but doesn't seem to be now. 


Discussion:

Resolving patch:
diff --git a/Orange/evaluation/scoring.py b/Orange/evaluation/scoring.py
--- a/Orange/evaluation/scoring.py
+++ b/Orange/evaluation/scoring.py
@@ -20,7 +20,7 @@
 from Orange.misc.wrapper_meta import WrapperMeta
 
 __all__ = ["CA", "Precision", "Recall", "F1", "PrecisionRecallFSupport", "AUC",
-           "MSE", "RMSE", "MAE", "R2", "LogLoss", "MatthewsCorrCoefficient"]
+           "MSE", "RMSE", "MAE", "MAPE", "R2", "LogLoss", "MatthewsCorrCoefficient"]
 
 
 class ScoreMetaType(WrapperMeta):
@@ -399,6 +399,11 @@ class MAE(RegressionScore):
     long_name = "Mean absolute error"
     priority = 40
 
+class MAPE(RegressionScore):
+    __wraps__ = skl_metrics.mean_absolute_percentage_error
+    name = "MAPE"
+    long_name = "Mean absolute percentage error"
+    priority = 45
 
 # pylint: disable=invalid-name
 class R2(RegressionScore):


Test patch:
Repository: biolab/orange3

Issue:
New version of cython was released, installation does not work with it
On 17 Jul Cython 3.0 was released. Orange can not be installed from source with it.

In long term, we should fix it. For now, I changed the installer to require older Cython (#6518).


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@
     have_sphinx = False
 
 try:
-    from Cython.Distutils.build_ext import new_build_ext as build_ext
+    from Cython.Build import cythonize
     have_cython = True
 except ImportError:
     have_cython = False
@@ -434,14 +434,7 @@ def ext_modules():
     if os.name == 'posix':
         libraries.append("m")
 
-    return [
-        # Cython extensions. Will be automatically cythonized.
-        Extension(
-            "*",
-            ["Orange/*/*.pyx"],
-            include_dirs=includes,
-            libraries=libraries,
-        ),
+    modules = [
         Extension(
             "Orange.classification._simple_tree",
             sources=[
@@ -464,6 +457,16 @@ def ext_modules():
         ),
     ]
 
+    if have_cython:
+        modules += cythonize(Extension(
+            "*",
+            ["Orange/*/*.pyx"],
+            include_dirs=includes,
+            libraries=libraries,
+        ))
+
+    return modules
+
 
 def setup_package():
     write_version_py()
@@ -478,17 +481,14 @@ def setup_package():
         # numpy.distutils insist all data files are installed in site-packages
         'install_data': install_data.install_data
     }
-    if have_numpy and have_cython:
-        extra_args = {}
-        cmdclass["build_ext"] = build_ext
-    else:
+    if not (have_numpy and have_cython):
         # substitute a build_ext command with one that raises an error when
         # building. In order to fully support `pip install` we need to
         # survive a `./setup egg_info` without numpy so pip can properly
         # query our install dependencies
-        extra_args = {}
         cmdclass["build_ext"] = build_ext_error
 
+    extra_args = {}
     setup(
         name=NAME,
         version=FULLVERSION,


Test patch:
Repository: biolab/orange3

Issue:
A real "formula"/"calculation" widget
<!-- 
Thanks for taking the time to submit a feature request!
For the best chance at our team considering your request, please answer the following questions to the best of your ability.
-->

**What's your use case?**
Hello,

I would like to make some calculations on my data 
-mathematics like Unit Price * Quantity = Amount
-string like Upper('simon')=SIMON
-logical, etc, etc...

I may have misread the documentation but the closest solution I found was the feature constructor (which is, I think, an unclear name). However the feature constructir is really limited today :
-no autocompletion
-no string, date, logical, conditional... functions (Or I missed it)
-not able to use multiline
-etc.. etc...

**What's your proposed solution?**
<!-- Be specific, clear, and concise. -->
A new "formula" or "calculation" widget similar to what we find in other solutions, with far mor type and calculations available
Alteryx : 
![image](https://github.com/biolab/orange3/assets/46959192/02973315-e0a8-456f-bc3a-2d2444057d67)

Knime 
![image](https://github.com/biolab/orange3/assets/46959192/cd8fc2bd-440d-49f6-8c2e-04addf7ad90b)

Well here a way to make some python calculation, either by overwriting existing field either by creating new fields.. this can be sliced in several delivery such as 1 : the widget where you can type free python calculation 2 : with intellisense/help/autocomplete


**Are there any alternative solutions?**

None I found

Best regards






Discussion:
You're right about the name of the widgets. We'll renamed it to Formula and add "construct" and "calculation" as keywords.

As for your suggestion, there is a Python Script widget that allows writing arbitrary (Python) programs, yet it is more difficult to use. This widget, though, only offers Python expressions; multiline would be of little help here. Expressions can include many mathematical functions, and we can others. Autocompletion would make little sense - you can use combos to select functions and variables anyway.

Small print: Python Script is difficult to maintain and we don't want to add another similarly complicated widget.

Resolving patch:
diff --git a/Orange/widgets/data/owfeatureconstructor.py b/Orange/widgets/data/owfeatureconstructor.py
--- a/Orange/widgets/data/owfeatureconstructor.py
+++ b/Orange/widgets/data/owfeatureconstructor.py
@@ -509,12 +509,12 @@ def is_valid_item(self, setting, item, attrs, metas):
 
 
 class OWFeatureConstructor(OWWidget, ConcurrentWidgetMixin):
-    name = "Feature Constructor"
+    name = "Formula"
     description = "Construct new features (data columns) from a set of " \
                   "existing features in the input dataset."
     category = "Transform"
     icon = "icons/FeatureConstructor.svg"
-    keywords = "feature constructor, function, lambda"
+    keywords = "feature constructor, function, lambda, calculation"
     priority = 2240
 
     class Inputs:


Test patch:
Repository: biolab/orange3

Issue:
Number of features remains disabled when Suggest features is closed during search
![suggest features](https://github.com/biolab/orange3/assets/5299789/8fd3572d-3564-45b0-b4ea-a0a23dea0cfa)

How to reproduce:
1. open _Suggest features_ and run
2. close while running
3. choose another mode (circular, LDA or PCA)
4. open _Suggest features_: the _Number of variables_ field is disabled despite no search running

OS: Windows 10 x64
Orange: 3.35.0


Discussion:

Resolving patch:
diff --git a/Orange/widgets/visualize/owlinearprojection.py b/Orange/widgets/visualize/owlinearprojection.py
--- a/Orange/widgets/visualize/owlinearprojection.py
+++ b/Orange/widgets/visualize/owlinearprojection.py
@@ -63,6 +63,7 @@ def __init__(self, master):
 
     def initialize(self):
         super().initialize()
+        self.n_attrs_spin.setDisabled(False)
         self.attr_color = self.master.attr_color
 
     def before_running(self):


Test patch:
Repository: biolab/orange3

Issue:
Number of variables not updated in Linear projection
![num of vars](https://github.com/biolab/orange3/assets/5299789/e9f50015-8699-4550-92d4-f10e582d9897)

The _Number of variables_ field is not updated but the last used value is applied when a new _Linear projection_ is created.

How to reproduce:
1. create a _Linear projection_
2. open _Suggest features_; set _Number of variables_ to 4; run, pause and close
3. create a new _Linear projection_
4. open _Suggest features_; _Number of variables_ is the default 3 (don't change it); run and it will still search for 4 variables

OS: Windows 10 x64
Orange: 3.35.0




Discussion:
I tried these steps and but couldn't replicate the bug. Someone needs to investigate, though. Perhaps together with #6503.

Resolving patch:
diff --git a/Orange/widgets/visualize/owlinearprojection.py b/Orange/widgets/visualize/owlinearprojection.py
--- a/Orange/widgets/visualize/owlinearprojection.py
+++ b/Orange/widgets/visualize/owlinearprojection.py
@@ -93,6 +93,7 @@ def check_preconditions(self):
         n_cont_var = len([v for v in master.continuous_variables
                           if v is not master.attr_color])
         self.n_attrs_spin.setMaximum(n_cont_var)
+        self.n_attrs_spin.setValue(self.n_attrs)
         return True
 
     def state_count(self):


Test patch:
diff --git a/Orange/widgets/visualize/tests/test_owlinearprojection.py b/Orange/widgets/visualize/tests/test_owlinearprojection.py
--- a/Orange/widgets/visualize/tests/test_owlinearprojection.py
+++ b/Orange/widgets/visualize/tests/test_owlinearprojection.py
@@ -256,6 +256,16 @@ def test_set_attrs(self):
         c2 = self.get_output(self.widget.Outputs.components)
         self.assertNotEqual(c1.domain.attributes, c2.domain.attributes)
 
+    def test_vizrank_n_attrs(self):
+        self.send_signal(self.widget.Inputs.data, self.data)
+        self.vizrank.n_attrs_spin.setValue(4)
+        settings = self.widget.settingsHandler.pack_data(self.widget)
+        widget = self.create_widget(OWLinearProjection,
+                                    stored_settings=settings)
+        self.send_signal(widget.Inputs.data, self.data, widget=widget)
+        self.assertEqual(widget.vizrank.n_attrs_spin.value(),
+                         self.vizrank.n_attrs_spin.value())
+
 
 if __name__ == "__main__":
     import unittest
Repository: biolab/orange3

Issue:
Import Images Widget Info Typo
<!-- 
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?**
I imported an `image-data` folder with 3 labeled subfolders - `broccoli`, `capsicum`, `tomato` using the Image Analytics Add-on.
![image](https://github.com/biolab/orange3/assets/23441795/21256f6f-de50-496b-83b0-29cd00ef8134)

It showed `3 categorys`, instead of `3 categories`.

![image](https://github.com/biolab/orange3/assets/23441795/6ef7bb6d-b1a1-45e5-95fe-f801ee0a6b49)

I tested by adding these two lines to [orange3/Orange/widgets/utils/localization/__init__.py](https://github.com/biolab/orange3/blob/master/Orange/widgets/utils/localization/__init__.py) locally, it somehow fixed the typo.

![image](https://github.com/biolab/orange3/assets/23441795/844eb034-587b-4c44-84e9-56ca483e5606)


**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: Windows 10
- Orange version: 3.36.2
- How you installed Orange: `pip install Orange3`



Discussion:
Thanks for telling us.

Note for whomever takes this issue: this function shouldn't be here at all. Widgets should use https://github.com/biolab/orange-canvas-core/blob/master/orangecanvas/utils/localization/__init__.py instead. For backward compatibility, [orange3/Orange/widgets/utils/localization/init.py](https://github.com/biolab/orange3/blob/master/Orange/widgets/utils/localization/__init__.py) should just import and re-export the former function, which also already properly implements the rule for plural of nouns ending with -y.

Resolving patch:
diff --git a/Orange/widgets/utils/localization/__init__.py b/Orange/widgets/utils/localization/__init__.py
--- a/Orange/widgets/utils/localization/__init__.py
+++ b/Orange/widgets/utils/localization/__init__.py
@@ -1,21 +1,3 @@
-def pl(n: int, forms: str) -> str:  # pylint: disable=invalid-name
-    """
-    Choose a singular/plural form for English - or create one, for regular nouns
+from orangecanvas.utils.localization import pl
 
-    `forms` can be a string containing the singular and plural form, separated
-    by "|", for instance `"dictionary|dictionaries".
-
-    IF `forms` does not contain character |, plural is formed by appending
-    an 's'.
-
-    Args:
-        n: number
-        forms: plural forms, separated by "|", or a single (regular) noun
-
-    Returns:
-        form corresponding to the given number
-    """
-    if "|" in forms:
-        return forms.split("|")[n != 1]
-    else:
-        return forms + "s" * (n != 1)
+__all__ = ['pl']


Test patch: