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

Various fixes and features #75

Merged
merged 37 commits into from
Jan 6, 2025
Merged

Various fixes and features #75

merged 37 commits into from
Jan 6, 2025

Conversation

tamuri
Copy link
Collaborator

@tamuri tamuri commented Dec 10, 2024

No description provided.

tamuri added 30 commits December 6, 2024 22:20
- requires running flask with routes to applicant cvs and pdf.js
@tamuri
Copy link
Collaborator Author

tamuri commented Jan 1, 2025

Hi @shiyingwucl - I've made a few changes and feature updates. You can go through each commit, it should be pretty easy to follow.

@tamuri tamuri marked this pull request as ready for review January 1, 2025 11:56
@tamuri tamuri requested a review from shiyingwucl January 1, 2025 11:56
Copy link
Collaborator

@shiyingwucl shiyingwucl left a 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
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

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"),
Copy link
Collaborator

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😄

Comment on lines +41 to +44
if choice == "q":
print("EXITING TOURNAMENT COMPARISON")
print()
return
Copy link
Collaborator

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'

Comment on lines 20 to 24
name, # noqa
score, # noqa
rtw, # noqa
cv, # noqa
notes, # noqa
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,

Copy link
Collaborator

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 👍

Comment on lines 36 to 41
@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
Copy link
Collaborator

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!

Comment on lines +120 to +127
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()
Copy link
Collaborator

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👍

@shiyingwucl shiyingwucl merged commit 3cb63a3 into UCL-ARC:main Jan 6, 2025
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.

2 participants