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

Polish

parent c6d6d8af
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3 #!/usr/bin/env python3
# A script that takes a segmented graph in the gt format and performs the """A script that takes a segmented graph in the gt format and performs
# non-local cost function calculation where each edge will have a cost the non-local cost function calculation where each edge will have a
# function assigned to it. cost function assigned to it.
# Inputs (to be changed within the script):
# node_id_param_file Input:
# gt graph
# shapefiles - "node_id_param.json", expected to be in the current directory
# Output: a gt graph with cost functions and an xml graph with cost functions
- the graph of segments, "segments.gt" or "segments.graphml", expected
to be in the current directory
- shapefiles, specified as command line arguments
Output: the graph of segments with cost functions,
'segments_cost_functions.gt'
"""
import graph_tool import graph_tool
import time import time
...@@ -297,15 +306,5 @@ for edge in g.edges(): ...@@ -297,15 +306,5 @@ for edge in g.edges():
g.ep.nl_cost_function[edge] = cf g.ep.nl_cost_function[edge] = cf
################################
# Writing to an GT Graph File #
################################
#g.save("segments_cyclo_gl_cf.xml")
#print("Done writing xml.")
print("Done writing gt.")
#g.save('segmented_cf.gv', fmt = "dot")
#print("Done writing dot file.")
g.save('segments_cost_functions.gt') g.save('segments_cost_functions.gt')
print('All done') print('All done')
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Collapses the input graph into a new graph: the graph of """Collapses the input graph of instantaneous eddies into a new graph:
segments. A vertex of the new graph is a segment. The new graph is the graph of segments. A vertex of the new graph is a segment. The new
output in the binary format of graph-tool. Input file should be an graph is output in the binary format of Graph-tool. Input file should
edgelist in CSV format. Output file can have suffix ".gt" or be an edgelist in CSV format. Output file can have suffix ".gt" or
".graphml". ".graphml".
""" """
......
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