Skip to content

Commit

Permalink
Merge pull request #538 from GenericMappingTools/fix-regressions
Browse files Browse the repository at this point in the history
Fix regressions in modern mode and auto cpt generation
  • Loading branch information
joa-quim authored Mar 3, 2021
2 parents d27c0ac + 8fbbf53 commit 70ce816
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 69 deletions.
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GMT"
uuid = "5752ebe1-31b9-557e-87aa-f909b540aa54"
authors = ["Joaquim Luis <jluis@ualg.pt>"]
version = "0.30.0"
version = "0.30.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
8 changes: 4 additions & 4 deletions src/common_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ function add_opt_cpt(d::Dict, cmd::String, symbs, opt::Char, N_args::Int=0, arg1
cmd *= opt_C
if (store && c != "" && tryparse(Float32, c) === nothing) # Because if !== nothing then it's number and -Cn is not valid
try # Wrap in try because not always (e.g. grdcontour -C) this is a makecpt callable
global current_cp = makecpt(opt_C * " -Vq")
global current_cpt = makecpt(opt_C * " -Vq")
catch
end
elseif (in_bag && current_cpt !== nothing) # If we have something in Bag, return it
Expand Down Expand Up @@ -2543,6 +2543,7 @@ function read_data(d::Dict, fname::String, cmd::String, arg, opt_R::String="", i
cmd, opt_di = parse_di(d, cmd) # If data missing data other than NaN
cmd, opt_h = parse_h(d, cmd)
cmd, opt_yx = parse_swap_xy(d, cmd)
(CTRL.proj_linear[1]) && (opt_yx *= " -fc") # To avoid the lib remembering last eventual geog case
if (endswith(opt_yx, "-:")) opt_yx *= "i" end # Need to be -:i not -: to not swap output too
if (isa(data_kw, String))
if (((!IamModern[1] && opt_R == "") || get_info) && !convert_syntax[1]) # Must read file to find -R
Expand Down Expand Up @@ -2906,8 +2907,6 @@ function showfig(d::Dict, fname_ps::String, fname_ext::String, opt_T::String, K:
if (fname != "") out = mv(out, fname, force=true) end
end

CTRL.limits[1:6] = zeros(6); CTRL.proj_linear[1] = false; # Reset these for safety

if (haskey(d, :show) && d[:show] != 0)
if (isdefined(Main, :IJulia) && Main.IJulia.inited) # From Jupyter?
if (fname == "") display("image/png", read(out))
Expand Down Expand Up @@ -3058,7 +3057,8 @@ function show_non_consumed(d::Dict, cmd)
if (length(d) > 0)
prog = isa(cmd, String) ? split(cmd)[1] : split(cmd[1])[1]
println("Warning: the following options were not consumed in $prog => ", keys(d))
end
end
CTRL.limits[1:6] = zeros(6); CTRL.proj_linear[1] = false; # Reset these for safety
end

# --------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/imshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function snif_GI_set_CTRLlimits(G_I)::Bool
(G_I == "") && return false
(isa(G_I, String) && G_I[1] == '@') && return false # Remote files are very dangerous to sniff in
ginfo = grdinfo(G_I, C=:n)
if (ginfo[1].data[2] != ginfo[1].data[9] && ginfo[1].data[4] != ginfo[1].data[10])
if (isa(ginfo, Vector{GMTdataset}) && ginfo[1].data[2] != ginfo[1].data[9] && ginfo[1].data[4] != ginfo[1].data[10])
CTRL.limits[1:4] = ginfo[1].data[1:4]
return true
else
Expand Down
2 changes: 1 addition & 1 deletion src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Parameters
- $(GMT.opt_X)
- $(GMT.opt_Y)
- **Z** | **level** | **zcolor** :: [Type => Str | NamedTuple] `Arg = value|file[+f|+l] | (data=Array|Number, outline=_, fill=_)`
- **Z** | **level** :: [Type => Str | NamedTuple] `Arg = value|file[+f|+l] | (data=Array|Number, outline=_, fill=_)`
Paint polygons after the level given as a cte or a vector with same size of number of polygons. Needs a color map.
($(GMTdoc)plot.html#z)
Expand Down
2 changes: 1 addition & 1 deletion src/psxy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function common_plot_xyz(cmd0::String, arg1, caller::String, first::Bool, is3D::

# Look for color request. Do it after error bars because they may add a column
len = length(cmd); n_prev = N_args;
cmd, args, n, got_Zvars = add_opt(d, cmd, 'Z', [:Z :zcolor :level], :data, Any[arg1, arg2, arg3], (outline="_+l", fill="_+f"))
cmd, args, n, got_Zvars = add_opt(d, cmd, 'Z', [:Z :level], :data, Any[arg1, arg2, arg3], (outline="_+l", fill="_+f"))
if (n > 0)
arg1, arg2, arg3 = args[:]
N_args = n
Expand Down

0 comments on commit 70ce816

Please sign in to comment.