atomica.cascade.sanitize_pops

atomica.cascade.sanitize_pops(pops, pop_source, pop_type)[source]

Sanitize input populations

The input populations could be specified as

  • A list or dict (with single key) containing either population code names. List inputs can contain full names (e.g. from the FE)

  • A string like ‘all’ or ‘total’

  • None, which is shorthand for all populations

For cascade purposes, the specified populations must evaluate to a single aggregation. That is, a cascade plot can only be made for a single group of people at a time.

Parameters
  • pops – The population representation to sanitize (list, dict, string)

  • pop_source – Object to draw available populations from (a Result or PlotData)

  • pop_type – Population type to select. All returned populations will match this type

Return type

dict

Returns

A dict with a single key that can be used by PlotData to specify populations