Input Demographics¶
There are two main demographic objects needed to pull data from the IHME databases, and more generally for building the cascade model.
Demographics¶
-
class
cascade_at.inputs.demographics.
Demographics
(gbd_round_id, location_set_version_id=None)[source]¶ Bases:
object
Grabs and stores demographic information needed for shared functions. Will also make a location hierarchy dag.
- Parameters
gbd_round_id (
int
) – The GBD roundlocation_set_version_id (
Optional
[int
]) – The location set version to use (right now EpiViz-AT is passing dismod location set versions, but this will eventually switch to the cause of death hierarchy that is more extensive).
Location Hierarchy¶
-
class
cascade_at.inputs.locations.
LocationDAG
(location_set_version_id=None, gbd_round_id=None, df=None, root=None)[source]¶ Bases:
object
Create a location DAG from the GBD location hierarchy, using networkx graph where each node is the location ID, and its properties are all properties from db_queries.
The root of this dag is the global location ID.
- Parameters
location_set_version_id (
Optional
[int
]) – The location set version corresponding to the hierarchy to pull from the IHME databasesgbd_round_id (
Optional
[int
]) – Which gbd round the location set version is coming fromdf (
Optional
[DataFrame
]) – An optional df to pass instead of location sets and gbd rounds if you’d rather construct the DAG from a pandas data frame.
-
descendants
(location_id)[source]¶ Gets all descendants (not just direct children) for a location ID. :type location_id:
int
:param location_id: (int) :rtype:List
[int
] :return: