-
Notifications
You must be signed in to change notification settings - Fork 22
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
New UI for prep stage #345
base: master
Are you sure you want to change the base?
Changes from 20 commits
de39576
79f7db4
562df93
4f8b799
07c39d3
4789197
9299811
0cc848d
fe80ac1
d3964bc
3c7f493
b8abbff
6af97af
79e51aa
4637720
2ffed42
bb38671
8618c3b
7dcde53
6d43236
7b7ede8
af695ed
327d4c5
0dbab9c
a970384
7dc3ff7
7751cfe
d470a71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-e git+https://github.com/peterbrittain/asciimatics.git@fcedb4947933de7e1507ec0dee8ca7a3f466928a#egg=asciimatics | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, do we need the specific commit? Opening it in edit mode also introduces a dependency on git. This is not desired as it makes non-CS student installs way more complicated (install anaconda, install git, change the path, install topicexplorer, ...) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same reason as above. |
||
bottle>=0.12.0 | ||
brewer2mpl>=1.4.0,<1.5.0 | ||
decorator>=4.0.5 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,50 +58,54 @@ def test_get_candidate_words(): | |
|
||
@patch('topicexplorer.prep.input') | ||
def test_get_high_filter(input_mock): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There will be some revisions to these tests based on changes to the |
||
input_mock.side_effect = ['3', 'y'] | ||
high_filter, candidates = topicexplorer.prep.get_high_filter(corpus) | ||
assert high_filter == 3 | ||
# Test with high filter of 3 | ||
items, counts = topicexplorer.prep.get_corpus_counts(corpus) | ||
candidates, filtered, valid = topicexplorer.prep.get_high_filter_stops(corpus, words=set(), items=items, counts=counts, num=3) | ||
assert len(corpus.words) - len(candidates) == 3 | ||
assert candidates == ['I'] | ||
assert valid == True | ||
|
||
# Test selection of all words | ||
input_mock.side_effect = ['3', '1', '3', 'y'] | ||
high_filter, candidates = topicexplorer.prep.get_high_filter(corpus) | ||
assert high_filter == 3 | ||
assert candidates == ['I'] | ||
# Test with high filter of 0 | ||
candidates, filtered, valid = topicexplorer.prep.get_high_filter_stops(corpus, words=set(), items=items, counts=counts, num=0) | ||
assert len(corpus.words) - len(candidates) == 4 | ||
assert candidates == [] | ||
assert valid == True | ||
|
||
# Test not accept | ||
input_mock.side_effect = ['3', 'n', '3', 'y'] | ||
high_filter, candidates = topicexplorer.prep.get_high_filter(corpus) | ||
assert high_filter == 3 | ||
assert candidates == ['I'] | ||
|
||
# Test invalid action | ||
input_mock.side_effect = ['blahhhh', '3', 'y'] | ||
high_filter, candidates = topicexplorer.prep.get_high_filter(corpus) | ||
assert high_filter == 3 | ||
assert candidates == ['I'] | ||
# Test with high filter of 1, should return invalid | ||
candidates, filtered, valid = topicexplorer.prep.get_high_filter_stops(corpus, words=set(), items=items, counts=counts, num=1) | ||
assert len(corpus.words) - len(candidates) == 0 | ||
assert candidates == ['I', 'came', 'conquered', 'saw'] | ||
assert valid == False | ||
|
||
# Test with high filter of 100 | ||
candidates, filtered, valid = topicexplorer.prep.get_high_filter_stops(corpus, words=set(), items=items, counts=counts, num=100) | ||
assert len(corpus.words) - len(candidates) == 4 | ||
assert candidates == [] | ||
assert valid == True | ||
|
||
@patch('topicexplorer.prep.input') | ||
def test_get_low_filter(input_mock): | ||
input_mock.side_effect = ['1', 'y'] | ||
low_filter, candidates = topicexplorer.prep.get_low_filter(corpus) | ||
assert low_filter == 1 | ||
# Test with low filter of 1 | ||
items, counts = topicexplorer.prep.get_corpus_counts(corpus) | ||
candidates, filtered, valid = topicexplorer.prep.get_low_filter_stops(corpus, words=set(), items=items, counts=counts, num=1) | ||
assert len(corpus.words) - len(candidates) == 1 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered']) | ||
assert valid == True | ||
|
||
# Test selection of all words | ||
input_mock.side_effect = ['1', '3', '1', 'y'] | ||
low_filter, candidates = topicexplorer.prep.get_low_filter(corpus) | ||
assert low_filter == 1 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered']) | ||
|
||
# Test not accept | ||
input_mock.side_effect = ['1', 'n', '1', 'y'] | ||
low_filter, candidates = topicexplorer.prep.get_low_filter(corpus) | ||
assert low_filter == 1 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered']) | ||
|
||
# Test invalid action | ||
input_mock.side_effect = ['blahhhh', '1', 'y'] | ||
low_filter, candidates = topicexplorer.prep.get_low_filter(corpus) | ||
assert low_filter == 1 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered']) | ||
# Test with low filter of 3 | ||
candidates, filtered, valid = topicexplorer.prep.get_low_filter_stops(corpus, words=set(), items=items, counts=counts, num=3) | ||
assert len(corpus.words) - len(candidates) == 0 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered', 'I']) | ||
assert valid == False | ||
|
||
# Test with low filter of 0 | ||
candidates, filtered, valid = topicexplorer.prep.get_low_filter_stops(corpus, words=set(), items=items, counts=counts, num=0) | ||
assert len(corpus.words) - len(candidates) == 4 | ||
assert all(w in candidates for w in []) | ||
assert valid == True | ||
|
||
# Test with low filter of 100 | ||
candidates, filtered, valid = topicexplorer.prep.get_low_filter_stops(corpus, words=set(), items=items, counts=counts, num=100) | ||
assert len(corpus.words) - len(candidates) == 0 | ||
assert all(w in candidates for w in ['came', 'saw', 'conquered', 'I']) | ||
assert valid == False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a particular reason why we need that specific commit for asciimatics? Will it be folded into a release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of right now, the version of asciimatics that we need has not had an official release. I asked them when they plan on doing another release and they said that it would be in a couple of months. So until them, we will have to use that specific commit or the asiimatics repo in general.