Skip to content

fix: Resolved the time availability bug #304

Open
Triv24 wants to merge 2 commits into
komalharshita:mainfrom
Triv24:refactor/recommendation-engine
Open

fix: Resolved the time availability bug #304
Triv24 wants to merge 2 commits into
komalharshita:mainfrom
Triv24:refactor/recommendation-engine

Conversation

@Triv24
Copy link
Copy Markdown

@Triv24 Triv24 commented May 18, 2026

Return the projects with same or lower time availability as set by the user.

Summary [required]

Firstly, the recommendation engine used to return the projects with high time availability even when the time availability was set to low by the user. This PR refactors the engine, and the results only contain projects with the same time avaijlability or a lower one as set by the user.

Related Issue [required]

Closes #212

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 Modified score_single_project() function

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 and...
  5. Run the tests: python tests/test_basic.py

Expected test output:

29 passed, 1 failed out of 30 tests
  • Because one test is incorrectly written by someone else in other PR.

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_internal_server_error_page
  PASS  test_view_code_found
  PASS  test_download_code_found
  FAIL  test_health_check: test_health_check() missing 1 required positional argument: 'client'
  PASS  test_scoring_weights_has_all_keys

29 passed, 1 failed out of 30 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

There is NO Issue with the refactoring in this PR. One of the tests in tests/test_basic.py Failed because it was written wrongly in some PR. Another issue is opened for the required fix in test_basic.py already.

…aving same or lower time availability as set by user.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@Triv24 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

@Triv24 ensure that all checks pass

@komalharshita komalharshita added the need review Further information is requested label May 19, 2026
@Triv24
Copy link
Copy Markdown
Author

Triv24 commented May 19, 2026

I have rebased the main branch with a clean test_basic.py file. Kindly check once.

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.

[Bug]: Projects with high and medium time availability are recommended even when availability is set to low.

2 participants