1212 get_epiweek ,
1313 group_by_property ,
1414)
15- from alternative_interface .helper import covidcast_fluview_locations_mapping
15+ from alternative_interface .helper import COVIDCAST_FLUVIEW_LOCATIONS_MAPPING , EXPRESS_VIEW_LABELS_MAPPING
1616
1717
1818def epiweeks_in_date_range (start_date_str : str , end_date_str : str ):
@@ -161,7 +161,7 @@ def get_covidcast_data(indicator, start_date, end_date, geo, api_key):
161161def get_fluview_data (indicator , geo , start_date , end_date , api_key ):
162162 region = None
163163 try :
164- region = covidcast_fluview_locations_mapping [geo ]
164+ region = COVIDCAST_FLUVIEW_LOCATIONS_MAPPING [geo ]
165165 except KeyError :
166166 region = geo .split (":" )[1 ]
167167 time_values = f"{ start_date } --{ end_date } "
@@ -173,7 +173,6 @@ def get_fluview_data(indicator, geo, start_date, end_date, api_key):
173173 "epiweeks" : time_values ,
174174 "api_key" : api_key if api_key else settings .EPIDATA_API_KEY ,
175175 }
176- print (indicator )
177176 response = requests .get (f"{ settings .EPIDATA_URL } { indicator ['data_source' ]} " , params = params )
178177 if response .status_code == 200 :
179178 data = response .json ()
@@ -437,7 +436,7 @@ def get_chart_data(indicators, geography):
437436 data_end_date = today .strftime ("%Y-%m-%d" )
438437
439438 for indicator in indicators :
440- title = generate_epivis_custom_title (indicator , geo_display_name )
439+ title = EXPRESS_VIEW_LABELS_MAPPING . get ( indicator [ "name" ], generate_epivis_custom_title (indicator , geo_display_name ) )
441440 color = generate_random_color ()
442441 indicator_time_type = indicator .get ("time_type" , "week" )
443442 data = None
@@ -468,7 +467,7 @@ def get_chart_data(indicators, geography):
468467 )
469468 # Apply readable label, color, and normalize data for each dataset
470469 for ds in series ["datasets" ]:
471- ds ["label" ] = f" { title } - { ds [ 'label' ] } "
470+ ds ["label" ] = title
472471 ds ["borderColor" ] = color
473472 ds ["backgroundColor" ] = f"{ color } 33"
474473 # Normalize data to 0-100% range
0 commit comments