Remove tests for input/output summaries#667
Conversation
|
Tests should stop failing after #661 is merged |
VesnaT
left a comment
There was a problem hiding this comment.
The 'summary' code in widgets should be removed along with the tests.
A failing test is a good reminder of having useless code in a widget.
|
@VesnaT until we support Orange 3.28 we cannot remove code for summaries since they are still required for 3.28. I could change tests to test summaries on 3.28 and other versions (not sure if it is worth spending time with it). I can anyway make a test that will start failing when we raise the minimal version to 3.28. |
| self.Outputs.corpus.send(None) | ||
|
|
||
| # summary | ||
| if corpus: |
There was a problem hiding this comment.
The if is no longer relevant.
| self.info.set_input_summary(input_numbers, input_string) | ||
|
|
||
| def update_output_summary( | ||
| self, cor_output_len: Optional[int], n_selected: Optional[int] |
There was a problem hiding this comment.
There is an unused import of Optional among imports.
| successful = len(embeddings) if embeddings else 0 | ||
| unsuccessful = len(skipped) if skipped else 0 | ||
| if unsuccessful > 0: | ||
| self.Warning.unsuccessful_embeddings() |
There was a problem hiding this comment.
The 'warning' code should not be removed.
|
Thank you for spotting those errors. It should be fixed now. |
orangecontrib/text/corpus.py
Outdated
| extras = ( | ||
| ( | ||
| f"<br/><nobr>Total tokens: {sum(map(len, corpus.tokens))}, " | ||
| f"Total types: {len(corpus.dictionary)}</nobr>" |
There was a problem hiding this comment.
In my opinion total types are less understandable. @VesnaT what do you think bout replacing it with Number unique tokes or something similar.
Codecov Report
@@ Coverage Diff @@
## master #667 +/- ##
==========================================
- Coverage 74.01% 73.95% -0.07%
==========================================
Files 71 72 +1
Lines 9153 9122 -31
Branches 1236 1234 -2
==========================================
- Hits 6775 6746 -29
+ Misses 2143 2142 -1
+ Partials 235 234 -1 |
Issue
Orange 3.29 already supports automated summaries but they are not available for older versions of Orange. Since orange3-text supports older versions of Orange, they must stay implemented in widgets but tests are not working for newer versions of Orange.
Description of changes
Removing tests for summaries
Discussion needed: some widgets (e.g. Preprocess) also report on the number of tokens. I suggest implementing a similar summary that is in Preprocess widget to all outputs connected to the corpus.
Includes