Cascade Job Graphs

cascade_at.cascade.cascade_dags.branch_or_leaf(dag, location_id, sex, model_version_id, parent_location, parent_sex, n_sim, n_pool, upstream, tasks)[source]

Recursive function that either creates a branch (by calling itself) or a leaf fit depending on whether or not it is at a terminal node. Determines if it’s at a terminal node using the dag.successors() method from networkx. Appends tasks onto the tasks parameter.

cascade_at.cascade.cascade_dags.make_cascade_dag(model_version_id, dag, location_start, sex_start, split_sex, n_sim=100, n_pool=100, skip_configure=False)[source]

Make a traditional cascade dag for a model version. Relies on a location DAG and a starting point in the DAG for locations and sexes.

Parameters
  • model_version_id (int) – Model version ID

  • dag (LocationDAG) – A location DAG that specifies the location hierarchy

  • location_start (int) – Where to start in the location hierarchy

  • sex_start (int) – Which sex to start with, can be most detailed or both.

  • split_sex (bool) – Whether or not to split sex into most detailed. If not, then will just stay at ‘both’ sex.

  • n_sim (int) – Number of simulations to do in sample simulate

  • n_pool (int) – Number of multiprocessing pools to create during sample simulate

  • skip_configure (bool) – Don’t configure inputs. Only do this if it’s already been done.

Returns

Return type

List of _CascadeOperation.