Feature/issue 1090#1163
Open
riyanshigupta890-cloud wants to merge 5 commits into
Open
Conversation
|
@riyanshigupta890-cloud 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary [required]
This PR implements configurable recommendation scoring weights, allowing non-developers to tune the recommendation engine without modifying code. Previously, scoring weights were hardcoded as magic numbers in
utils/recommender.py, making it impossible to adjust them without code changes or test different scoring strategies.The solution adds a JSON configuration file and a config loader in
src/config.pythat reads weights at runtime. Weights are cached for performance, and can be overridden via environment variables for different deployments.Related Issue [required]
Closes #1090
Type of Change [required]
What Was Changed [required]
src/config.pyload_recommendation_weights()method andget_recommendation_weights()function to load weights from JSON config file with validation and cachingutils/recommender.pySCORING_WEIGHTSdictionary; updatedscore_single_project()to load weights from config at runtimeconfig/recommendation_weights.jsonHow to Test This PR [required]
git checkout feature/issue-1090python verify_config.pyExpected test output:
Test Results [required]
All existing tests continue to pass. The new config loading was verified with the verification script:
✓ Testing config loading...
✓ Successfully imported get_recommendation_weights
✓ Loaded weights: {'skill': 3, 'level': 2, 'interest': 2, 'time': 1}
✓ Weights are correct!
✅ ALL CHECKS PASSED - Configuration is working!
Screenshots (if UI change)
N/A — Backend feature only
Self-Review Checklist [required]
feature/issue-1090verify_config.py— all checks passNotes for Reviewer
RECOMMENDATION_WEIGHTS_PATHenvironment variable, enabling different weight configurations per deployment