Skip to content
Snippets Groups Projects
Commit f70cee3c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'fix_nans_in_plot_task_dependencies' into 'master'

fix NaNs in plot_task_dependencies.py

See merge request !1726
parents a9b9a68d fb8cf47f
No related branches found
No related tags found
2 merge requests!1730Master,!1726fix NaNs in plot_task_dependencies.py
...@@ -375,14 +375,14 @@ def write_task( ...@@ -375,14 +375,14 @@ def write_task(
task_is_in_hydro_super: bool task_is_in_hydro_super: bool
whether task is in hydro super cell whether task is in hydro super cell
task_is_in_grav_super: bool task_is_in_grav_super: bool
whether task is in grav super cell whether task is in grav super cell
cell_has_active_task: bool cell_has_active_task: bool
if True, the specific cell you are trying to plot if True, the specific cell you are trying to plot
the graph for has an active task of this type. the graph for has an active task of this type.
Otherwise it only unlocks a dependency of some Otherwise it only unlocks a dependency of some
other cell other cell
with_calls: bool with_calls: bool
...@@ -593,6 +593,7 @@ def write_clusters(f, data): ...@@ -593,6 +593,7 @@ def write_clusters(f, data):
f.write("\t # Clusters\n") f.write("\t # Clusters\n")
# get list of all the clusters # get list of all the clusters
clusters = data[["cluster_in", "cluster_out"]] clusters = data[["cluster_in", "cluster_out"]]
clusters = clusters.replace({np.nan: "None"})
clusters = np.unique(clusters) clusters = np.unique(clusters)
cluster_in = data["cluster_in"] cluster_in = data["cluster_in"]
...@@ -632,10 +633,9 @@ def write_dependencies(f, data): ...@@ -632,10 +633,9 @@ def write_dependencies(f, data):
""" """
f.write("\t # Dependencies\n") f.write("\t # Dependencies\n")
N = len(data)
written = [] written = []
max_rank = data["number_rank"].max() max_rank = data["number_rank"].max()
# for i in range(N):
for i, l in data.iterrows(): for i, l in data.iterrows():
# get data # get data
ta = l["task_in"] ta = l["task_in"]
...@@ -657,11 +657,11 @@ def write_dependencies(f, data): ...@@ -657,11 +657,11 @@ def write_dependencies(f, data):
written.append(name) written.append(name)
# write relation # write relation
arrow = ",color=%s" % l["task_colour"] arrow = "color=%s" % l["task_colour"]
if l["number_rank"] != max_rank: if l["number_rank"] != max_rank:
arrow += ",style=dashed" arrow += ",style=dashed"
f.write( f.write(
"\t %s->%s[label=%i%s,fontcolor=%s]\n" "\t %s->%s[label=%i,%s,fontcolor=%s]\n"
% (ta, tb, number_link, arrow, l["task_colour"]) % (ta, tb, number_link, arrow, l["task_colour"])
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment