Skip to content

Improve documentation for recommendation scoring logic#27

Merged
komalharshita merged 3 commits into
komalharshita:mainfrom
devcode-srish:docs/recommender-comments
May 14, 2026
Merged

Improve documentation for recommendation scoring logic#27
komalharshita merged 3 commits into
komalharshita:mainfrom
devcode-srish:docs/recommender-comments

Conversation

@devcode-srish
Copy link
Copy Markdown
Contributor

@devcode-srish devcode-srish commented May 11, 2026

Summary [required]

This PR improves the clarity and maintainability of the recommendation scoring system by adding beginner-friendly inline comments and explanations throughout the recommender logic.

The update explains how scoring weights are applied, how filtering works, and how recommendations are ranked, making the recommendation engine easier for new contributors to understand and extend.

Additionally, this PR fixes failing starter code endpoint tests by adding the missing starter_code/ directory and required starter file referenced in data/projects.json. This restores the /project//code and /project//download functionality and ensures the full test suite passes successfully.

Related Issue [required]

Closes #24

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
utils/recommender.py Added inline comments to explain scoring weights and clarified filtering logic for better readability
utils/file_server.py Improved starter code directory path resolution
starter_code/expense_tracker.py Added missing starter code file required for code-view and download endpoints

How to Test This PR [required]

  1. Clone this branch: git checkout your-branch-name
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000
  5. Enter sample inputs (skills, time, interests) and verify recommendations are displayed correctly
  6. Verify starter code endpoints:
    /project/1/code
    /project/1/download
  7. Run tests: python tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results [required]

  PASS  test_projects_json_loads
  PASS  test_each_project_has_required_fields
  PASS  test_find_project_by_id_found
  PASS  test_find_project_by_id_missing
  PASS  test_parse_skills_basic
  PASS  test_parse_skills_empty_string
  PASS  test_parse_skills_single_entry
  PASS  test_score_single_project_full_match
  PASS  test_score_single_project_no_match
  PASS  test_get_recommendations_returns_results
  PASS  test_get_recommendations_max_three
  PASS  test_get_recommendations_no_match_returns_empty
  PASS  test_get_recommendations_result_format
  PASS  test_validate_all_valid
  PASS  test_validate_missing_skills
  PASS  test_validate_missing_level
  PASS  test_validate_missing_interest
  PASS  test_validate_missing_time
  PASS  test_validate_all_missing
  PASS  test_home_route
  PASS  test_recommend_api_valid
  PASS  test_recommend_api_missing_field
  PASS  test_recommend_api_empty_body
  PASS  test_project_detail_found
  PASS  test_project_detail_not_found
  PASS  test_view_code_found
  PASS  test_download_code_found

27 passed, 0 failed out of 27 tests

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

While investigating the failing CI checks, I found that the repository was missing the starter_code/ directory and referenced starter file used by the code-view and download endpoints. I added the required starter file and verified the full test suite locally.

All tests now pass successfully.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

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

@komalharshita
Copy link
Copy Markdown
Owner

please use the pull request template uploaded in the repository to breifly describe the changes made

@github-actions github-actions Bot added type:docs Improvements or additions to documentation gssoc-26 labels May 12, 2026
Copy link
Copy Markdown
Owner

@komalharshita komalharshita 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 the contribution.

The added comments and explanations improve the readability of the recommendation logic and make the code easier for new contributors to understand, which aligns well with the goal of the issue.

However, the PR currently does not pass all required checks (25/27 tests passing). Before this can be merged, please sync with the latest main branch and resolve the failing CI checks so that all tests pass successfully.

Once the checks are green, this PR should be ready for merge.

@komalharshita komalharshita merged commit 68693ac into komalharshita:main May 14, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve recommendation scoring documentation

2 participants