66from asyncache import cached
77from cachetools import TTLCache
88
9-
109from ...caches import check_cache , load_cache
1110from ...coordinates import Coordinates
1211from ...location .nyt import NYTLocation
@@ -37,9 +36,7 @@ async def get(self, loc_id): # pylint: disable=arguments-differ
3736
3837
3938# Base URL for fetching category.
40- BASE_URL = (
41- "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv"
42- )
39+ BASE_URL = "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv"
4340
4441
4542def get_grouped_locations_dict (data ):
@@ -107,9 +104,7 @@ async def get_locations():
107104 # Make location history for confirmed and deaths from dates.
108105 # List is tuples of (date, amount) in order of increasing dates.
109106 confirmed_list = histories ["confirmed" ]
110- confirmed_history = {
111- date : int (amount or 0 ) for date , amount in confirmed_list
112- }
107+ confirmed_history = {date : int (amount or 0 ) for date , amount in confirmed_list }
113108
114109 deaths_list = histories ["deaths" ]
115110 deaths_history = {date : int (amount or 0 ) for date , amount in deaths_list }
@@ -120,23 +115,18 @@ async def get_locations():
120115 id = idx ,
121116 state = county_state [1 ],
122117 county = county_state [0 ],
123- coordinates = Coordinates (
124- None , None
125- ), # NYT does not provide coordinates
126- last_updated = datetime .utcnow ().isoformat ()
127- + "Z" , # since last request
118+ coordinates = Coordinates (None , None ), # NYT does not provide coordinates
119+ last_updated = datetime .utcnow ().isoformat () + "Z" , # since last request
128120 timelines = {
129121 "confirmed" : Timeline (
130122 {
131- datetime .strptime (date , "%Y-%m-%d" ).isoformat ()
132- + "Z" : amount
123+ datetime .strptime (date , "%Y-%m-%d" ).isoformat () + "Z" : amount
133124 for date , amount in confirmed_history .items ()
134125 }
135126 ),
136127 "deaths" : Timeline (
137128 {
138- datetime .strptime (date , "%Y-%m-%d" ).isoformat ()
139- + "Z" : amount
129+ datetime .strptime (date , "%Y-%m-%d" ).isoformat () + "Z" : amount
140130 for date , amount in deaths_history .items ()
141131 }
142132 ),
0 commit comments