Skip to content

Commit 2a907a5

Browse files
authored
Second batch of changes after JETLS advices (and a bug fix) (#1968)
1 parent 72a229c commit 2a907a5

22 files changed

Lines changed: 61 additions & 57 deletions

ci/config-gmt-unix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set (DCW_ROOT "$ENV{COASTLINEDIR}/dcw")
1111
1212
set (GMT_USE_THREADS TRUE)
1313
set (GMT_ENABLE_OPENMP TRUE)
14-
set (GMT_DATA_SERVER https://www.star.nesdis.noaa.gov/data/socd3/lsa/gmtdata/)
14+
set (GMT_DATA_SERVER china)
1515
1616
# recommended even for release build
1717
set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement ${CMAKE_C_FLAGS}")

src/GMT.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ using .Laszip
408408
grd2xyz(Glix)
409409
viz(Glix, show=false)
410410
viz(I, show=false)
411+
viz(rand(UInt8, 16, 16), show=false)
411412
histogram(randn(100), T=0.1, center=true, Z=:counts)
412413
histogram(I)
413414
grdlandmask(R="-10/4/37/45", res=:c, inc=0.1)

src/PrettyTables.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ function _text_fill_string_matrix!(
13881388
vcrop_mode::Symbol
13891389
)
13901390
num_rows, ~ = _size(ptable)
1391-
num_header_rows, ~ = _header_size(ptable)
1391+
num_header_rows, _ = _header_size(ptable)
13921392
num_rendered_rows, num_rendered_columns = size(table_str)
13931393

13941394
# This variable stores the predicted table width. If the user wants horizontal cropping,
@@ -1826,7 +1826,7 @@ end
18261826

18271827
# Compute the number of omitted columns.
18281828
function _compute_omitted_columns(ptable::ProcessedTable, display::Display, columns_width::Vector{Int}, vlines::Union{Symbol, Vector{Int}},)
1829-
~, num_columns = _size(ptable)
1829+
_, num_columns = _size(ptable)
18301830
num_additional_columns = _num_additional_columns(ptable)
18311831
num_rendered_columns = length(columns_width)
18321832

@@ -1871,7 +1871,7 @@ end
18711871
# Compute the number of omitted rows.
18721872
function _compute_omitted_rows(ptable::ProcessedTable, display::Display, continuation_row_line::Int, num_lines_in_row::Vector{Int},
18731873
body_hlines::Vector{Int}, hlines::Union{Symbol, Vector{Int}}, need_omitted_cell_summary::Bool, Δdisplay_lines::Int)
1874-
num_rows, ~ = _size(ptable)
1874+
num_rows, _ = _size(ptable)
18751875
num_header_rows = _header_size(ptable)[1]
18761876
num_rendered_rows = length(num_lines_in_row)
18771877

@@ -2491,7 +2491,8 @@ function _text_print_table!(display::Display, ptable::ProcessedTable, table_str:
24912491
_p!(display, " " * cell_processed_str * " ", false, actual_columns_width[j] + 2) && break
24922492
else
24932493
# If we have a custom cell, we need a custom printing function.
2494-
_print_custom_text_cell!(display, cell_data, cell_processed_str, l, highlighters) && break
2494+
#_print_custom_text_cell!(display, cell_data, cell_processed_str, l, highlighters) && break
2495+
@warn "CustomTextCell is not supported in the current version of Custom PrettyTables.jl."
24952496
end
24962497
end
24972498
end
@@ -2518,8 +2519,9 @@ end
25182519
# Print the custom rext cell to the display.
25192520
#
25202521
# NOTE: `cell_str` must contain the printable text cell always.
2522+
#=
25212523
function _print_custom_text_cell!(display::Display, cell_data::CustomTextCell, cell_processed_str::String,
2522-
l::Int, @nospecialize(highlighters::Ref{Any}),)
2524+
l::Int, @nospecialize(highlighters::Ref{Any}),)
25232525
cell_printable_textwidth = printable_textwidth(cell_processed_str)
25242526
25252527
# Print the padding character before the cell.
@@ -2544,6 +2546,7 @@ function _print_custom_text_cell!(display::Display, cell_data::CustomTextCell, c
25442546
# Print the padding character after the cell and return if the display has reached end-of-line.
25452547
return _p!(display, " ", false, 1)
25462548
end
2549+
=#
25472550

25482551
# Print the summary of the omitted rows and columns.
25492552
function _print_omitted_cell_summary(display::Display, num_omitted_cols::Int, num_omitted_rows::Int,

src/choropleth_utils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ usable in cpt2dcw() to create a colormap to use in `plot()` and make a country c
142142
"""
143143
function mk_codes_values(codes::Vector{<:AbstractString}, vals; region::StrSymb="world")
144144
isempty(codes) && error("The country codes 'codes' input argument is empty.")
145-
code_len = length(codes[1])
146145
(length(codes[1]) != 3) && error("The country codes in this function must follow the 3 char ISO codes. This does not.")
147146

148147
_reg = lowercase(string(region))

src/circfit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function circfit_tau(X, Y)
5555
Zmean = mean(Z)
5656
Z0 = (Z .- Zmean) / (2*sqrt(Zmean))
5757
ZXY = [Z0 X Y]
58-
U,S,V = svd(ZXY)
58+
_, _, V = svd(ZXY) # U,S,V = svd(ZXY)
5959
A = V[:,3]
6060
A[1] = A[1]/(2*sqrt(Zmean))
6161
A = [A; -Zmean*A[1]]

src/common_options.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ function opt_R2num(opt_R::String)::Vector{Float64}
369369
(endswith(opt_R, "Rg")) && return [0.0, 360., -90., 90.]
370370
(endswith(opt_R, "Rd")) && return [-180.0, 180., -90., 90.]
371371
if (findfirst("/", opt_R) !== nothing && !contains(opt_R, ":"))
372-
isdiag = false
372+
#isdiag = false
373373
if ((ind = findfirst("+r", opt_R)) !== nothing) # Diagonal mode
374374
opt_R = opt_R[1:ind[1]-1]; isdiag = true # Strip the "+r"
375375
end

src/extras/montage.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function _montage_adjust_margins!(d::Dict, titles, colorbar, cbar, margins::Stri
4949
end
5050

5151
"""Compute panels_size string from images or explicit value. Returns the string to use."""
52-
function _montage_panels_size!(d::Dict, images, panels_size::String, ncols::Int)::String
52+
function _montage_panels_size!(images, panels_size::String, ncols::Int)::String
5353
if panels_size == ""
5454
_imgs = isa(images, AbstractVector) ? images : [images]
5555
widths, heights = subplot_panel_sizes(_imgs, ncols=ncols)
@@ -125,7 +125,7 @@ function _montage_images(images, d::Dict)
125125

126126
# Build panels_size string
127127
if ps_val == "" || ps_val === nothing
128-
ps_str = _montage_panels_size!(d, images, "", ncols)
128+
ps_str = _montage_panels_size!(images, "", ncols)
129129
elseif isa(ps_val, Tuple)
130130
ps_str = string(ps_val[1], "/", ps_val[2])
131131
else

src/extras/okada.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -391,36 +391,35 @@ chinnery(f::Function, x, p, L, W, q, sin_dip, cos_dip, nu) =
391391
#---------------------------------------------------------------------------------------------------
392392
# Displacements
393393
function okd_ux(U1, U2, U3, x, p, q, L, W, sin_dip, cos_dip, nu)
394-
ux = (-U1 * chinnery(ux_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
395-
-U2 * chinnery(ux_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
396-
+U3 * chinnery(ux_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
394+
(-U1 * chinnery(ux_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
395+
-U2 * chinnery(ux_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
396+
+U3 * chinnery(ux_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
397397
end
398398
function okd_ux(U1, U2, x, p, q, L, W, sin_dip, cos_dip, nu)
399399
(-U1 * chinnery(ux_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
400400
-U2 * chinnery(ux_ds,x,p,L,W,q,sin_dip, cos_dip,nu)) # dip-slip
401401
end
402402

403403
function okd_uy(U1, U2, U3, x, p, q, L, W, sin_dip, cos_dip, nu)
404-
uy = (-U1 * chinnery(uy_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
405-
-U2 * chinnery(uy_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
406-
+U3 * chinnery(uy_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
404+
(-U1 * chinnery(uy_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
405+
-U2 * chinnery(uy_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
406+
+U3 * chinnery(uy_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
407407
end
408408
function okd_uy(U1, U2, x, p, q, L, W, sin_dip, cos_dip, nu)
409409
(-U1 * chinnery(uy_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
410410
-U2 * chinnery(uy_ds,x,p,L,W,q,sin_dip, cos_dip,nu)) # dip-slip
411411
end
412412

413413
function okd_uz(U1, U2, U3, x, p, q, L, W, sin_dip, cos_dip, nu)
414-
uz = (-U1 * chinnery(uz_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
415-
-U2 * chinnery(uz_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
416-
+U3 * chinnery(uz_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
414+
(-U1 * chinnery(uz_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
415+
-U2 * chinnery(uz_ds,x,p,L,W,q,sin_dip, cos_dip,nu) # dip-slip
416+
+U3 * chinnery(uz_tf,x,p,L,W,q,sin_dip, cos_dip,nu)) # tensile fault
417417
end
418418
function okd_uz(U1, U2, x, p, q, L, W, sin_dip, cos_dip, nu)
419419
(-U1 * chinnery(uz_ss,x,p,L,W,q,sin_dip, cos_dip,nu) # strike-slip
420420
-U2 * chinnery(uz_ds,x,p,L,W,q,sin_dip, cos_dip,nu)) # dip-slip
421421
end
422422

423-
424423
#= ---------------------------------------------------------------------------------------------------
425424
# Tilt
426425
function okd_uzx(U1, U2, U3, x, p, q, L, W, sin_dip, cos_dip, nu)

src/gadm.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function gadm(country, subregions...; children::Bool=false, names::Bool=false, c
8989
error("Asked data for a level ($(plevel+1)) that is lower than lowest data level ($(_nlayers))")
9090
end
9191

92-
function _get_attrib(feature)
92+
function _get_attrib(feature) # Core.boxed
9393
n = Gdal.nfield(feature)
9494
attrib = DictSvS()
9595
[attrib[Gdal.getname(Gdal.getfielddefn(feature, i))] = string(Gdal.getfield(feature, i)) for i = 0:n-1]

src/gdal_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ function seek_wkt_in_gdalinfo(info::String)
601601
# expose them with gdalinfo.
602602
((ind = findfirst("SRS=GEO", info)) === nothing) && return ""
603603
ind2 = findfirst('\n', view(info, ind[5]:length(info))) # Find next EOL
604-
proj4 = toPROJ4(importWKT(info[ind[5] : ind[5]+ind2[1]-2]))
604+
toPROJ4(importWKT(info[ind[5] : ind[5]+ind2[1]-2]))
605605
end
606606

607607
# ---------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)