Skip to content
Snippets Groups Projects
Commit 097247cc authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent a537f56b
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,6 @@ def date_eddy_to_node(d, eddy_index, e_overestim, d_init):
return (d- d_init) * e_overestim + eddy_index
def read_eddy_graph(edgelist, shpc_dir = None):
"""shpc_dir is for visible eddies."""
if os.access(edgelist, os.R_OK):
G = nx.read_edgelist(edgelist, create_using = nx.DiGraph,
nodetype = int, data = [("weight", float)])
......@@ -42,7 +40,7 @@ def read_eddy_graph(edgelist, shpc_dir = None):
G.graph["d_init"] = node_id_param["d_init"]
if shpc_dir is not None:
# Read and set attributes of Visible eddies:
# Read and set attributes of eddies:
extr_file = path.join(shpc_dir, "extremum")
set_attribute(G, extr_file)
else:
......@@ -59,8 +57,7 @@ def set_attribute(G, extr_file):
G.graph["e_overestim"], G.graph["d_init"])
if shape_rec.record.valid == 1 and n in G:
G.add_node(n,
coordinates = tuple(shape_rec.shape.points[0]),
G.add_node(n, coordinates = tuple(shape_rec.shape.points[0]),
speed = shape_rec.record.speed,
ssh = shape_rec.record.ssh)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment