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

New UI for prep stage #345

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
de39576
done with skeleton for asciimatics
kirtansakariya Oct 4, 2018
79f7db4
copy before removing comments
kirtansakariya Nov 12, 2018
562df93
removed comments
kirtansakariya Nov 12, 2018
4f8b799
removing booleans meant for highlighting fields
kirtansakariya Nov 12, 2018
07c39d3
added comments
kirtansakariya Nov 12, 2018
4789197
removed most unused variables
kirtansakariya Nov 12, 2018
9299811
making text fields on summary smaller
kirtansakariya Nov 14, 2018
0cc848d
need to handle file selection in file browser
kirtansakariya Nov 21, 2018
fe80ac1
handling invalid values for percentages
kirtansakariya Nov 27, 2018
d3964bc
adding comments
kirtansakariya Nov 28, 2018
3c7f493
file preview, rearranging wizard screens
kirtansakariya Dec 3, 2018
b8abbff
Merge branch 'master' into issues/336
kirtansakariya Dec 3, 2018
6af97af
adding asciimatics to the requirements.txt
kirtansakariya Dec 4, 2018
79e51aa
Merge branch 'master' of https://github.com/inpho/topic-explorer into…
kirtansakariya Dec 4, 2018
4637720
Merge branch 'issues/336' of https://github.com/inpho/topic-explorer …
kirtansakariya Dec 4, 2018
2ffed42
demo works now
kirtansakariya Dec 4, 2018
bb38671
working on tests
kirtansakariya Dec 4, 2018
8618c3b
modifying test cases
kirtansakariya Dec 4, 2018
7dcde53
adding asciimatics install to windows build
kirtansakariya Dec 5, 2018
6d43236
adding dividers for wizard screens
kirtansakariya Dec 6, 2018
7b7ede8
raising ValueError now
kirtansakariya Dec 18, 2018
af695ed
using instance of unittest.TestCase
kirtansakariya Dec 23, 2018
327d4c5
Merge branch 'master' into issues/336
kirtansakariya Dec 31, 2018
0dbab9c
Merge branch 'master' into issues/336
kirtansakariya Jan 31, 2019
a970384
Merge branch 'master' into issues/336
kirtansakariya Feb 23, 2019
7dc3ff7
Merge branch 'master' into issues/336
kirtansakariya Jan 15, 2020
7751cfe
updating asciimatics reqs
JaimieMurdock Apr 29, 2020
d470a71
interrupts enabled
kirtansakariya May 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install:
- "%PYTHON%\\python.exe -m conda install -q --yes cython scikit-learn pandas" # for vsm
- "%PYTHON%\\python.exe -c \"import nltk; nltk.download('stopwords'); nltk.download('punkt')\""
- "%PYTHON%\\python.exe -m pip install unittest2 nose wget"
- "%PYTHON%\\python.exe -m pip install -e git+https://github.com/peterbrittain/asciimatics.git@fcedb4947933de7e1507ec0dee8ca7a3f466928a#egg=asciimatics"
Copy link
Member

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?

Copy link
Member Author

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.

- "%PYTHON%\\python.exe -m pip install ."

build: off
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
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
Copy link
Member

Choose a reason for hiding this comment

The 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, ...)

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Expand Down
82 changes: 43 additions & 39 deletions tests/test_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,50 +58,54 @@ def test_get_candidate_words():

@patch('topicexplorer.prep.input')
def test_get_high_filter(input_mock):
Copy link
Member

Choose a reason for hiding this comment

The 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 topicexplorer.prep.get_high_filter_stops call signature - namely, it should not return a third part of the tuple called valid - rather a ValueError exception should be raised and handled by the caller.

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
Loading