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

OWAnnotator: add heuristics for choosing the right x and y #1046

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

ajdapretnar
Copy link
Collaborator

Issue

When a corpus contains continuous metas, they are used for plotting instead of t-SNE variables.

Description of changes

Use heuristics to set t-SNE variables as default variables for plotting.

Includes
  • Code changes
  • Tests
  • Documentation

@ajdapretnar
Copy link
Collaborator Author

The test is currently not working. It continues to throw "PC1" as attr_x for some reason.

widget = self.create_widget(OWAnnotator)
c = preprocess(Corpus.from_file("slo-opinion-corpus.tab"))
self.send_signal(widget.Inputs.corpus, c[:20])
self.wait_until_finished()
Copy link
Contributor

Choose a reason for hiding this comment

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

When you create a new widget within a test you need to pass it to the wait_until_finished:
self.wait_until_finished(widget=widget)

Beside that, the wait_until_finished has nothing to do with the attributes. It waits for run to finish, i.e. on_done to happen.
However, it should be called (wait_until_finished) anyway not to mess up the other tests.

self.send_signal(widget.Inputs.corpus, c[:20])
self.wait_until_finished()
controls = widget.controls
self.assertEqual(controls.attr_x, "t-SNE-x")
Copy link
Contributor

Choose a reason for hiding this comment

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

controls.attr_x is a QCombo and not a string.
string is a corresponing property widget.attr_x.name.
So you can either do:
self.assertEqual(controls.attr_x.currentText(), "t-SNE-x")
or
self.assertEqual(widget.attr_x.name, "t-SNE-x").

Another thing, your data has PCA instead of tSNE.

@codecov-commenter
Copy link

Codecov Report

Merging #1046 (edf91c8) into master (e36fdea) will decrease coverage by 0.27%.
Report is 6 commits behind head on master.
The diff coverage is 100.00%.

❗ Current head edf91c8 differs from pull request most recent head a399811. Consider uploading reports for the commit a399811 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
- Coverage   82.51%   82.25%   -0.27%     
==========================================
  Files          92       93       +1     
  Lines       12400    12448      +48     
  Branches     1695     1699       +4     
==========================================
+ Hits        10232    10239       +7     
- Misses       1855     1896      +41     
  Partials      313      313              

@VesnaT VesnaT marked this pull request as ready for review March 21, 2024 07:23
@VesnaT VesnaT merged commit 7456311 into biolab:master Mar 21, 2024
11 of 12 checks passed
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