[ENH] Data Info widget displays data attributes#3022
Conversation
lanzagar
left a comment
There was a problem hiding this comment.
Apart from 2 minor comments in the code, the main issue I see is that this widget cannot be resized but fits to its contents automatically. The new Data Attributes box does not wrap text nicely and will result in strange looking widget geometry for larger meta data - this can already be seen in e.g. iris (which does not really have a long description/reference).
Data Attributes box should probably have a max width and wrap longer text.
| self.widget = self.create_widget(OWDataInfo) | ||
|
|
||
| def test_data(self): | ||
| """No crash on empty data""" |
There was a problem hiding this comment.
Wrong docstring (the data in this test is not empty).
| )) | ||
|
|
||
| if data.attributes: | ||
| self.data_attributes = pack_table(data.attributes.items()) |
There was a problem hiding this comment.
else:
self.data_attributes = ""to clear this box for data without attributes.
There was a problem hiding this comment.
Long data attribute labels are now stripped. I decided against wrapping, as this would solve only the problem for shorter labels and or longer labels we would need to implement something entirely different.
Codecov Report
@@ Coverage Diff @@
## master #3022 +/- ##
==========================================
+ Coverage 82.12% 82.19% +0.06%
==========================================
Files 334 335 +1
Lines 57659 57688 +29
==========================================
+ Hits 47355 47417 +62
+ Misses 10304 10271 -33 |
Issue
Some data in orange contain meta information about the data table. For instance, bioinformatics add-on passes the data on the organism or location of gene names by adding this information in .attributes field of the Orange data table. While this information is used in practically all bioinformatics widgets, there is no widget that would explicitly display this information.
Description of changes
The box Data Attributes was added to the widget.
Includes