bucky.make_input_graph
Makes input graphs for the model using case, demographic, and mobility data.
compute_population_density(age_df, shape_df)
compute_population_density
Computes normalized population density.
get_case_history(historical_data, end_date, num_days=DAYS_OF_HIST)
get_case_history
Gets case and death history for the requested number of days for each FIPS.
get_lex(last_requested_date, window_size=7)
get_lex
Reads county-level location exposure indices from PlaceIQ location data and applies a window.
get_mobility_data(pop_density, end_date, county_df)
get_mobility_data
Fetches mobility data.
get_safegraph(last_requested_date, window_size=7)
get_safegraph
Reads SafeGraph mobility data and applies a window.
read_descartes_data(end_date)
read_descartes_data
Reads Descartes mobility data [WS20].
read_lex_data(date)
read_lex_data
Reads county-level location exposure indices for a given date from PlaceIQ location data.
bucky.make_input_graph.
DAYS_OF_HIST
args
parser
age_df (pandas.DataFrame) – age-stratified population data
pandas.DataFrame
shape_df (geopandas.GeoDataFrame) – GeoDataFrame with shape information indexed by FIPS
geopandas.GeoDataFrame
pop_density – pandas.DataFrame with population density by FIPS
If data is missing for a date, it is replaced with the data from the last valid date.
historical_data (pandas.DataFrame) – Dataframe with case, death data indexed by date, FIPS
end_date (str) – Last date to get data for
str
num_days (int) – Number of days of history requested
int
hist – Dictionary of case data, keyed by FIPS
dict
last_requested_date (str) – Fetches data for requested date
window_size (int, optional) – Size of window, in days, to apply to data
frac_df – TODO
pop_density (pandas.DataFrame) – Population density indexed by FIPS
end_date (str) – Last date of historical data
county_df (pandas.DataFrame) – County-level shape data
edge_weights (pandas.DataFrame) – TODO
movement_dict (dict) – TODO
end_date (str) – Last date to get Descartes data
nat_frac_move (pandas.DataFrame) – TODO
dl_state (pandas.DataFrame) – TODO
dl_county (pandas.DataFrame) – TODO
Notes
Data provided by Descartes Labs (https://descarteslabs.com/mobility/) 1
Warren, Michael S. & Skillman, Samuel W. “Mobility Changes in Response to COVID-19”. arXiv:2003.14228 [cs.SI], Mar. 2020. arxiv.org/abs/2003.14228
In order to improve performance, preprocessed data is saved. If the user requests data for a date that has already been preprocessed, it will read the data from disk instead of repeating the processing.
date (str) – Fetches data for requested date
df_long – Preprocessed LEX data
bucky.viz.plot
bucky.numerical_libs