Should we set -J and -B defaults in modern mode (after `gmtbegin`)?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- data-visualization
Research direction
Start with src/common_options.jl and src/psbasemap.jl, using the gmtbegin(), gmtend(), and basemap() example and stack trace as entry points. Trace how classic mode supplies implicit -J and -B values versus modern mode, then verify that modern mode receives equivalent defaults across functions while explicit projection and frame options still override them.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Julia
- Stars
- 222
- Forks
- 35
- Avg merge
- 8h 1m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenericMappingTools/GMT.jl
-
Register v"1.44.1"Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
GenericMappingTools/GMT.jl#2071 · 1 comment ·
-
Register v"1.44.0"Open
Difficulty 1/5 Under an hour Newbie friendliness 5/100
GenericMappingTools/GMT.jl#2066 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
GenericMappingTools/GMT.jl#2030 · 14 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
GenericMappingTools/GMT.jl#2023 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
GenericMappingTools/GMT.jl#1893 · 11 comments ·
All issues in GenericMappingTools/GMT.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
brown-ccv/Chamber.jl#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAstro/SolarPosition.jl#143 ·
-
distributions
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaBayes/Wren.jl#404 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#113 ·
Maintainers usually reply within 1 day