This pull request includes significant changes to the calendar_scraper and calendar_saver modules in the access_amherst_backend package, focusing on simplifying the codebase and improving the categorization and location handling of events. The most important changes include removing location handling from the calendar_parser, moving it to the calendar_saver, and enhancing the event categorization logic.
Codebase simplification:
Removed the location_buckets dictionary and related functions (categorize_location, get_lat_lng, add_random_offset) from calendar_parser.py. [1][2]
Simplified the scrape_page function by removing location categorization and coordinate assignment. [1][2]
Location handling and categorization improvements:
Added the location_buckets dictionary and related functions (categorize_location, get_lat_lng, add_random_offset) to calendar_saver.py. [1][2]
Enhanced the save_calendar_event_to_db function to include location categorization and coordinate assignment, and improved the event categorization logic using TfidfVectorizer. [1][2]
Testing updates:
Removed tests related to location categorization and coordinate retrieval from test_calendar_parser.py.
This pull request includes significant changes to the
calendar_scraper
andcalendar_saver
modules in theaccess_amherst_backend
package, focusing on simplifying the codebase and improving the categorization and location handling of events. The most important changes include removing location handling from thecalendar_parser
, moving it to thecalendar_saver
, and enhancing the event categorization logic.Codebase simplification:
location_buckets
dictionary and related functions (categorize_location
,get_lat_lng
,add_random_offset
) fromcalendar_parser.py
. [1] [2]scrape_page
function by removing location categorization and coordinate assignment. [1] [2]Location handling and categorization improvements:
location_buckets
dictionary and related functions (categorize_location
,get_lat_lng
,add_random_offset
) tocalendar_saver.py
. [1] [2]save_calendar_event_to_db
function to include location categorization and coordinate assignment, and improved the event categorization logic usingTfidfVectorizer
. [1] [2]Testing updates:
test_calendar_parser.py
.