From 4c73d36e7c6d7c37d60aee287f164a29b62c640d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 12 Dec 2025 18:22:42 +0100 Subject: [PATCH 1/3] Deprecate crossprofile to cross_profile --- pygmt/src/grdtrack.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 236cff1da8e..8d743cbe7eb 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -26,7 +26,7 @@ @fmt_docstring @use_alias( A="resample", - C="crossprofile", + C="cross_profile", D="dfile", E="profile", F="critical", @@ -68,7 +68,7 @@ def grdtrack( first two columns (more columns may be present). It interpolates the grid(s) at the positions in the table and writes out the table with the interpolated values added as (one or more) new columns. Alternatively - (``crossprofile``), the input is considered to be line-segments and we + (``cross_profile``), the input is considered to be line-segments and we create orthogonal cross-profiles at each data point or with an equidistant separation and sample the grid(s) along these profiles. A bicubic [Default], bilinear, B-spline or nearest-neighbor interpolation is used, @@ -100,7 +100,7 @@ def grdtrack( sampled values will be placed. resample : str **f**\|\ **p**\|\ **m**\|\ **r**\|\ **R**\ [**+l**] - For track resampling (if ``crossprofile`` or ``profile`` are set) we + For track resampling (if ``cross_profile`` or ``profile`` are set) we can select how this is to be performed. Append **f** to keep original points, but add intermediate points if needed [Default], **m** as **f**, but first follow meridian (along y) then parallel (along x), @@ -109,9 +109,9 @@ def grdtrack( not necessarily included in the output, and **R** as **r**, but adjust given spacing to fit the track length exactly. Finally, append **+l** if geographic distances should be measured along rhumb lines - (loxodromes) instead of great circles. Ignored unless ``crossprofile`` + (loxodromes) instead of great circles. Ignored unless ``cross_profile`` is used. - crossprofile : str + cross_profile : str *length*/\ *ds*\ [*/spacing*][**+a**\|\ **+v**][**l**\|\ **r**]. Use input line segments to create an equidistant and (optionally) equally-spaced set of crossing profiles along which we sample the @@ -135,7 +135,7 @@ def grdtrack( *z1*, *z2*, ..., *zn* (The *zi* are the sampled values for each of the *n* grids). dfile : str - In concert with ``crossprofile`` we can save the (possibly resampled) + In concert with ``cross_profile`` we can save the (possibly resampled) original lines to *dfile* [Default only saves the cross-profiles]. The columns will be *lon*, *lat*, *dist*, *azimuth*, *z1*, *z2*, ... (sampled value for each grid). @@ -170,13 +170,13 @@ def grdtrack( result in an error. If no units are specified we default to great circle distances in km (if geographic). If working with geographic data you can use ``distcalc`` to control distance calculation mode [Default - is Great Circle]. **Note**: If ``crossprofile`` is set and *spacing* is + is Great Circle]. **Note**: If ``cross_profile`` is set and *spacing* is given then that sampling scheme overrules any modifier set in ``profile``. critical : str [**+b**][**+n**][**+r**][**+z**\ *z0*]. Find critical points along each cross-profile as a function of - along-track distance. Requires ``crossprofile`` and a single input grid + along-track distance. Requires ``cross_profile`` and a single input grid (*z*). We examine each cross-profile generated and report (*dist*, *lonc*, *latc*, *distc*, *azimuthc*, *zc*) at the center peak of maximum *z* value, (*lonl*, *latl*, *distl*) and (*lonr*, *latr*, @@ -203,7 +203,7 @@ def grdtrack( [Default only output points within the grid domain]. stack : str or list *method*/*modifiers*. - In conjunction with ``crossprofile``, compute a single stacked profile + In conjunction with ``cross_profile``, compute a single stacked profile from all profiles across each segment. Choose how stacking should be computed [Default method is **a**]: From 3a6f2e2244d871273473e73e92c4cfc2f8df3a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 12 Dec 2025 19:10:08 +0100 Subject: [PATCH 2/3] Add future warning --- pygmt/src/grdtrack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 8d743cbe7eb..eb0d01af184 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -14,6 +14,7 @@ from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( build_arg_list, + deprecate_parameter, fmt_docstring, kwargs_to_strings, use_alias, @@ -24,6 +25,7 @@ @fmt_docstring +@deprecate_parameter("crossprofile", "cross_profile", "v0.18.0", remove_version="v0.20.0") @use_alias( A="resample", C="cross_profile", From ca107049604484df7184b42f14db607d21ed1fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 12 Dec 2025 20:38:43 +0100 Subject: [PATCH 3/3] Fix line length --- pygmt/src/grdtrack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index eb0d01af184..69a57b68831 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -25,7 +25,9 @@ @fmt_docstring -@deprecate_parameter("crossprofile", "cross_profile", "v0.18.0", remove_version="v0.20.0") +@deprecate_parameter( + "crossprofile", "cross_profile", "v0.18.0", remove_version="v0.20.0" +) @use_alias( A="resample", C="cross_profile",