tdads.diagram_utils =================== .. py:module:: tdads.diagram_utils Functions --------- .. autoapisummary:: tdads.diagram_utils.check_diagram tdads.diagram_utils.preprocess_diagram tdads.diagram_utils.preprocess_diagram_groups_for_inference Module Contents --------------- .. py:function:: check_diagram(D) Checks for persistence diagrams. Internal method to verify that birth values are non-negative and less than death values. :param `D`: The input diagram to be checked. :type `D`: numpy.ndarray :rtype: None .. py:function:: preprocess_diagram(D, inf_replace_val=None, ret=False) Verify the format of a persistence diagram and convert to a standard format. This function can verify a persistence diagram from the ripser, gph, flagser, gudhi or cechmate packages and convert any such diagram into a list of numpy arrays if desired (largely an internal functionality but can be used in a standalone fashion). :param `D`: The persistence diagram to be verified. An exception will be raised if `D` is not a persistence diagram computed from one of the aforementioned packages. :type `D`: any :param `inf_replace_val`: The value with which `inf` values should be replaced, if desired. :type `inf_replace_val`: float or int, default `None` :param `ret`: Whether or not to return a processed diagram. :type `ret`: bool, default `False` :returns: If `ret` is `True` and the diagram is verified then a list is returned. The i-th element of the returned list is the array of i-dimensional topological features in the diagram. :rtype: None or list of numpy.ndarray .. py:function:: preprocess_diagram_groups_for_inference(diagram_groups) Additional internal preprocessing for permutation tests. :param `diagram_groups`: Contains the persistence diagrams for the permutation test. :type `diagram_groups`: list of lists :returns: Each element in the first list contains the diagram (key 'diagram') and its index in the total list (key 'ind'). The second list contains the cumulative sum of group sizes, starting with 0. :rtype: List of dicts and list of int