bucky.data.timeseries
#
Objects that hold timeseries objects defined over multiple locations.
Module Contents#
Classes#
Dataclass that holds the fitted CSSE case/death data, including incidence rates. |
|
Dataclass for fitted case/death time series data. |
|
Dataclass that holds the CSSE case/death data. |
|
Dataclass that holds the HHS hospitalization data. |
|
Class representing a generic timeseries that is defined over admin regions. |
Functions#
|
Calculate the bool mask for dates to include from the historical data. |
- class bucky.data.timeseries.BuckyFittedCaseData[source]#
Bases:
SpatialStratifiedTimeseries
Dataclass that holds the fitted CSSE case/death data, including incidence rates.
- cumulative_cases :bucky._typing.ArrayLike#
- cumulative_deaths :bucky._typing.ArrayLike#
- incident_cases :bucky._typing.ArrayLike#
- incident_deaths :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 fitted CSSE data from CSV.
- class bucky.data.timeseries.BuckyFittedData[source]#
Bases:
SpatialStratifiedTimeseries
Dataclass for fitted case/death time series data.
- cumulative_cases :bucky._typing.ArrayLike#
- cumulative_deaths :bucky._typing.ArrayLike#
- incident_cases :bucky._typing.ArrayLike#
- incident_deaths :bucky._typing.ArrayLike#
- class bucky.data.timeseries.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#
- 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.timeseries.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.
- class bucky.data.timeseries.SpatialStratifiedTimeseries[source]#
Class representing a generic timeseries that is defined over admin regions.
- adm_ids :bucky._typing.ArrayLike#
- adm_level :int#
- adm_mapping :bucky.data.adm_mapping.AdminLevelMapping#
- dates :bucky._typing.ArrayLike#
- static _generic_from_csv(filename: 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_col: str = 'adm2', date_col: str = 'date', column_names: Dict[str, str] = None)[source]#
Return a dict containing args to a subclass’s constructor
- property end_date(self) datetime.date #
The last date of valid data.
- property n_loc(self) int #
Total number of locations for which we have timeseries at the base admin level.
- property start_date(self) datetime.date #
The first date of valid data.
- sum_adm_level(self, level: Union[int, str])[source]#
Sum the values to a different admin level then they are defined on.
- bucky.data.timeseries._mask_date_range(dates: numpy.ndarray, n_days: Optional[int] = None, valid_date_range: Tuple[Optional[datetime.date], Optional[datetime.date]] = (None, None), force_enddate: Optional[datetime.date] = None, force_enddate_dow: Optional[int] = None)[source]#
Calculate the bool mask for dates to include from the historical data.