Skip to content

Commit

Permalink
Merge pull request #84 from myxie/networkx-version-update
Browse files Browse the repository at this point in the history
REF: #83
  • Loading branch information
awicenec committed Nov 26, 2021
2 parents 70a1d13 + 6630256 commit baea9b8
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 481 deletions.
4 changes: 2 additions & 2 deletions daliuge-translator/dlg/dropmake/dm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ def convert_construct(lgo):
app_node["key"] = node["key"]
app_node["category"] = node[has_app] # node['application']
if has_app[0] == "i":
app_node["text"] = node["inputApplicationName"]
app_node["text"] = node["text"]
else:
app_node["text"] = node["outputApplicationName"]
app_node["text"] = node["text"]

if "mkn" in node:
app_node["mkn"] = node["mkn"]
Expand Down
14 changes: 7 additions & 7 deletions daliuge-translator/dlg/dropmake/pg_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def pred_exec_time(self, app_drop_only=False, wk="weight", force_answer=False):
return None
if app_drop_only:
lp = DAGUtil.get_longest_path(G, show_path=True)[0]
return sum(G.node[u].get(wk, 0) for u in lp)
return sum(G.nodes[u].get(wk, 0) for u in lp)
else:
return DAGUtil.get_longest_path(G, show_path=False)[1]

Expand Down Expand Up @@ -1129,9 +1129,9 @@ def to_gojs_json(self, string_rep=True, outdict=None, visual=False):
link = dict()
link["from"] = myk
from_dt = 0 if drop["type"] == DropType.PLAIN else 1
to_dt = G.node[oup]["dt"]
to_dt = G.nodes[oup]["dt"]
if from_dt == to_dt:
to_drop = G.node[oup]["drop_spec"]
to_drop = G.nodes[oup]["drop_spec"]
if from_dt == 0:
# add an extra app DROP
extra_oid = "{0}_TransApp_{1}".format(oid, i)
Expand Down Expand Up @@ -1177,7 +1177,7 @@ def to_gojs_json(self, string_rep=True, outdict=None, visual=False):
# global graph updates
# the new drop must have the same gid as the to_drop
add_nodes.append(
(lid, 1, mydt, dropSpec, G.node[oup].get("gid", None))
(lid, 1, mydt, dropSpec, G.nodes[oup].get("gid", None))
)
remove_edges.append((myk, oup))
add_edges.append((myk, lid))
Expand Down Expand Up @@ -1491,8 +1491,8 @@ def merge_partitions(
GG = self._G
part_edges = defaultdict(int) # k: from_gid + to_gid, v: sum_of_weight
for e in GG.edges(data=True):
from_gid = GG.node[e[0]]["gid"]
to_gid = GG.node[e[1]]["gid"]
from_gid = GG.nodes[e[0]]["gid"]
to_gid = GG.nodes[e[1]]["gid"]
k = "{0}**{1}".format(from_gid, to_gid)
part_edges[k] += e[2]["weight"]

Expand Down Expand Up @@ -1767,7 +1767,7 @@ def to_gojs_json(self, string_rep=True, outdict=None, visual=False):

node_list = jsobj["nodeDataArray"]
for node in node_list:
gid = G.node[node["key"]]["gid"] # gojs group_id
gid = G.nodes[node["key"]]["gid"] # gojs group_id
if gid is None:
raise GPGTException(
"Node {0} does not have a Partition".format(node["key"])
Expand Down
Loading

0 comments on commit baea9b8

Please sign in to comment.