af.controller.hierarchies package

Submodules

af.controller.hierarchies.BaseHierarchyController module

class af.controller.hierarchies.BaseHierarchyController.BaseHierarchyController(hierarchy=None)[source]

Bases: object

Class that is intended to be used for the load and save of BaseHierarchy instances

create_automatic_dimension_hierarchy(automatic_dimension_name, automatic_dimension_args, list_of_values, attribute_type=<type 'str'>)[source]

Given the automatic dimension name, his arguments, the attribute type and the list of values create the suppression hierarchy.

Parameters:
  • automatic_dimension_name – Automatic dimension name used to build the hierarchy
  • automatic_dimension_args – List of particular arguments the automtic dimension needs
  • list_of_values – List containing all the values of the hierarchies, per rows
  • attribute_type – Attribute type (int ,str or date)
Return type:

BaseHierarchy instance

static create_hierarchy_from_list_of_values(list_of_values)[source]

Given a list of lists, containing the information about a hierarchy, create the hierarchy, and return it

Parameters:list_of_values – List containing all the values of the hierarchies, per rows
Return type:BaseHierarchy instance
static create_suppression_hierarchy()[source]

Create a suppression hierarchy and return it

Return type:BaseHierarchy instance
get_hierarchy_representation()[source]

Returns the representation of the hierarchy (If it exists)

Return type:dict
load_hierarchy(config, attribute_type='string')[source]

Given a configuration, it loads the hierarchy that was saved.

Parameters:
  • config – Configuration in the form of a dictionary that associates values with its parent level values. If its a string, then it is assumed that the hierarchy was a suprression hierarchy.
  • attribute_type (string) – The specific type of the attribute.

Module contents