Conversation
Codecov Report
@@ Coverage Diff @@
## master #3480 +/- ##
==========================================
+ Coverage 83.55% 83.71% +0.15%
==========================================
Files 367 370 +3
Lines 65454 66299 +845
==========================================
+ Hits 54690 55499 +809
- Misses 10764 10800 +36 |
| if role == Qt.DisplayRole: | ||
| if isinstance(attribute, DiscreteVariable): | ||
| output = self._center[row] | ||
| if not np.isnan(output): |
There was a problem hiding this comment.
What about else? Should output be set to "" in this case? np.nan is properly handled below with if output==output: output = "", but this won't work if an attribute has no values and self._center[row] is ... whatever it is in this case (probably 0).
f851db7 to
5fcd067
Compare
|
I've removed the commit that handled discrete variables with no values since this should never happen. In the event that it does happen, the underlying issue should be fixed and patched up in this widget. |
|
I am not sure why this passes on travis, but fails on appveyor (maybe different versions of libraries?). |
|
I can reproduce appveyor's error on windows. test_owfeaturestatistics -> force_render_table -> FeatureStatisticsTableModel.data tries to get a string value of a DiscreteVariable that has an empty list of values (owfeaturestatistics.py, line 515). |
|
Yes, that's actually the problem. Building a |
|
We traced the problem to scipy's mode function. For an array of nans it should return nan. It does so in the latest version 1.2, but not in version 1.0 that's used by appveyor. |
Issue
valuesDescription of changes
DiscreteVariable.str_valcrashes if it has novalues. This means that the problem may exist in other widgets as well. I thought about fixing thestr_valimplementation, but I don't really know what it should do in this case (implementation here). In both cases a string is returned, so it's not clear what to do here. Perhaps this was even left out by design, so I fixed the issue on the widget.self.send_data("Data", data)toself.send_data(self.widget.Inputs.data, data).Includes