diff --git a/Overlap/plot_components.py b/Overlap/plot_components.py index 9b8c24e804b07ea14efddd083b37348cd49ee226..05f01276f7941665d306d4e8697f853f1c24195b 100755 --- a/Overlap/plot_components.py +++ b/Overlap/plot_components.py @@ -150,20 +150,20 @@ if __name__ == "__main__": plt.figure() - if args.window is not None: - if args.time: - print("Reading edge list and SHPC...") - t0 = time.perf_counter() + if args.time: + print("Reading edge list and SHPC...") + t0 = time.perf_counter() - G = report_graph.read_eddy_graph(args.edgelist, args.shpc_dir, - args.orientation) + G = report_graph.read_eddy_graph(args.edgelist, args.shpc_dir, + args.orientation) - if args.time: - t1 = time.perf_counter() - print("Elapsed time:", t1 - t0, "s") - t0 = t1 - print("Finding components...") + if args.time: + t1 = time.perf_counter() + print("Elapsed time:", t1 - t0, "s") + t0 = t1 + print("Finding components...") + if args.window is not None: for n, d in G.nodes.items(): if util_eddies.in_window(d["coordinates"], args.window): if "component" not in d: report_graph.add_component(G, n) @@ -178,19 +178,6 @@ if __name__ == "__main__": ax = plt.axes(projection = dest_crs) plot_all_components(G, label) elif args.node is not None: - if args.time: - print("Reading edge list and SHPC...") - t0 = time.perf_counter() - - G = report_graph.read_eddy_graph(args.edgelist, args.shpc_dir, - args.orientation) - - if args.time: - t1 = time.perf_counter() - print("Elapsed time:", t1 - t0, "s") - t0 = t1 - print("Finding components...") - report_graph.add_component(G, args.node) if args.time: @@ -202,19 +189,6 @@ if __name__ == "__main__": ax = plt.axes(projection = dest_crs) plot_nbunch(G, G.nodes[args.node]["component"], label = label) else: - if args.time: - print("Reading edge list and SHPC...") - t0 = time.perf_counter() - - G = report_graph.read_eddy_graph(args.edgelist, args.shpc_dir, - args.orientation) - - if args.time: - t1 = time.perf_counter() - print("Elapsed time:", t1 - t0, "s") - t0 = t1 - print("Finding components...") - assign_all_components(G) if args.time: