Module: safe.impact_functions.utilities

Module to create damage curves from point data and additional logging utils relevant to impact_functions.

class safe.impact_functions.utilities.Damage_curve(data)[source]

Class for implementation of damage curves based on point data

safe.impact_functions.utilities.admissible_plugins_to_str(plugin_list)[source]

A helper to write the admissible plugin list to a string.

Intended for use with the LOGGER so that admissible plugins can be pretty printed to the logs.

Args: plugin_list str (required). A list of plugins

Returns: A string representing the plugin list with nice formatting.

Raises: None

safe.impact_functions.utilities.keywords_to_str(keywords)[source]

Pretty print keywords dict or list of dicts to a string.

Intended for use with the LOGGER so that keywords can be pretty printed to the logs.

Args: keywords dict or list (required). A list or dict of keywords.

Returns: A string representing the keyword list with nice formatting.

Raises: None

safe.impact_functions.utilities.pretty_string(myArg)[source]

A helper function that return a pretty string according to the args Args:

  • myArs = string or list
Returns:
  • if myArgs is string return myArgs

    if myArgs is list return each element as string separated by ‘,’

safe.impact_functions.utilities.remove_double_spaces(myStr)[source]

Remove double spaces from a string. Return the string without any dobule spaces

This module forms part of the InaSAFE tool.

Previous topic

Module: safe.impact_functions.core

Next topic

Module: safe.impact_functions.test_plugin_core

This Page