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

Invert blocks in the `if` construct

For clarity. Possible since commit 7d6308f6.
parent 6dfdee49
No related branches found
No related tags found
No related merge requests found
......@@ -214,30 +214,30 @@ if __name__ == "__main__":
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:
extract_component_nx.add_component(G, n)
if args.window is None:
assign_all_components(G)
if args.time:
t1 = time.perf_counter()
print("Elapsed time:", t1 - t0, "s")
t0 = t1
print("Plotting...")
dest_crs = ccrs.PlateCarree((args.window[0] + args.window[2]) / 2)
ax = plt.axes(projection=dest_crs)
ax = plt.axes(projection=ccrs.PlateCarree())
plot_all_components(G, label)
else:
assign_all_components(G)
for n, d in G.nodes.items():
if util_eddies.in_window(d["coordinates"], args.window):
if "component" not in d:
extract_component_nx.add_component(G, n)
if args.time:
t1 = time.perf_counter()
print("Elapsed time:", t1 - t0, "s")
t0 = t1
print("Plotting...")
ax = plt.axes(projection=ccrs.PlateCarree())
dest_crs = ccrs.PlateCarree((args.window[0] + args.window[2]) / 2)
ax = plt.axes(projection=dest_crs)
plot_all_components(G, label)
ax.coastlines()
......
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