Refactor recommender scoring weights and add test#173
Conversation
|
@EHEGUY is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
Summary [required]This PR centralizes the recommendation scoring weights into a single Related Issue [required]Closes #173 Type of Change [required]
What Was Changed [required]
How to Test This PR [required]
Expected test output: Test Results [required]Self-Review Checklist [required]
Notes for ReviewerNone |
komalharshita
left a comment
There was a problem hiding this comment.
Thank you for the contribution — this is a clean and meaningful refactor.
Centralizing the recommendation scoring weights into a single SCORING_WEIGHTS dictionary improves maintainability and makes future configuration changes easier to manage. The added unit test is also a good addition and fits the scope of the PR well.
Before this can be merged, please make the following updates:
- Link the PR to a related issue using:
Closes #issue_number
- Please update the PR description to properly follow the repository PR template, including:
- issue reference,
- testing details,
- completed checklist sections.
Once these contribution-process updates are completed, the PR should be good to merge.
Thank you @komalharshita for the review and the positive feedback on the refactor! I have updated the PR description to fully follow the repository's template. The description now includes: The issue reference (Closes #173) |
|
Approved for merge! |
Description
This PR refactors the recommendation engine's scoring logic by consolidating the module-level weight constants (
WEIGHT_SKILL,WEIGHT_LEVEL,WEIGHT_INTEREST,WEIGHT_TIME) into a singleSCORING_WEIGHTSdictionary. It also updatesscore_single_project()to reference this new structure, improving overall code organization and maintainability.Additionally, a unit test has been added to verify the integrity of the new dictionary.
Changes Made
utils/recommender.py: Replaced individual weight constants with theSCORING_WEIGHTSdictionary and updated downstream variable references.tests/test_basic.py: Addedtest_scoring_weights_has_all_keysto ensure all four required keys (skill,level,interest,time) remain present.