Module: safe.postprocessors.postprocessor_factory

Postprocessors package.

Tip

import like this from safe.postprocessors import get_post_processors and then call get_post_processors(requested_postprocessors)

safe.postprocessors.postprocessor_factory.get_post_processors(requested_postprocessors)[source]

Creates a dictionary of applicable postprocessor instances

Args:
  • requested_postprocessors: dictionary of requested

    postprocessors such as { ‘Gender’: {‘on’: True}, ‘Age’: {‘on’: True,

    ‘params’: {

    ‘youth_ratio’: defaults[‘YOUTH_RATIO’], ‘adult_ratio’: defaults[‘ADULT_RATIO’], ‘elder_ratio’: defaults[‘ELDER_RATIO’] }

    }

    } with ‘PostprocessorName’: {‘on’: True} being the minimum needed to activate a postprocessor. If asked for unimplemented postprocessors, the factory will just skip it returning the valid ones

Returns:
dict of postprocessors instances e.g.
{‘Gender’:GenderPostprocessors instance}

This module forms part of the InaSAFE tool.

Previous topic

Module: safe.postprocessors.gender_postprocessor

Next topic

Module: safe.postprocessors.age_postprocessor

This Page