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] Venn Diagram: Add relations over columns, simplify over rows #4006

Merged
merged 16 commits into from
Dec 6, 2019

Conversation

AndrejaKovacic
Copy link
Contributor

@AndrejaKovacic AndrejaKovacic commented Sep 5, 2019

Issue

Implements #3991.

Description of changes

Venn diagram over rows is now simpler. Venn diagram over columns is now possible. I would appreciate comments about output, especially when using columns.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Oct 25, 2019

Codecov Report

Merging #4006 into master will increase coverage by 0.22%.
The diff coverage is 94.75%.

@@            Coverage Diff             @@
##           master    #4006      +/-   ##
==========================================
+ Coverage   85.95%   86.17%   +0.22%     
==========================================
  Files         393      394       +1     
  Lines       70128    70305     +177     
==========================================
+ Hits        60277    60584     +307     
+ Misses       9851     9721     -130

@AndrejaKovacic AndrejaKovacic force-pushed the venn branch 3 times, most recently from bba054d to 9a15d0d Compare October 30, 2019 13:51
Copy link
Contributor

@janezd janezd left a comment

Choose a reason for hiding this comment

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

My comments so far ...

Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
Orange/widgets/visualize/owvenndiagram.py Outdated Show resolved Hide resolved
@AndrejaKovacic AndrejaKovacic force-pushed the venn branch 2 times, most recently from 2907599 to 314f5e7 Compare November 12, 2019 10:41
@janezd
Copy link
Contributor

janezd commented Nov 14, 2019

TL;DR: Checkout my commit and see what I've done. :|

I'm sorry... There was a huge gap between the last radio button and the combo. I tried removing it and noticed there's an unnecessary box. And that the widget uses attribute indices althought the combo box uses a model. After fixing this, I realized that radio buttons are not necessary if we just use "Instance identity" as a placeholder for None. So, changing this, I noticed that the combo is disabled unless the diagram shows rows, hence, the combo actually belongs to one of the options in the other radio button group. This made the control area almost empty, in particular when I removed the empty and useless info box. So we arrived to what I've just committed.

@janezd
Copy link
Contributor

janezd commented Nov 14, 2019

Screenshot 2019-11-14 at 23 09 57

@janezd
Copy link
Contributor

janezd commented Nov 15, 2019

@AndrejaKovacic, in your last commit you removed context settings. You decided you didn't like them? :)

(I've modified the commit to put them back.)

@janezd janezd changed the title [ENH][RFC] Add venn over columns, simplify over rows [ENH] Add venn over columns, simplify over rows Nov 15, 2019
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.

In addition to the two problems, widget's Help page should also be updated since its functionality and controls changed quite significantly.

self._invalidate()
self._updateItemsets()
def _on_matching_changed(self):
self.output_duplicates_box.setEnabled(bool(self.rowwise))
Copy link
Contributor

Choose a reason for hiding this comment

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

Errrr, I don't get why the whole Output box would be disabled for Columns - including autocommit!
Probably only the Output duplicates option should be?

Edit: maybe this bug also hints at non-optimal naming - output_duplicates_box could be just output_box (duplicates setting is only one part of it).

Comment on lines 198 to 201
domains = [input.table.domain for input in self.data.values()]
self.samedomain = all((d1 == d2) for d1, d2 in pairwise(domains))
if not self.samedomain:
return self.settings_incompatible()
Copy link
Contributor

Choose a reason for hiding this comment

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

The domains do not need to match. That is why there is an option to change Rows, matched by: from Instance identity (where it makes sense to match domains first) to a single variable with unique identifiers (matching is done only on that attribute, the rest of the domains can differ).

To test use the zoo dataset, connect to Venn. Also connect to PCA->Scatter plot, select some points and connect to Venn. Venn should be able to match on attribute Name.

@@ -687,7 +596,7 @@ def __hash__(self):
def __eq__(self, other):
# XXX: comparing NaN with different payload
return (isinstance(other, ComparableInstance)
and domain_eq(self.domain, other.domain)
and (self.domain == other.domain)
Copy link
Contributor

Choose a reason for hiding this comment

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

This now compares metas as well (before we didn't). Intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was requested in the original issue, that domains match completely, when doing comparisons over rows. This is a remnant of that, but as we later decided against the idea, i should have reverted it. Good catch.

@lanzagar
Copy link
Contributor

lanzagar commented Nov 29, 2019

The mentioned problems seem to be fixed. I found a new one, and the documentation update is still needed (can be done last).

  • Instance identity used to ignore metas, now it uses them as well (can cause problems when a Selected column was added etc.). I don't think this was intentional?
  • Update documentation

@lanzagar lanzagar changed the title [ENH] Add venn over columns, simplify over rows [ENH] Venn Diagram: Add relations over columns, simplify over rows Dec 6, 2019
@lanzagar lanzagar merged commit 18ab617 into biolab:master Dec 6, 2019
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.

5 participants