Skip to content

Commit

Permalink
Remove unused show_proc_parent option
Browse files Browse the repository at this point in the history
Closes #630
  • Loading branch information
ZedThree committed Feb 28, 2024
1 parent 2d5083a commit cf3fb81
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 27 deletions.
9 changes: 0 additions & 9 deletions docs/user_guide/project_file_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------

Expand Down
13 changes: 3 additions & 10 deletions ford/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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
Expand All @@ -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] = []
Expand All @@ -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"""
Expand Down
1 change: 0 additions & 1 deletion ford/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)

Expand Down
1 change: 0 additions & 1 deletion ford/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")])
Expand Down
8 changes: 2 additions & 6 deletions test/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cf3fb81

Please sign in to comment.