-
Notifications
You must be signed in to change notification settings - Fork 1
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
Various fixes and features #75
Conversation
- requires running flask with routes to applicant cvs and pdf.js
Hi @shiyingwucl - I've made a few changes and feature updates. You can go through each commit, it should be pretty easy to follow. |
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.
Thank you for all the great QoL changes! I've tried out the new features - the REPL and interactive sorter is amazing and easy to use, everything also feels a lot more impactful and brutal now!
Some errors and bugs I've come across:
- pressing "q" to quit when ranking from applicant table throws an error:
AttributeError: 'NoneType' object has no attribute 'values'
. It works great in the interactive sorter so I think it's a problem with my existing code - readline package not avaliable for Windows
@@ -1,89 +1,130 @@ | |||
import readline |
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.
I've been having some trouble with the readline package on Windows - when I try to run the script, I encounter ModuleNotFoundError: No module named 'readline'
and attempting to pip install readline
throws another error. Using pyreadline3 might solve this issue according to this stack overflow page
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.
Yes, readline won't be on Windows. Can you try out the suggestion and see if it works, please.
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.
Yes it fixed the issue!
@@ -44,6 +44,7 @@ def __init__(self, path): | |||
self.options_home = { | |||
"a": (self.show_applicants_list_table, "APPLICANTS"), | |||
"r": (self.show_role_info, "ROLE"), | |||
"R": (self.repl, "REPL"), |
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 addition works great! Made REPL a lot simpler to use😄
if choice == "q": | ||
print("EXITING TOURNAMENT COMPARISON") | ||
print() | ||
return |
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.
Quiting ranking with 'q' throws an error for me: AttributeError: 'NoneType' object has no attribute 'values'
shortlister/controller.py
Outdated
name, # noqa | ||
score, # noqa | ||
rtw, # noqa | ||
cv, # noqa | ||
notes, # noqa |
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.
What does the comment noqa
mean?
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.
When you use a linter, or code checker, those imports would throw errors because the functions aren't called anywhere in the code (but we need them because use could be used them for filtering). #noqa
at the end of the line silences those errors/warnings. Here's a more thorough explanation,
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.
Thank you, it makes a lot more sense to me now 👍
shortlister/controller.py
Outdated
@dataclass | ||
class Context: | ||
applicants: list[Applicant] | ||
applicant_index: int | ||
criterion: Criterion | ||
table_view: ViewWidth | ||
applicants: list[Applicant] # selected applicants | ||
applicant_index: int # selected applicant | ||
criterion: Criterion | None # selected criterion to score | ||
table_view: ViewWidth # selected applicants' table view |
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.
Putting these variable into a separate class makes the code so much more cleaner!
def view_table_legend(self, criteria): | ||
criteria_names = [criteria.name for criteria in criteria] | ||
abbreviations = abbreviate(criteria_names) | ||
legend = dict(zip(abbreviations, criteria_names)) | ||
legend = dict(sorted(legend.items())) | ||
for line in legend.items(): | ||
print(f"{line[0]}: {line[1]}") | ||
print() |
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.
Makes table abbreviations extremely user friendly👍
No description provided.