Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed May 6, 2024
2 parents 06442fb + 8e3cd98 commit 64a8c73
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Setup vcpkg (Windows)
uses: dawidd6/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.9.3
uses: lycheeverse/lychee-action@v1.10.0
with:
# 429: Too many requests
args: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Install vcpkg libraries
run: bash ci/install-dependencies-windows.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Check PSL_strings.h
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Install GMT dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Setup vcpkg (Windows)
uses: dawidd6/[email protected]
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
- name: Checkout the gh-pages branch in a separate folder
uses: actions/[email protected].1
uses: actions/[email protected].4
with:
ref: gh-pages
# Checkout to this folder instead of the current one
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dvc-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Setup data version control (DVC)
uses: iterative/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Check out repository
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Install cppcheck
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-baseline-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Setup data version control (DVC)
uses: iterative/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/remind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Find and report known failures
run: |
Expand All @@ -29,5 +29,5 @@ jobs:
gh issue create --title "$title" --body-file report.md
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}

88 changes: 47 additions & 41 deletions .github/workflows/scm-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,59 @@ jobs:
scm-check:
name: SCM Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/[email protected]

- name: Check the latest release
id: scm
run: |
scm_version_in_gmt=8.0.0
- name: Check the latest release
id: scm
run: |
scm_version_in_gmt=8.0.0
# Get version string and date from Zenodo API
# https://doi.org/10.5281/zenodo.1243862
scm_version=$(curl -Ls https://zenodo.org/api/records/1243862 | jq '.metadata.version' | sed 's/"//g')
scm_version_date=$(curl -Ls https://zenodo.org/api/records/1243862 | jq '.metadata.publication_date' | sed 's/"//g')
echo "SCM version ${scm_version} (${scm_version_date})"
# Get version string and date from Zenodo API
# https://doi.org/10.5281/zenodo.1243862
scm_version=$(curl -Ls https://zenodo.org/api/records/1243862 | jq '.metadata.version' | sed 's/"//g')
scm_version_date=$(curl -Ls https://zenodo.org/api/records/1243862 | jq '.metadata.publication_date' | sed 's/"//g')
echo "SCM version ${scm_version} (${scm_version_date})"
# Set output of the current step
echo "scm_version=${scm_version}" >> $GITHUB_OUTPUT
echo "scm_version_date=${scm_version_date}" >> $GITHUB_OUTPUT
if [ "${scm_version}" != ${scm_version_in_gmt} ]; then
echo "The latest SCM version (${scm_version}) is different from the one in GMT (${scm_version_in_gmt})!"
echo "error_code=2" >> $GITHUB_OUTPUT
fi
# Set output of the current step
echo "scm_version=${scm_version}" >> $GITHUB_OUTPUT
echo "scm_version_date=${scm_version_date}" >> $GITHUB_OUTPUT
if [ "${scm_version}" != ${scm_version_in_gmt} ]; then
echo "The latest SCM version (${scm_version}) is different from the one in GMT (${scm_version_in_gmt})!"
echo "error_code=2" >> $GITHUB_OUTPUT
fi
- name: Create an update request
if: ${{ steps.scm.outputs.error_code == 2 }}
run: |
title="New ScientificColourMaps version ${{ steps.scm.outputs.scm_version }} found"
cat > report.md << 'EOF'
A new Scientific Colour Maps release was found.
- name: Create an update request
if: ${{ steps.scm.outputs.error_code == 2 }}
uses: nashmaniac/[email protected]
with:
title: New ScientificColourMaps version ${{ steps.scm.outputs.scm_version }} found
token: ${{secrets.GITHUB_TOKEN}}
body: |
A new Scientific Colour Maps release was found.
- website: https://www.fabiocrameri.ch/colourmaps.php
- version: ${{ steps.scm.outputs.scm_version }}
- date: ${{ steps.scm.outputs.scm_version_date }}
- website: https://www.fabiocrameri.ch/colourmaps.php
- version: ${{ steps.scm.outputs.scm_version }}
- date: ${{ steps.scm.outputs.scm_version_date }}
Todo list:
Todo list:
- [ ] Download latest ScientificColourMapsV.zip file from https://doi.org/10.5281/zenodo.1243862
to a folder, e.g. ~/Downloads/ScientificColourMapsV, where V is the version number (e.g. 7).
- [ ] Run `./admin/build-scientific-colors-cpt.sh ~/Downloads/ScientificColourMapsV/` to update CPTs.
- [ ] Move newly generated CPTs to `share/cpt` using `mv ~/Downloads/ScientificColourMapsV/gmt_cpts/* share/cpt/`
- [ ] Make sure to update the following files:
- [ ] Version number in `admin/build-scientific-colors-cpt.sh` and `.github/workflows/scm-check.yml`
- [ ] List of colour maps in `src/gmt_cpt_masters.h` using lines in `/tmp/cpt_strings.txt` (only if new colour maps were added)
- [ ] Counts of colour maps in `doc/rst/source/reference/cpts.rst` (only if new colour maps were added)
- [ ] List of colour maps and counts in `doc/scripts/GMT_App_M_1*.sh` (only if new colour maps were added)
- [ ] Update the associated `doc/scripts/GMT_App_M_1*.ps` file(s)
- [ ] Commit all changes and open a PR
- [ ] Download latest ScientificColourMapsV.zip file from https://doi.org/10.5281/zenodo.1243862
to a folder, e.g. ~/Downloads/ScientificColourMapsV, where V is the version number (e.g. 7).
- [ ] Run `./admin/build-scientific-colors-cpt.sh ~/Downloads/ScientificColourMapsV/` to update CPTs.
- [ ] Move newly generated CPTs to `share/cpt` using `mv ~/Downloads/ScientificColourMapsV/gmt_cpts/* share/cpt/`
- [ ] Make sure to update the following files:
- [ ] Version number in `admin/build-scientific-colors-cpt.sh` and `.github/workflows/scm-check.yml`
- [ ] List of colour maps in `src/gmt_cpt_masters.h` using lines in `/tmp/cpt_strings.txt` (only if new colour maps were added)
- [ ] Counts of colour maps in `doc/rst/source/reference/cpts.rst` (only if new colour maps were added)
- [ ] List of colour maps and counts in `doc/scripts/GMT_App_M_1*.sh` (only if new colour maps were added)
- [ ] Update the associated `doc/scripts/GMT_App_M_1*.ps` file(s)
- [ ] Commit all changes and open a PR
**Note**: If new CPTs were added (check using `ls ~/Downloads/ScientificColourMaps`), update the
`admin/build-scientific-colors-cpt.sh` script first to include the new CPTs, and then rerun it again.
EOF
**Note**: If new CPTs were added (check using `ls ~/Downloads/ScientificColourMaps`), update the
`admin/build-scientific-colors-cpt.sh` script first to include the new CPTs, and then rerun it again.
gh issue create --title "${title}" --body-file report.md
env:
GH_TOKEN: ${{ github.token }}
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ jobs:
- name: Linux
os: ubuntu-latest
- name: macOS
os: macos-latest
os: macos-13 # macos-14 use M1 chips, which causes many failures
- name: Windows
os: windows-latest

steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].4

- name: Setup vcpkg (Windows)
uses: dawidd6/[email protected]
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
if: failure()

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@v4.3.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
22 changes: 11 additions & 11 deletions doc/examples/anim01/anim01.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# GMT ANIMATION 01
#
# Purpose: Make simple MP4 of sine function
# GMT modules: math, basemap, text, plot, movie
# Unix progs: echo, convert, cat
# GMT modules: math, basemap, text, plot, movie, event
# Unix progs: cat
#
# The finished movie is available in our YouTube channel as well:
# https://youtu.be/5m3gRhFFFLA
# https://youtu.be/NjSDpQ5S3FM

# 1. Create files needed in the loop
cat << 'EOF' > pre.sh
gmt math -T0/360/10 T SIND = sin_point.txt
gmt math -T0/360/1 T SIND = sin_curve.txt
gmt begin
gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c \
Expand All @@ -20,14 +19,15 @@ EOF
# 2. Set up the main frame script
cat << 'EOF' > main.sh
gmt begin
gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c -B+n
# Plot smooth blue curve and dark red dots at all angle steps so far
last=$(gmt math -Q ${MOVIE_FRAME} 10 MUL =)
gmt convert sin_curve.txt -qi0:${last} | gmt plot -W1p,blue -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c
gmt convert sin_point.txt -qi0:${MOVIE_FRAME} | gmt plot -Sc0.1i -Gdarkred
# Plot bright red dot at current angle and annotate
gmt plot -Sc0.1i -Gred <<< "${MOVIE_COL0} ${MOVIE_COL1}"
printf "0 1.6 a = %3.3d" ${MOVIE_COL0} | gmt text -F+f14p,Helvetica-Bold+jTL -N -Dj0.1i/0.05i
gmt events sin_curve.txt -i0,1,0 -T${MOVIE_FRAME} -Ar -Es -W1p,blue
gmt plot sin_curve.txt -Sc0.25c -Gdarkred -qi0:10:${MOVIE_FRAME}
# Plot bright red dot at current angle
gmt events sin_curve.txt -T${MOVIE_FRAME} -Sc0.1i -Gred -i0,1,0 -L0
gmt end
EOF
# 3. Run the movie
gmt movie main.sh -Sbpre.sh -Chd -Tsin_point.txt -Vi -D5 -Zs -Nanim01 -Fmp4
gmt movie main.sh -Sbpre.sh -Chd -Tsin_curve.txt -Vi -D50 -Zs -Nanim01 -Fmp4 \
-Lf+t"a = %3.3d"+f14p,Helvetica-Bold+jTL+o1.25/1.15
12 changes: 5 additions & 7 deletions doc/rst/source/animations/anim01.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
----------------------------------

Our first animation is not very ambitious: We wish to plot the sine
function from 0-360 and take snap shots every 10. To get a smooth curve
we must sample the function much more frequently; we settle on 10 times
more frequently than the frame spacing. We place a bright red circle at
the leading edge of the curve, and as we move forward in time (here,
angles) we dim the older circles to a dark red color. We add a label
that indicates the current angle value. Once the 36 frames are completed
function from 0-360 and take snap shots every 1.We place a bright red
circle at the leading edge of the curve, and as we move forward in time
(here, angles) we dim the older circles to a dark red color. We add a label
that indicates the current angle value. Once the 361 frames are completed
we convert them to a single mp4 file.

.. literalinclude:: /_verbatim/anim01.txt
Expand All @@ -21,5 +19,5 @@ use for the map projection, the region, the spacing around the frame,
etc. so that the final result gave a reasonable layout. Do this planning
on a single PostScript plot before running a lengthy animation script.

.. youtube:: 5m3gRhFFFLA
.. youtube:: NjSDpQ5S3FM
:width: 100%
2 changes: 1 addition & 1 deletion doc/rst/source/gmt.conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ GMT Miscellaneous Parameters
**GMT_DATA_SERVER**
Name (or URL) of a GMT data server [default is **oceania**]. Please set
to the data server closest to your location for faster data download. See
`Data Server Mirrors <https://www.generic-mapping-tools.org/mirrors/>`_
`Data Server Mirrors <https://www.generic-mapping-tools.org/mirrors/#data-server-mirrors>`_
for a list of the currently available mirrors.

**GMT_DATA_SERVER_LIMIT**
Expand Down

0 comments on commit 64a8c73

Please sign in to comment.