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

Polish

parent ad73a9ec
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ import bisect
def calculate_radii_and_rossby(start, end, inc, segment, e_overestim, handlers,
array_d_init):
radii = 0 #[m]
radii = 0 # in m
rossby = 0
days_modifier = 0
......@@ -112,7 +112,7 @@ print("Number of edges:", g.num_edges())
print("Internal properties:")
g.list_properties()
t1 = time.perf_counter()
timings.write(f"loading: {t1 - t0} s\n")
timings.write(f"loading: {t1 - t0:.0f} s\n")
t0 = t1
g.vp['pos_first'] = g.new_vp('object')
......@@ -226,7 +226,7 @@ for n in g.vertices():
g.vp.last_av_rad[n] = radii
t1 = time.perf_counter()
timings.write(f"iterating on vertices: {t1 - t0} s\n")
timings.write(f"iterating on vertices: {t1 - t0:.0f} s\n")
t0 = t1
print("Iterating on edges...")
......@@ -285,11 +285,11 @@ for edge in g.edges():
g.ep.cost_function[edge] = cf
t1 = time.perf_counter()
timings.write(f"iterating on edges: {t1 - t0} s\n")
timings.write(f"iterating on edges: {t1 - t0:.0f} s\n")
t0 = t1
print("Saving...")
g.save('segments_cost_functions.gt')
print('All done')
t1 = time.perf_counter()
timings.write(f"saving: {t1 - t0} s\n")
timings.write(f"saving: {t1 - t0:.0f} s\n")
timings.close()
......@@ -13,10 +13,6 @@ import time
import sys
import pathlib
##########################
# load the edgelist file #
##########################
if len(sys.argv) != 3: sys.exit("Required arguments: input-file output-file")
if pathlib.Path(sys.argv[2]).suffix not in {".gt", ".graphml"}:
......@@ -37,9 +33,7 @@ t1 = time.perf_counter()
print(f'Loading done in {t1 - t0:.0f} s')
t0 = t1
##############
# Processing #
##############
# Processing:
g.vp['segment'] = g.new_vp('object') # this object will be a list
print('Collapsing into segments...')
......
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