Improved plan generator - #679
Conversation
- change points calc
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes and refactors the workshop plan generator by migrating to Python 3, introducing CLI argument parsing, and restructuring the core plan optimization and evaluation logic.
- Switch script to Python 3 and add
argparse-based CLI - Refactor user/workshop initialization and participation processing
- Enhance
Planclass with constants-driven mutations, evaluation, and optimization
Comments suppressed due to low confidence (2)
make_plan.py:60
- The comment states "2023 WWW workshops" but the dates refer to 2025; please update the comment to reflect the correct year.
# Block dates for 2023 WWW workshops
make_plan.py:104
- [nitpick] The key name
'part'is ambiguous; consider renaming it to'participation'or'registered_workshops'for clarity.
users_dict[uid]['part'] = set() # Workshops the user participates in
| print("COLLISION OF LECTURER") | ||
| print("\tlec_uid={uid} wid={wid}".format( | ||
| uid=lec_uid, wid=wid)) | ||
| points -= 10**6 |
There was a problem hiding this comment.
The variable points is used here without being initialized at the start of evaluate. You should initialize points (and similarly points_col) to 0 before applying penalties.
| print(" collisions / user collisions:", | ||
| collisions, "/", collision_users) | ||
| print("-------") | ||
| print("colisions total = {sum}, colision users total = {users}".format( |
There was a problem hiding this comment.
The word "colisions" (and "colision") is misspelled; it should be "collisions".
| print("colisions total = {sum}, colision users total = {users}".format( | |
| print("collisions total = {sum}, collision users total = {users}".format( |
| def process_participation(participation_data, users_dict, workshop_ids): | ||
| """Process participation data to track which users are participating in which workshops. | ||
|
|
||
| Args: | ||
| participation_data: List of participation records with uid and wid | ||
| users_dict: Dictionary of users with initialized blocks and participation sets | ||
| workshop_ids: List of workshop IDs |
There was a problem hiding this comment.
This function relies on the global workshops variable but only receives workshop_ids. Consider passing the workshops dict as an explicit parameter to reduce hidden global dependencies.
| def process_participation(participation_data, users_dict, workshop_ids): | |
| """Process participation data to track which users are participating in which workshops. | |
| Args: | |
| participation_data: List of participation records with uid and wid | |
| users_dict: Dictionary of users with initialized blocks and participation sets | |
| workshop_ids: List of workshop IDs | |
| def process_participation(participation_data, users_dict, workshop_ids, workshops): | |
| """Process participation data to track which users are participating in which workshops. | |
| Args: | |
| participation_data: List of participation records with uid and wid | |
| users_dict: Dictionary of users with initialized blocks and participation sets | |
| workshop_ids: List of workshop IDs | |
| workshops: Dictionary of workshop data |
This change is