aerosandbox.tools.pretty_plots.labellines.utils =============================================== .. py:module:: aerosandbox.tools.pretty_plots.labellines.utils Classes ------- .. autoapisummary:: aerosandbox.tools.pretty_plots.labellines.utils.GFG Functions --------- .. autoapisummary:: aerosandbox.tools.pretty_plots.labellines.utils.ensure_float aerosandbox.tools.pretty_plots.labellines.utils.maximum_bipartite_matching aerosandbox.tools.pretty_plots.labellines.utils.always_iterable Module Contents --------------- .. py:function:: ensure_float(value) Make sure datetime values are properly converted to floats. .. py:class:: GFG(graph) .. py:attribute:: graph .. py:attribute:: ppl .. py:attribute:: jobs .. py:method:: bpm(u, matchR, seen) .. py:method:: maxBPM() .. py:function:: maximum_bipartite_matching(graph) Finds the maximum bipartite matching of a graph :param graph: The graph, represented as a boolean matrix :type graph: np.ndarray :returns: **order** -- The order in which to traverse the graph to visit a maximum of nodes :rtype: np.ndarray .. py:function:: always_iterable(obj, base_type=(str, bytes)) If *obj* is iterable, return an iterator over its items:: >>> obj = (1, 2, 3) >>> list(always_iterable(obj)) [1, 2, 3] If *obj* is not iterable, return a one-item iterable containing *obj*:: >>> obj = 1 >>> list(always_iterable(obj)) [1] If *obj* is ``None``, return an empty iterable: >>> obj = None >>> list(always_iterable(None)) [] By default, binary and text strings are not considered iterable:: >>> obj = 'foo' >>> list(always_iterable(obj)) ['foo'] If *base_type* is set, objects for which ``isinstance(obj, base_type)`` returns ``True`` won't be considered iterable. >>> obj = {'a': 1} >>> list(always_iterable(obj)) # Iterate over the dict's keys ['a'] >>> list(always_iterable(obj, base_type=dict)) # Treat dicts as a unit [{'a': 1}] Set *base_type* to ``None`` to avoid any special handling and treat objects Python considers iterable as iterable: >>> obj = 'foo' >>> list(always_iterable(obj, base_type=None)) ['f', 'o', 'o']