Skip to content

Commit

Permalink
Fixing latex_label Parameter within write_to_tex function (#1923)
Browse files Browse the repository at this point in the history
* Fixed Issue with latex_label parameter

* Edited Wording to Avoid Confusion

* Edited If Statements to Avoid Confusion and Allow Parameter to function Properly
  • Loading branch information
bartnikm authored Sep 12, 2022
1 parent 782365c commit dd838cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tardis/plasma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def write_to_dot(self, fname, args=None, latex_label=True):
print_graph = self.remove_hidden_properties(print_graph)

for node in print_graph:
if latex_label:
if latex_label == True:
if hasattr(self.plasma_properties_dict[node], "latex_formula"):
print_graph.nodes[str(node)][
"label"
Expand All @@ -316,13 +316,14 @@ def write_to_dot(self, fname, args=None, latex_label=True):

for edge in print_graph.edges:
label = print_graph.edges[edge]["label"]
print_graph.edges[edge]["label"] = "-"
print_graph.edges[edge]["texlbl"] = label
print_graph.edges[edge]["label"] = " "
if latex_label == True:
print_graph.edges[edge]["texlbl"] = label

nx.drawing.nx_agraph.write_dot(print_graph, fname)

for line in fileinput.FileInput(fname, inplace=1):
if latex_label:
if latex_label == True:
print(
line.replace(
r'node [label="\N"]',
Expand Down

0 comments on commit dd838cb

Please sign in to comment.