From 3d0ae14d043a41b430570a419f7c53a34771e233 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 5 Jan 2025 12:05:46 +0800 Subject: [PATCH 1/5] CI: Simplify the scripts for install GMT dependencies (#8669) --- ci/install-dependencies-linux.sh | 3 +-- ci/install-dependencies-macos.sh | 3 +-- ci/install-dependencies-windows.sh | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ci/install-dependencies-linux.sh b/ci/install-dependencies-linux.sh index 666af4999c5..dd8d3c41540 100755 --- a/ci/install-dependencies-linux.sh +++ b/ci/install-dependencies-linux.sh @@ -41,8 +41,7 @@ sudo apt-get update sudo apt-get install -y --no-install-recommends --no-install-suggests $packages # Install packages via conda -conda update -n base -c conda-forge conda --solver libmamba -conda install ${conda_packages} -c conda-forge --solver libmamba +conda install ${conda_packages} -c conda-forge echo "${CONDA}/bin" >> $GITHUB_PATH # Remove pcre-config from conda's path so cmake won't find the conda's one diff --git a/ci/install-dependencies-macos.sh b/ci/install-dependencies-macos.sh index d2af804cb62..cc92e9b6652 100755 --- a/ci/install-dependencies-macos.sh +++ b/ci/install-dependencies-macos.sh @@ -42,8 +42,7 @@ fi brew install ${packages} # Install packages via conda -conda update -n base -c conda-forge conda --solver libmamba -conda install ${conda_packages} -c conda-forge --solver libmamba +conda install ${conda_packages} -c conda-forge echo "${CONDA}/bin" >> $GITHUB_PATH # Remove pcre-config from conda's path so cmake won't find the conda's one diff --git a/ci/install-dependencies-windows.sh b/ci/install-dependencies-windows.sh index 507f7d1e7c9..5b3a5f6a1f5 100755 --- a/ci/install-dependencies-windows.sh +++ b/ci/install-dependencies-windows.sh @@ -48,8 +48,7 @@ if [ "$PACKAGE" = "true" ]; then fi # install more packages using conda -$CONDA\\Scripts\\conda.exe update -n base -c conda-forge conda --solver libmamba -$CONDA\\Scripts\\conda.exe install ${conda_packages} -c conda-forge --solver libmamba +$CONDA\\Scripts\\conda.exe install ${conda_packages} -c conda-forge echo "$CONDA\\Library\\bin" >> $GITHUB_PATH echo "$CONDA\\Scripts" >> $GITHUB_PATH From d9a447eeef84db103325f3f2c171426dcf541fb5 Mon Sep 17 00:00:00 2001 From: Federico Esteban Date: Mon, 6 Jan 2025 10:51:37 -0300 Subject: [PATCH 2/5] Update info about remote data set (#8672) --- doc/rst/source/reference/features.rst | 34 +++++++++------------------ 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/doc/rst/source/reference/features.rst b/doc/rst/source/reference/features.rst index 960759016ab..8e580ed637e 100644 --- a/doc/rst/source/reference/features.rst +++ b/doc/rst/source/reference/features.rst @@ -519,28 +519,16 @@ URLs and remote files Three classes of files are given special treatment in GMT. -#. Some data sets are ubiquitous and used by nearly all GMT users. - At the moment this collection is limited to Earth relief grids. If you specify - a grid input named **@earth_relief_**\ *res* on a command line then - such a grid will automatically be downloaded from the GMT Data Server and placed - in the *server* directory under **$GMT_USERDIR** [~/.gmt]. The resolution *res* allows a choice among - 15 common grid spacings: 01d, 30m, 20m, 15m, 10m, 06m, 05m, 04m, 03m, 02m, 01m, - 30s, and 15s (with file sizes 111 kb, 376 kb, 782 kb, 1.3 Mb, 2.8 Mb, 7.5 Mb, - 11 Mb, 16 Mb, 27 Mb, 58 Mb, 214 Mb, 778 Mb, and 2.6 Gb respectively) as well - as the SRTM tile resolutions 03s and 01s (6.8 Gb and 41 Gb for the whole set, respectively). Once - one of these grids have been downloaded any future reference will simply obtain the - file from **$GMT_USERDIR** (except if explicitly removed by the user). - **Note**: The 15 arc-sec data comes from the original dataset SRTM15+. - Lower resolutions are spherically Gaussian-filtered versions of SRTM15+. - The SRTM (version 3) 1 and 3 arc-sec tiles are only available over land - between 60 degrees south and north latitude and are stored as highly compressed JPEG2000 - tiles on the GMT server. These are individually downloaded as requested, converted to netCDF - grids and stored in subdirectories srtm1 and srtm3 under the server directory, and assembled - into a seamless grid using :doc:`/grdblend`. A tile is only downloaded and converted - once (unless the user cleans the data directories). +#. GMT offers several remote global data grids that you can access via our remote file mechanism + (e.g. **@earth_relief**). The first time you access one of these files, GMT will download + the file (or a subset tile) from the selected GMT server and save it to the *server* directory + under your **$GMT_USERDIR** directory [~/.gmt]. Once one of these grids have been downloaded + any future reference will simply obtain the file from **$GMT_USERDIR** (except if explicitly + removed by the user). See :doc:`remote-datasets` for a comprehensive list of available remote + datasets and detailed information. #. If a file is given as a full URL, starting with **http://**, **https://**, or **ftp://**, then the file will be downloaded to the current directory and subsequently - read from there (until removed by the user). If the URL is actually a CGI Get + read from there (until removed by the user). If the URL is actually a CGI Get command (i.e., ends in ?par=val1&par2=val2...) then we download the file each time we encounter the URL. #. Demonstration files used in online documentation, example scripts, or even the @@ -548,11 +536,11 @@ Three classes of files are given special treatment in GMT. encountered on the command line it is understood to be a short-hand representation of the full URL to *filename* on the GMT Cache Data site. Since this address may change over time we use the leading - @ to simplify access to these files. Such files will also be downloaded + @ to simplify access to these files. Such files will also be downloaded to :term:`DIR_CACHE` and subsequently read from there (until removed by the user). #. By default, remote files are downloaded from the SOEST data server. However, you can override that selection by setting the environmental parameter **$GMT_DATA_SERVER** or - the default setting for :term:`GMT_DATA_SERVER`. Alternatively, configure the CMake + the default setting for :term:`GMT_DATA_SERVER`. Alternatively, configure the CMake parameter GMT_DATA_SERVER at compile time. #. If your Internet connection is slow or nonexistent (e.g., on a plane) you can also limit the size of the largest datafile to download via :term:`GMT_DATA_SERVER_LIMIT` or @@ -560,7 +548,7 @@ Three classes of files are given special treatment in GMT. The user cache (:term:`DIR_CACHE`) and all its contents can be cleared any time via the command **gmt clear cache**, while the server directory with downloaded data -can be cleared via the command **gmt clear data**. Finally, when a remote file is requested +can be cleared via the command **gmt clear data**. Finally, when a remote file is requested we also check if that file has changed at the server and re-download the updated file; this check is only performed no more often than once a day. From 5d1f571d30d5a540292566a73787e42ed21eca38 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 6 Jan 2025 22:27:43 +0800 Subject: [PATCH 3/5] doc: Fix typos in text docs (#8671) * doc: Fix typos in text docs * More updates --------- Co-authored-by: Remko Scharroo --- doc/rst/source/text.rst | 28 ++++++++++++++++------------ src/pstext.c | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/rst/source/text.rst b/doc/rst/source/text.rst index 16685b916a7..f1ade3ae8b8 100644 --- a/doc/rst/source/text.rst +++ b/doc/rst/source/text.rst @@ -168,9 +168,9 @@ Optional Arguments [0/0]. If *dy* is not specified then it is set equal to *dx*. Prepend an optional directive: - - **-j** - Offset the text away from the point instead (i.e., the + - **j** - Offset the text away from the point instead (i.e., the text justification will determine the direction of the shift). - - **-J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`. + - **J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`. Optionally, append the modifier: @@ -196,10 +196,12 @@ Optional Arguments at the Upper Left corner of the map. - **+f** - Set the font ([*size*][,\ *fontname*][,\ *color*]); if no font info is given then the input file must have this information in one of its columns. - - **+h** - Use the most recent segment header as the text to be plotted. - comes from the data record. Instead, use **+h** or **+l** to select the - **+j** - Set the text justification; if no justification is given then the input file must have this item as a column. + + Normally, the text is read from the data records. Alternative ways to provide text: + + - **+h** - Use the most recent segment header as the text to be plotted. - **+l** - Use the most recent segment label as the text to be plotted. - **+r** - Use the record number (counting up from *first* [0]) as the text to be plotted. - **+t** - Use the appended *text* to set a fixed text string (if *text* contains plus @@ -207,14 +209,16 @@ Optional Arguments - **+z** - Format incoming *z* values to a string using the supplied *format* [if not appended we use :term:`FORMAT_FLOAT_MAP`]. - **Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the - 4th, not 3rd column. If you only want a specific word from the trailing text and - not the whole line, use **-it**\ *word* to indicate which word (0 is the first word) - you want. (2) Items read from the data file should be in the same order as - the modifiers are specified with the |-F| option. Example: - **-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red - Helvetica-Bold font and expects to read the justification and angle - from the file, in that order, after *x* *y* and before *text*. + **Notes**: |-F|\ **+h**\|\ **l**\|\ **r**\|\ **t**\| **z** can't be used with |-M|. + + **Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the + 4th, not 3rd column. If you only want a specific word from the trailing text and + not the whole line, use **-it**\ *word* to indicate which word (0 is the first word) + you want. (2) Items read from the data file should be in the same order as + the modifiers are specified with the |-F| option. Example: + **-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red + Helvetica-Bold font and expects to read the justification and angle + from the file, in that order, after *x* *y* and before *text*. .. _-G: diff --git a/src/pstext.c b/src/pstext.c index ae84439cab3..e00f5eb93e2 100644 --- a/src/pstext.c +++ b/src/pstext.c @@ -713,7 +713,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSTEXT_CTRL *Ctrl, struct GMT_OPT n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->M.active, "Option -Gc: Cannot be used with -M.\n"); n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->W.active, "Option -Gc: Cannot be used with -W.\n"); n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->D.line, "Option -Gc: Cannot be used with -D...v.\n"); - n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h.\n"); + n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h|r|t|z.\n"); n_errors += gmt_M_check_condition (GMT, Ctrl->S.active && !(Ctrl->G.active && Ctrl->G.mode == 0), "Option -S: Requires -G as well.\n"); n_errors += gmt_M_check_condition (GMT, strchr ("cC", Ctrl->C.mode) && !Ctrl->M.active, "Option -C: Box shape mode +tc|C is only available when -M is selected.\n"); From 605da462cbc15e3db40cc86e1e3b863b61444ca8 Mon Sep 17 00:00:00 2001 From: Joaquim Date: Tue, 7 Jan 2025 06:48:07 +0000 Subject: [PATCH 4/5] Fix #8558 (#8673) --- src/gmtbinstats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmtbinstats.c b/src/gmtbinstats.c index 5025dc8ed35..5a1299cc778 100644 --- a/src/gmtbinstats.c +++ b/src/gmtbinstats.c @@ -295,7 +295,7 @@ static int parse (struct GMT_CTRL *GMT, struct GMTBINSTATS_CTRL *Ctrl, struct GM n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -2, "Option -S: Unable to decode radius\n"); n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -3, "Option -S: Radius is negative\n"); } - n_errors += gmt_check_binary_io (GMT, (Ctrl->W.active) ? 4 : 3); + n_errors += gmt_check_binary_io(GMT, (Ctrl->C.mode == GMTBINSTATS_COUNT) ? 2 : (Ctrl->W.active) ? 4 : 3); if (Ctrl->W.active) { /* Update the mode if median or mode */ if (Ctrl->C.mode == GMTBINSTATS_MEDIAN) Ctrl->C.mode = GMTBINSTATS_MEDIANW; if (Ctrl->C.mode == GMTBINSTATS_MODE) Ctrl->C.mode = GMTBINSTATS_MODEW; From c21e899aa83f73b9522cf2e922d567da555d6b38 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 7 Jan 2025 10:16:34 -0300 Subject: [PATCH 5/5] Fix link in Remote files --- doc/rst/source/reference/features.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/rst/source/reference/features.rst b/doc/rst/source/reference/features.rst index 8e580ed637e..9d227a92a66 100644 --- a/doc/rst/source/reference/features.rst +++ b/doc/rst/source/reference/features.rst @@ -524,8 +524,10 @@ Three classes of files are given special treatment in GMT. the file (or a subset tile) from the selected GMT server and save it to the *server* directory under your **$GMT_USERDIR** directory [~/.gmt]. Once one of these grids have been downloaded any future reference will simply obtain the file from **$GMT_USERDIR** (except if explicitly - removed by the user). See :doc:`remote-datasets` for a comprehensive list of available remote - datasets and detailed information. + removed by the user). See the `Remote Datasets `_ + section for a comprehensive list of available remote datasets and detailed information. + + #. If a file is given as a full URL, starting with **http://**, **https://**, or **ftp://**, then the file will be downloaded to the current directory and subsequently read from there (until removed by the user). If the URL is actually a CGI Get