Should we set -J and -B defaults in modern mode (after `gmtbegin`)?

Aperta
#703 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
julia

Direzione di ricerca

Inizia con src/common_options.jl e src/psbasemap.jl, usando come punti di ingresso l'esempio e lo stack trace di gmtbegin(), gmtend() e basemap(). Traccia il modo in cui la modalità classica fornisce valori -J e -B impliciti rispetto alla modalità moderna, quindi verifica che la modalità moderna riceva valori predefiniti equivalenti tra le funzioni, mentre le opzioni esplicite di proiezione e cornice continuino a sovrascriverli.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Currently, when using modern mode the defaults for projection (-J) and frame (-B) are not set, for example:

julia> basemap(region = :g, show = true)  # Works because it sets implicit defaults for -J and -B

julia> gmtbegin()

julia> basemap(region = :g)
basemap [ERROR]: Must specify at least one of -A, -B, -D, -L, -T
ERROR: Something went wrong when calling the module. GMT error number = 71
Stacktrace:
 [1] gmt(cmd::String, args::Nothing)
   @ GMT ~/.julia/packages/GMT/lcweZ/src/gmt_main.jl:283
 [2] finish_PS_module(d::Dict{Symbol, Any}, cmd::Vector{String}, opt_extra::String, K::Bool, O::Bool, finish::Bool, args::Nothing)
   @ GMT ~/.julia/packages/GMT/lcweZ/src/common_options.jl:3399
 [3] basemap(cmd0::String, arg1::Nothing; first::Bool, kwargs::Base.Iterators.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:region,), Tuple{Symbol}}})
   @ GMT ~/.julia/packages/GMT/lcweZ/src/psbasemap.jl:67
 [4] top-level scope
   @ REPL[43]:1

julia> gmtend()

julia> basemap(region = :g, Vd = 2)
"psbasemap  -Rg -JX14c/0 -Baf -BWSen -P -K > /tmp/GMTjl_tmp.ps"

julia> gmtbegin()

julia> basemap(region = :g, Vd = 2)
"basemap  -Rg"

julia> gmtend()

It happens with the other functions as well of course (not just basemap). I think the defaults that are set in classic mode are quite nice, so maybe it wouldn't hurt to use them in modern mode as well? I'm not sure anything is lost by doing this: if the user wants a different projection/frame, they can still override the defaults. Also, the behaviour becomes more consistent with classic mode.

I can have a go at a patch (probably not before the weekend) if you're short on time. Just thought I'd raise the point.

Cheers

Lingua principale
Julia
Stelle
222
Fork
35
Merge medio
8h 1m
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GenericMappingTools/GMT.jl

Tutte le issue di GenericMappingTools/GMT.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.