tlbox.apps.bazel_parser.refinement ================================== .. py:module:: tlbox.apps.bazel_parser.refinement Attributes ---------- .. autoapisummary:: tlbox.apps.bazel_parser.refinement.logger Classes ------- .. autoapisummary:: tlbox.apps.bazel_parser.refinement.Verbosity tlbox.apps.bazel_parser.refinement.RefinementConfig Functions --------- .. autoapisummary:: tlbox.apps.bazel_parser.refinement.refine_dataframe tlbox.apps.bazel_parser.refinement.remove_node_from_repo tlbox.apps.bazel_parser.refinement.full_refinement Module Contents --------------- .. py:data:: logger .. py:class:: Verbosity(*args, **kwds) Bases: :py:obj:`enum.Enum` Create a collection of name/value pairs. Example enumeration: >>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3 Access them by: - attribute access:: >>> Color.RED - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. py:attribute:: SILENT :value: 'SILENT' .. py:attribute:: COUNT :value: 'COUNT' .. py:attribute:: LIST :value: 'LIST' .. py:class:: RefinementConfig This specifies how to refine a dataframe of nodes to a smaller set. We expect node_name to be the index of the dataframe. All of these fields are exclusionary. .. py:attribute:: name_patterns :type: list[str] .. py:attribute:: class_patterns :type: list[str] .. py:attribute:: class_pattern_to_name_patterns :type: dict[str, list[str]] .. py:function:: refine_dataframe(df: pandas.DataFrame, refinement: RefinementConfig, verbosity: Verbosity) -> pandas.DataFrame .. py:function:: remove_node_from_repo(node: str, repo: tlbox.apps.bazel_parser.repo_graph_data.RepoGraphData) -> None Modify graph by removing node, but preserving edges. Removed nodes are expected to be noise/artifact targets (probability=1.0, duration=0), so dropping their attributes is correct. Callers should call repo.refresh() afterward to recompute all metrics on the reduced graph. .. py:function:: full_refinement(repo: tlbox.apps.bazel_parser.repo_graph_data.RepoGraphData, refinement: RefinementConfig, verbosity: Verbosity) -> pandas.DataFrame