Skip to content

Naming conventions for parameter names #2014

Description

@yvonnefroehlich

In the Contributors Guide in the section Code Style:

When wrapping a new alias, use an underscore to separate words bridged by vowels (aeiou), such as no_skip and z_only. Do not use an underscore to separate words bridged only by consonants, such as distcalc, and crossprofile. This convention is not applied by the code checking tools, but the PyGMT maintainers will comment on any pull requests as needed.

However, some aliases seem not to follow this convention. For example:

  • pygmt.Figure.plot(): straight_line (A) , error_bar (E), nodata (d)
    Following the convention, they should be straigthline, errorbar , no_data
  • pygmt.Figure.rose(): vector_params (M)
    Should be vectorparams.

Please note: This is primarily meant as a general question for understanding, rather than a request for renaming these aliases. 😉


Overview table

  • ✔️: Changed (PR merged)
  • 🚀: TODO / WIP (PR planed or opened)
  • ❔: Need disscussion
  • 🚧: Need to wait (PR converted to draft)
  • ❌: Not changed
  • : Already fine
Click to show the table

statusold namenew namePRcomment
above
alabela_labelsee also blabel, clabel
aliases
alpha
angle
annotate
annotation
anti_alias
anti_aliasing
area_thresh
aspatial
🚧autolabelauto_label#4275not Pythonic yet
azimuth
background
✔️barwidthbar_width#4279split into bar_width and bar_offset in second PR
bb_style
below
between
binary
🚧bitcolorbit_color#4280not Pythonic yet
blabelsee also alabel, clabel
✔️bordervaluesborder_values#4281
borders
box
categorical
center
circ_subregion
clabelc_labelsee also alabel, blabel
clearance
close
cmap
color_model
coltypescol_types, column_typesshortcut
🚧combitablecombi_table#4293pygmt.x2sys_cross; need suitable name
compass
component
✔️compressionfillcompression_fill#4269
connection
✔️constantfillconstant_fill#4273
continuous
contour
✔️contourpencontour_pen#4260
convention
convergence
cores
critical
crop
🚧crossprofilecross_profile#4278not Pythonic yet
crs
cstylec_style
cumulative
cyclic
data
data_source
dcw
depth
dfiled_file
diameter
direction
discontinuity
dist2line
dist2pt
distance
distcalcdist_calcshortcut
distribution
distribution_name
download
dpi
✔️drapegriddrape_grid#4276
duplicate
ellipse
empty
❌️endpointend_pointpartly written as one word
🚧equalsizeequal_size#4277not Pythonic yet
error_bar
event_name
extend
✔️extensionfillextension_fill#4269
extreme
✔️-facade_fill#4235split -N into plane and facade_fill
✔️facadepenfacade_pen#4260
figsizefig_size
fill
filter
filter_type
find
🚧fixedlabelfixed_label#4275not Pythonic yet
flat_earth
fmt
fmtfilefmt_fileshortcut
fnamefig_nameshortcut
font
force
force_scan
frame
gap
generate
geographic
grid
✔️gridfillgrid_fill#4273
gs_option
gs_path
gs_version
header
histtypehist_typeshortcut
hole
horizontal
image
imagefileimage_filesee also textfiles, worldfile
img_in-D of Figure.grdimage
incols
inquire
intensity
interpolation
inverse
justify
label
✔️labelboxlabel_box#4274
label_placement
labels
lakes
land
latitude
length
levels
limit
log
longitude
lonlatlon_latshortcut
lower
map_scale
✔️marginmarginsclearance#4296for -C of Figure.inset, for GMT <= 6.4 it was -M
marginsfor -M of Figure.subplot
✔️grid_maskmask_grid#4283
✔️maskmask_values#4288for -N of pygmt.select
✔️maskvaluesmask_values#4281for -N of pygmt.grdlandmask
max_retries
✔️maxradiusmax_radius#4300consistency
✔️meshpenmesh_pen#4260
method
monochrome
nan_transparent
nans
ncolsn_cols
nearest_multiple
✔️fillnegativenegative_fill#4271
✔️neighborfillneighbor_fill#4271
❌️newcolnamenew_col_namesee event_name, distribution_name
nlevelsn_levels
no_bg
no_clip
no_scale
no_skip
no_sort
nodal
nodatano_dataused in too many functions
no_datafor -N of pygmt.grdfill, deprecated to hole in v0.19.0
node_table
norm
normalize
nrowsn_rows
🚧numpointsnum_points-W of pygmt.x2sys_cross; need suitable name
offset
orientation
outcols
outfile
outgrid
outline
output
output_type
override
overrule_bg
panel
pen
per_column
perspective
plane
plot_latitude
plot_longitude
points
pole
polygon
position
✔️fillpositivepositive_fill#4271
prefix
profile
projection
quantile_value
quantity
radiance
radius
region
registration
replace
required
resample
rescale
resize
resolution
reverse
rivers
rose
runtimesrun_times#4294-C of Figure.x2sys_cross; in Computer Sciences one word
scale
scaling
search_radius
sector-A of Figure.rose
sectors-N of pygmt.dimfilter
series
shading
sharexshare_x
shareyshare_y
shift
shorelines
show
single_form
size
skip
skiprowsskip_rows#4295used in five functions
slope_file
sort
source
spacing
spec
speed
✔️splinefillspline_fill#4273
stack
stairs
statistic
straight_line
style
subsizesub_size
suffix
summary
surftypesurf_typeshortcut
symbol
tag
tension
terminator
terminator_datetime
text
textfilestext_filessee also imagefile, worldfile
tiles
time_col
❌ ❔timefmttime_fmtshortcut
title
toggle
track
✔️trackvaluestrack_values#4282
tracks
transparency
transparent
triangular_mesh_pen
truncate
uncertainty
✔️uncertaintyfilluncertainty_fill#4272
🚧unitunits#4297for Q of pygmt.project; need suitable name
`unitfor -M of pygmt.grdproject, -L of pygmt.sphdistance
unitsfor -M of pygmt.x2sys_init
upper
use_srtm
use_word
vector-A of Figure.veloc
vector_params
vectors-Em of Figure.rose
verbose
voronoi
wait
water
weight
width
❌❔worldfileworld_filesee also imagefile, textfiles
wrap
x
xmaxx_max
xminx_min
xshiftx_shift
y
ymaxy_max
yminy_min
yshifty_shift
z
z_only
z_subregion
zfilez_file
zoom
zoom_adjust
zscalez_scale
zsizez_size
zvaluez_value

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionsNeed more discussion before taking further actions

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions