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

New UI for prep stage #345

wants to merge 28 commits into from

Conversation

kirtansakariya
Copy link
Member

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-16.9%) to 57.681% when pulling 8618c3b on issues/336 into 0f0567b on master.

@coveralls
Copy link

coveralls commented Dec 4, 2018

Coverage Status

Coverage decreased (-17.8%) to 56.875% when pulling d470a71 on issues/336 into d7378e9 on master.

Copy link
Member

@JaimieMurdock JaimieMurdock left a 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 ValueErrors 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"
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.

requirements.txt Outdated
@@ -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.

@@ -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.

import numpy as np
input_filter = num
valid = True
f = open("test.txt", "w+")
Copy link
Member

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.

filtered += u' '.join(candidates)

if len(candidates) == len(c.words):
valid = False
Copy link
Member

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.



if len(candidates) == len(c.words):
valid = False
Copy link
Member

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.

@kirtansakariya
Copy link
Member Author

I'm raising the ValueError as requested now. As for pulling the asciimatics code, I still have it as copying the GitHub repo. I'm not too sure if there's another alternative. Should I try downloading it not in edit mode by removing the -e flag?

@JaimieMurdock
Copy link
Member

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 git in order to install topicexplorer.

there are a few options:

  • Wait for asciimatics to mint a new release.
  • Release a fork of asciimatics specific for our project to PyPI, then change deps once the new release is minted from asciimatics.
  • Delay release of the new interface to the public until the asciimatics release is done.

@kirtansakariya, can you provide any links or info about the release timeline from your conversations with the upstream developers?

@kirtansakariya
Copy link
Member Author

I'll leave a log of the conversations that we had, separated by which issues they were addressing

Text widget max length
peterbrittain/asciimatics#182
peterbrittain/asciimatics#184

FileBrowser filtering and pull request that talks about when the next release is going to be
peterbrittain/asciimatics#186
peterbrittain/asciimatics#187

Label height
peterbrittain/asciimatics#193

@JaimieMurdock
Copy link
Member

JaimieMurdock commented Apr 29, 2020

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:

@JaimieMurdock
Copy link
Member

JaimieMurdock commented Apr 29, 2020

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 asciimatics captures this?

@kirtansakariya
Copy link
Member Author

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.

@kirtansakariya
Copy link
Member Author

I'm thinking this might be related to issue #351.
I may try to look into issue #351 and see if that ends up fixing this one.

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