safe.postprocessors.postprocessor_factory module

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.check_postprocessor_enabled(parameters)[source]

Returns true if postprocessor is enabled by users

Parameters:parameters – postprocessor parameters
Returns:
safe.postprocessors.postprocessor_factory.get_postprocessor_human_name(postprocessor)[source]

Returns the human readable name of post processor

Parameters:postprocessor – Machine name of the postprocessor
Returns:The human readable name
Return type:str
safe.postprocessors.postprocessor_factory.get_postprocessors(requested_postprocessors)[source]

Creates a dictionary of applicable postprocessor instances

Parameters:requested_postprocessors (dict e.g. name:[list_elements]) –

The postprocessors to return e.g.

{
'Gender': [BooleanParameter],
'Age': [BooleanParameter, FloatParameter ....]
}

with ‘PostprocessorName’: [BooleanParameter] 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}
Return type:dict