Developed a new endpoint /api/review/instructors/analysis/ to Penn Course Review to query and retrieve a list of top instructors, either within a specified department or across all departments, based on their performance statistics, primarily focusing on maximum average ratings.
The functionality allows users to specify a range between start and end semesters, or defaults to the complete available data set. it filters the Review objects based on optional parameters such as department and semester range, using the previously-built review_averages function to compute statistics and aggregate them with appropriate annotations. The endpoint was also successfully tested through unit tests.
Possible considerations include the performance implications of the initial data retrieval process, which pulls all Review objects before filtering. This could lead to increased runtime or memory usage, particularly with a large dataset, as each query's complexity scales with the number of reviews.
Developed a new endpoint
/api/review/instructors/analysis/
to Penn Course Review to query and retrieve a list of top instructors, either within a specified department or across all departments, based on their performance statistics, primarily focusing on maximum average ratings.The functionality allows users to specify a range between start and end semesters, or defaults to the complete available data set. it filters the
Review
objects based on optional parameters such as department and semester range, using the previously-builtreview_averages
function to compute statistics and aggregate them with appropriate annotations. The endpoint was also successfully tested through unit tests.Possible considerations include the performance implications of the initial data retrieval process, which pulls all Review objects before filtering. This could lead to increased runtime or memory usage, particularly with a large dataset, as each query's complexity scales with the number of reviews.