Skip to content

Commit

Permalink
Allow only plotting specified graph types
Browse files Browse the repository at this point in the history
Some graphs can be slow to plot and are not necessary for all users.
  • Loading branch information
karlb committed Sep 24, 2021
1 parent 731bdac commit 743d2bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions causing/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ def create_graphs(
show_nr_indiv,
final_var_in_percent=False,
ids: Optional[Sequence[str]] = None,
graph_types=("ADE", "AME", "ATE", "IDE", "IME", "ITE"),
):
"""creates direct, total and mediation graph,
for theoretical model and estimated model"""

def make_graph(filename, x_weights_idmat_nodeff, y_weights_idmat_nodeff, **kwargs):
if filename[:3] not in graph_types:
return

print(filename)
xnodes = [str(var) for var in m.xvars]
ynodes = [str(var) for var in m.yvars]
Expand Down

0 comments on commit 743d2bc

Please sign in to comment.