From cf3fb8198f55c9dcc9c2f921a7730f1ea4e97365 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 28 Feb 2024 09:55:56 +0000 Subject: [PATCH] Remove unused `show_proc_parent` option Closes #630 --- docs/user_guide/project_file_options.rst | 9 --------- ford/graphs.py | 13 +++---------- ford/output.py | 1 - ford/settings.py | 1 - test/test_graphs.py | 8 ++------ 5 files changed, 5 insertions(+), 27 deletions(-) diff --git a/docs/user_guide/project_file_options.rst b/docs/user_guide/project_file_options.rst index 2150f933..5b94cb5d 100644 --- a/docs/user_guide/project_file_options.rst +++ b/docs/user_guide/project_file_options.rst @@ -1098,15 +1098,6 @@ maximum or, if the even a depth of one would result in more nodes than the maximum, it will be restructured to give a clearer visualisation. (*default:* 100000000) -.. _option-show_proc_parent: - -show_proc_parent -^^^^^^^^^^^^^^^^ - -If ``true`` then the parent module of a procedure will be displayed in -the graphs as follows: parent::procedure. -(*default:* ``false``) - Output ------ diff --git a/ford/graphs.py b/ford/graphs.py index 4e538e85..44565b0c 100644 --- a/ford/graphs.py +++ b/ford/graphs.py @@ -135,12 +135,10 @@ class GraphData: Path to top of site coloured_edges: If true, arrows between nodes are coloured, otherwise they are black - show_proc_parent: - If true, the parent of a procedure is shown in the node label """ - def __init__(self, parent_dir: str, coloured_edges: bool, show_proc_parent: bool): + def __init__(self, parent_dir: str, coloured_edges: bool): self.submodules: NodeCollection = {} self.modules: NodeCollection = {} self.types: NodeCollection = {} @@ -150,7 +148,6 @@ def __init__(self, parent_dir: str, coloured_edges: bool, show_proc_parent: bool self.blockdata: NodeCollection = {} self.parent_dir = parent_dir self.coloured_edges = coloured_edges - self.show_proc_parent = show_proc_parent def _get_collection_and_node_type( self, obj: FortranEntity @@ -630,7 +627,7 @@ def _dashed_edge( if graphviz_installed: # Create the legends for the graphs. These are their own separate graphs, # without edges - gd = GraphData("", False, False) + gd = GraphData(parent_dir="", coloured_edges=False) # Graph nodes for a bunch of fake entities that we'll use in the legend _module = gd.get_node(ExternalModule("Module")) @@ -1325,9 +1322,6 @@ class GraphManager: coloured_edges: If true, arrows in graphs use different colours to help distinguish them - show_proc_parent: - If true, show the parent of a procedure in the call graph - as part of the label save_graphs: If true, save graphs as separate files, as well as embedding them in the HTML @@ -1338,7 +1332,6 @@ def __init__( graphdir: os.PathLike, parentdir: str, coloured_edges: bool, - show_proc_parent: bool, save_graphs: bool = False, ): self.graph_objs: List[FortranContainer] = [] @@ -1356,7 +1349,7 @@ def __init__( self.typegraph = None self.callgraph = None self.filegraph = None - self.data = GraphData(parentdir, coloured_edges, show_proc_parent) + self.data = GraphData(parentdir, coloured_edges) def register(self, obj: FortranContainer): """Register ``obj`` as a node to be used in graphs""" diff --git a/ford/output.py b/ford/output.py index 3f097a43..2e4d185b 100644 --- a/ford/output.py +++ b/ford/output.py @@ -201,7 +201,6 @@ def __init__(self, settings: ProjectSettings, proj_docs: str, project, pagetree) self.data.get("graph_dir", ""), graphparent, settings.coloured_edges, - settings.show_proc_parent, save_graphs=bool(self.data.get("graph_dir", False)), ) diff --git a/ford/settings.py b/ford/settings.py index 223c7aae..d0008337 100644 --- a/ford/settings.py +++ b/ford/settings.py @@ -194,7 +194,6 @@ class ProjectSettings: relative: bool = field(init=False) revision: Optional[str] = None search: bool = True - show_proc_parent: bool = False sort: str = "src" source: bool = False src_dir: List[Path] = field(default_factory=lambda: [Path("./src")]) diff --git a/test/test_graphs.py b/test/test_graphs.py index 886338ff..a5413e70 100644 --- a/test/test_graphs.py +++ b/test/test_graphs.py @@ -161,9 +161,7 @@ def make_project_graphs(tmp_path_factory, request): ) project = create_project(settings) - graphs = GraphManager( - graphdir="", parentdir="..", coloured_edges=True, show_proc_parent=True - ) + graphs = GraphManager(graphdir="", parentdir="..", coloured_edges=True) for entity_list in [ project.types, project.procedures, @@ -520,9 +518,7 @@ def test_graphs_as_table(tmp_path): settings = ProjectSettings(src_dir=src_dir, graph=True, graph_maxnodes=4) project = create_project((settings)) - graphs = GraphManager( - graphdir="", parentdir="..", coloured_edges=True, show_proc_parent=True - ) + graphs = GraphManager(graphdir="", parentdir="..", coloured_edges=True) for entity_list in [ project.procedures, project.programs,