Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Data Info widget displays data attributes #3022

Merged
merged 4 commits into from
May 7, 2018

Conversation

BlazZupan
Copy link
Contributor

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
  • Code changes
  • Tests
  • Documentation

Copy link
Contributor

@lanzagar lanzagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong docstring (the data in this test is not empty).

@@ -179,10 +177,14 @@ def join_if(items):
("{} textual", str_metas)
))

if data.attributes:
self.data_attributes = pack_table(data.attributes.items())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else:
    self.data_attributes = ""

to clear this box for data without attributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-io
Copy link

codecov-io commented May 4, 2018

Codecov Report

Merging #3022 into master will increase coverage by 0.06%.
The diff coverage is 87.09%.

@@            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

@lanzagar lanzagar merged commit 422bc94 into biolab:master May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants