-
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?
Conversation
…into issues/336
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.
Hi Kirtan, a few comments on the revised filter functions - mostly do a refactor to raise ValueError
s on invalid responses rather than returning a valid = False
variable.
@@ -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" |
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.
requirements.txt
Outdated
@@ -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 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, ...)
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.
Same reason as above.
tests/test_prep.py
Outdated
@@ -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 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.
topicexplorer/prep.py
Outdated
import numpy as np | ||
input_filter = num | ||
valid = True | ||
f = open("test.txt", "w+") |
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.
This test code should be removed.
topicexplorer/prep.py
Outdated
filtered += u' '.join(candidates) | ||
|
||
if len(candidates) == len(c.words): | ||
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.
raise a ValueError here, rather than returning an invalid state. Our style should favor exceptions that are explicitly handled, rather than letting it silently fail and introduce inconsistency later.
topicexplorer/prep.py
Outdated
|
||
|
||
if len(candidates) == len(c.words): | ||
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.
again, introduce a ValueError that can be try-except
-ed rather than a new variable to test.
I'm raising the |
The lack of a published patch is quite the problem for the software to end users, as opposed to developers. We do not want to require our users to set up there are a few options:
@kirtansakariya, can you provide any links or info about the release timeline from your conversations with the upstream developers? |
I'll leave a log of the conversations that we had, separated by which issues they were addressing
|
Hey @kirtansakariya, it looks like all of your patches made it into v1.11.0. With some testing I think we can merge this! Going to start this tonight:
|
So I'm having some stalling issues with a low frequency filter of 20% on the AP corpus. This is rather small... List finally printed after 3 minutes, but isn't scrollable. It also seems like Ctrl+C isn't working to terminate the program - perhaps |
Back when I was working on it I don't think I had the option to make the list scrollable but I can look into it again to see if they've added anything like that yet or if I had just missed it last year. |
This addresses issue #336.
A GUI has been implemented using asciimatics to replace the old command prompt/terminal based prep stage.
Note: need to install asciimatics using
pip install --src . -e git+https://github.com/peterbrittain/asciimatics.git#egg=asciimatics