From a9c20e6bf172cd291d2c2f620ec84cca07d4c4e8 Mon Sep 17 00:00:00 2001 From: Barrows Date: Wed, 24 May 2023 21:08:43 -0600 Subject: [PATCH] whitespace --- scripts/formatter/formatter_code.jl | 25 +++++++++++++------------ src/plot_network.jl | 17 +++++++++++------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/scripts/formatter/formatter_code.jl b/scripts/formatter/formatter_code.jl index 080b7f2..ff1449f 100644 --- a/scripts/formatter/formatter_code.jl +++ b/scripts/formatter/formatter_code.jl @@ -9,19 +9,20 @@ main_paths = ["./src", "./test"] for main_path in main_paths for (root, dir, files) in walkdir(main_path) for f in files - @show file_path = abspath(root, f) - !occursin(".jl", f) && continue - format(file_path; - whitespace_ops_in_indices = true, - remove_extra_newlines = true, - verbose = true, - always_for_in = true, - whitespace_typedefs = true, - conditional_to_if = true, - join_lines_based_on_source = true, - separate_kwargs_with_semicolon = true, + @show file_path = abspath(root, f) + !occursin(".jl", f) && continue + format( + file_path; + whitespace_ops_in_indices = true, + remove_extra_newlines = true, + verbose = true, + always_for_in = true, + whitespace_typedefs = true, + conditional_to_if = true, + join_lines_based_on_source = true, + separate_kwargs_with_semicolon = true, - # always_use_return = true. # Disabled since it throws a lot of false positives + # always_use_return = true. # Disabled since it throws a lot of false positives ) end end diff --git a/src/plot_network.jl b/src/plot_network.jl index 0a825bc..0cbe91e 100644 --- a/src/plot_network.jl +++ b/src/plot_network.jl @@ -136,14 +136,18 @@ function make_graph(sys::PowerSystems.System; kwargs...) return g end - - function plot_lines!(p, sys, line_width) components = collect(get_components(Branch, sys)) fr_lat_lon = get_ext.(get_from.(get_arc.(components))) to_lat_lon = get_ext.(get_to.(get_arc.(components))) - fr_xy = [PSM.lonlat_to_webmercator((PSM.get_longitude(p), PSM.get_latitude(p))) for p in fr_lat_lon] - to_xy = [PSM.lonlat_to_webmercator((PSM.get_longitude(p), PSM.get_latitude(p))) for p in to_lat_lon] + fr_xy = [ + PSM.lonlat_to_webmercator((PSM.get_longitude(p), PSM.get_latitude(p))) for + p in fr_lat_lon + ] + to_xy = [ + PSM.lonlat_to_webmercator((PSM.get_longitude(p), PSM.get_latitude(p))) for + p in to_lat_lon + ] xy = [] groups = [] @@ -159,11 +163,12 @@ function plot_lines!(p, sys, line_width) p = plot!( p, - xy[:,1], xy[:,2]; + xy[:, 1], + xy[:, 2]; linewidth = line_width, hover = labels, group = groups, - legend = true + legend = true, ) return p end