Esempio n. 1
0
 def remove_edges_under_consolidation(self, dimension_name: str,
                                      hierarchy_name: str,
                                      consolidation_element: str,
                                      **kwargs) -> List[Response]:
     """
     :param dimension_name: Name of the dimension
     :param hierarchy_name: Name of the hierarchy
     :param consolidation_element: Name of the Consolidated element
     :return: response
     """
     hierarchy = self.get(dimension_name, hierarchy_name)
     from TM1py.Services import ElementService
     element_service = ElementService(self._rest)
     elements_under_consolidations = element_service.get_members_under_consolidation(
         dimension_name, hierarchy_name, consolidation_element)
     elements_under_consolidations.append(consolidation_element)
     remove_edges = []
     for (parent, component) in hierarchy.edges:
         if parent in elements_under_consolidations and component in elements_under_consolidations:
             remove_edges.append((parent, component))
     hierarchy.remove_edges(remove_edges)
     return self.update(hierarchy, **kwargs)
Esempio n. 2
0
 def __init__(self, rest):
     super().__init__(rest)
     self.subsets = SubsetService(rest)
     self.elements = ElementService(rest)
Esempio n. 3
0
 def __init__(self, rest):
     super(HierarchyService, self).__init__(rest)
     self.subsets = SubsetService(rest)
     self.elements = ElementService(rest)