Skip to content

Naming conventions for parameter names #2014

@yvonnefroehlich

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

status old name new name PR comment
above
alabel a_label see also blabel, clabel
aliases
alpha
angle
annotate
annotation
anti_alias
anti_aliasing
area_thresh
aspatial
🚧 autolabel auto_label #4275 not Pythonic yet
azimuth
background
✔️ barwidth bar_width #4279 split into bar_width and bar_offset in second PR
bb_style
below
between
binary
🚧 bitcolor bit_color #4280 not Pythonic yet
blabel see also alabel, clabel
✔️ bordervalues border_values #4281
borders
box
categorical
center
circ_subregion
clabel c_label see also alabel, blabel
clearance
close
cmap
color_model
coltypes col_types, column_types shortcut
🚧 combitable combi_table #4293 pygmt.x2sys_cross; need suitable name
compass
component
✔️ compressionfill compression_fill #4269
connection
✔️ constantfill constant_fill #4273
continuous
contour
✔️ contourpen contour_pen #4260
convention
convergence
cores
critical
crop
🚧 crossprofile cross_profile #4278 not Pythonic yet
crs
cstyle c_style
cumulative
cyclic
data
data_source
dcw
depth
dfile d_file
diameter
direction
discontinuity
dist2line
dist2pt
distance
distcalc dist_calc shortcut
distribution
distribution_name
download
dpi
✔️ drapegrid drape_grid #4276
duplicate
ellipse
empty
❌️ endpoint end_point partly written as one word
🚧 equalsize equal_size #4277 not Pythonic yet
error_bar
event_name
extend
✔️ extensionfill extension_fill #4269
extreme
✔️ - facade_fill #4235 split -N into plane and facade_fill
✔️ facadepen facade_pen #4260
figsize fig_size
fill
filter
filter_type
find
🚧 fixedlabel fixed_label #4275 not Pythonic yet
flat_earth
fmt
fmtfile fmt_file shortcut
fname fig_name shortcut
font
force
force_scan
frame
gap
generate
geographic
grid
✔️ gridfill grid_fill #4273
gs_option
gs_path
gs_version
header
histtype hist_type shortcut
hole
horizontal
image
imagefile image_file see also textfiles, worldfile
img_in -D of Figure.grdimage
incols
inquire
intensity
interpolation
inverse
justify
label
✔️ labelbox label_box #4274
label_placement
labels
lakes
land
latitude
length
levels
limit
log
longitude
lonlat lon_lat shortcut
lower
map_scale
🚀 margin margins clearance #4296 for -C of Figure.inset, for GMT <= 6.4 it was -M
margins for -M of Figure.subplot
✔️ grid_mask mask_grid #4283
✔️ mask mask_values #4288 for -N of pygmt.select
✔️ maskvalues mask_values #4281 for -N of pygmt.grdlandmask
max_retries
maxradius max_radius consistency
✔️ meshpen mesh_pen #4260
method
monochrome
nan_transparent
nans
ncols n_cols
nearest_multiple
✔️ fillnegative negative_fill #4271
✔️ neighborfill neighbor_fill #4271
❌️ newcolname new_col_name see event_name, distribution_name
nlevels n_levels
no_bg
no_clip
no_scale
no_skip
no_sort
nodal
nodata no_data used in too many functions
no_data for -N of pygmt.grdfill, deprecated to hole in v0.19.0
node_table
norm
normalize
nrows n_rows
🚧 numpoints num_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
✔️ fillpositive positive_fill #4271
prefix
profile
projection
quantile_value
quantity
radiance
radius
region
registration
replace
required
resample
rescale
resize
resolution
reverse
rivers
rose
runtimes run_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
sharex share_x
sharey share_y
shift
shorelines
show
single_form
size
skip
skiprows skip_rows #4295 used in five functions
slope_file
sort
source
spacing
spec
speed
✔️ splinefill spline_fill #4273
stack
stairs
statistic
straight_line
style
subsize sub_size
suffix
summary
surftype surf_type shortcut
symbol
tag
tension
terminator
terminator_datetime
text
textfiles text_files see also imagefile, worldfile
tiles
time_col
❌ ❔ timefmt time_fmt shortcut
title
toggle
track
✔️ trackvalues track_values #4282
tracks
transparency
transparent
triangular_mesh_pen
truncate
uncertainty
✔️ uncertaintyfill uncertainty_fill #4272
🚧 unit units #4297 for Q of pygmt.project; need suitable name
`unit for -M of pygmt.grdproject, -L of pygmt.sphdistance
units for -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
❌❔ worldfile world_file see also imagefile, textfiles
wrap
x
xmax x_max
xmin x_min
xshift x_shift
y
ymax y_max
ymin y_min
yshift y_shift
z
z_only
z_subregion
zfile z_file
zoom
zoom_adjust
zscale z_scale
zsize z_size
zvalue z_value

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