bucky.data#

Submodule containing objects that manage the input data

Submodules#

Package Contents#

Classes#

AdminLevelMapping

Wrapper for the stack of admin levels and their info

CSSEData

Dataclass that holds the CSSE case/death data.

HHSData

Dataclass that holds the HHS hospitalization data.

class bucky.data.AdminLevelMapping(adm2: AdminLevel, adm1: Optional[AdminLevel] = None, adm0: Optional[AdminLevel] = None, levels: dict = field(init=False))[source]#

Wrapper for the stack of admin levels and their info

adm0 :AdminLevel#
adm1 :AdminLevel#
adm2 :AdminLevel#
__repr__(self) str[source]#

Pretty print the mapping obj

actual_adm1_ids(self)[source]#

DEPRECATED

static from_csv(filename: bucky._typing.PathLike)[source]#

Read the admin mapping from a csv file

mapping(self, from_: str, to: str, level: int)[source]#

Return dict mappings between attributes of the admin level (for use with pandas.Series.map)

property n_adm1(self)#

DEPRECATED: return the number of adm1 regions

to_csv(self, filename: bucky._typing.PathLike)[source]#

Save the admin mapping to a csv file

class bucky.data.CSSEData[source]#

Bases: SpatialStratifiedTimeseries

Dataclass that holds the CSSE case/death data.

cumulative_cases :bucky._typing.ArrayLike#
cumulative_deaths :bucky._typing.ArrayLike#
incident_cases :bucky._typing.ArrayLike#
incident_deaths :bucky._typing.ArrayLike#
__post_init__(self)[source]#

Fill in incidence data if only inited with cumulatives.

static from_csv(file: bucky._typing.PathLike, n_days: Optional[int] = None, valid_date_range=(None, None), force_enddate: Optional[datetime.date] = None, force_enddate_dow: Optional[int] = None, adm_mapping: Optional[bucky.data.adm_mapping.AdminLevelMapping] = None)[source]#

Read CSSE data from a CSV.

class bucky.data.HHSData[source]#

Bases: SpatialStratifiedTimeseries

Dataclass that holds the HHS hospitalization data.

current_hospitalizations :bucky._typing.ArrayLike#
incident_hospitalizations :bucky._typing.ArrayLike#
static from_csv(file: bucky._typing.PathLike, n_days: Optional[int] = None, valid_date_range=(None, None), force_enddate: Optional[datetime.date] = None, force_enddate_dow: Optional[int] = None, adm_mapping: Optional[bucky.data.adm_mapping.AdminLevelMapping] = None)[source]#

Read HHS data from a CSV.