Skip to content

Commit

Permalink
Merge branch 'main' into shift_origin-context-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Aug 6, 2024
2 parents b9472ce + dfedf16 commit ed67dd5
Show file tree
Hide file tree
Showing 237 changed files with 6,110 additions and 3,640 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ assignees: ''
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r 'remove_version="vX.Y.Z"' pygmt` from the base of the repository
- [ ] Update warnings in `pygmt.show_versions()` as well as notes in [Common installation issues](https://www.pygmt.org/dev/install.html#not-working-transparency)
and [Testing your install]((https://www.pygmt.org/dev/install.html#testing-your-install) regarding GMT-Ghostscript incompatibility
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
- [ ] Update `CITATION.cff` and BibTeX at https://github.com/GenericMappingTools/pygmt#citing-pygmt
Expand All @@ -43,7 +46,7 @@ assignees: ''
- [ ] Manually upload the pygmt-vX.Y.Z.zip and baseline-images.zip files to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI

**After release**:
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot, but remember to pin NEP29 versions]
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot, but remember to pin SPEC0 versions]
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
- [ ] Announce the release on:
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using the following command:
**To-Do for bumping the minimum required GMT version**:

- [ ] Bump the minimum required GMT version (1 PR)
- [ ] Update `required_version` in `pygmt/clib/session.py`
- [ ] Update `required_gmt_version` in `pygmt/clib/__init__.py`
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
- [ ] Update minimum required versions in `doc/minversions.md`
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
# Check for updates to GitHub Actions on Tuesdays
interval: "weekly"
day: "tuesday"
# Allow up to 2 open pull requests at a time
Expand Down
85 changes: 42 additions & 43 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run performance benchmarks
#
# Continuous benchmarking using pytest-codspeed. Measures the execution speed
# of tests marked with @pytest.mark.benchmark decorator.
# Continuous benchmarking using pytest-codspeed. Measures the execution speed of tests
# marked with @pytest.mark.benchmark decorator.

name: Benchmarks

Expand All @@ -15,12 +15,9 @@ on:
# Run in PRs but only if the PR has the 'run/benchmark' label
pull_request:
types: [ opened, reopened, labeled, synchronize ]
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
# 'workflow_dispatch' allows CodSpeed to trigger backtest performance analysis
# in order to generate initial data.
workflow_dispatch:
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -37,59 +34,61 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0

# Install Miniconda with conda-forge dependencies
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
auto-activate-base: true
activate-environment: "" # base environment
channels: conda-forge,nodefaults
channel-priority: strict
- name: Get current week number of year
id: date
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19

# Install GMT and dependencies from conda-forge
- name: Install dependencies
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
# Preprend $CONDA/bin to $PATH so that conda's python is used over system python
echo $CONDA/bin >> $GITHUB_PATH
conda install --solver=libmamba gmt=6.5.0 python=3.12 \
numpy pandas xarray netCDF4 packaging \
geopandas pyarrow pytest pytest-mpl
python -m pip install -U pytest-codspeed setuptools
# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/[email protected]
with:
environment-name: pygmt
condarc: |
channels:
- conda-forge
- nodefaults
cache-downloads: false
cache-environment: true
# environment cache is persistent for one week.
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
create-args: >-
gmt=6.5.0
python=3.12
numpy
pandas
xarray
netCDF4
packaging
geopandas
pyarrow
pytest
pytest-codspeed
pytest-mpl
# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/[email protected]
with:
workflow: cache_data.yaml
workflow_conclusion: success
name: gmt-cache
path: .gmt

# Move downloaded files to ~/.gmt directory and list them
- name: Move and list downloaded remote files
run: |
mkdir -p ~/.gmt
mv .gmt/* ~/.gmt
# Download cached files to ~/.gmt directory and list them
gh run download --name gmt-cache --dir ~/.gmt/
# Change modification times of the two files, so GMT won't refresh it
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
ls -lhR ~/.gmt
env:
GH_TOKEN: ${{ github.token }}

# Install the package that we want to test
- name: Install the package
run: make install

# Run the benchmark tests
- name: Run benchmarks
uses: CodSpeedHQ/action@v2.2.1
uses: CodSpeedHQ/action@v3.0.0
with:
run: |
python -c "import pygmt; pygmt.show_versions()"
PYGMT_USE_EXTERNAL_DISPLAY="false" python -m pytest -r P --pyargs pygmt --codspeed
env:
GMT_LIBRARY_PATH: /usr/share/miniconda/lib/
# 'bash -el -c' is needed to use the custom shell.
# See https://github.com/CodSpeedHQ/action/issues/65.
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed"
29 changes: 17 additions & 12 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Cache GMT remote data files and upload as artifacts
#
# This workflow downloads data files needed by PyGMT tests/documentation from
# the GMT data server and uploads as workflow artifacts which can be accessed
# by other GitHub Actions workflows.
# This workflow downloads data files needed by PyGMT tests/documentation from the GMT
# data server and uploads them as workflow artifacts, which can then be accessed by other
# GitHub Actions workflows.
#
# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are
# needed urgently, maintainers can update the workflow file or the
# 'pygmt/helpers/caching.py' file to refresh the cache.
# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are needed
# urgently, maintainers can refresh the cache by one of the following methods:
#
# 1. Update this workflow file
# 2. Update the `pygmt/helpers/caching.py` file
# 3. Go to https://github.com/GenericMappingTools/pygmt/actions/workflows/cache_data.yaml
# and click the "Run workflow" button
#
name: Cache data

Expand All @@ -16,6 +20,7 @@ on:
paths:
- 'pygmt/helpers/caching.py'
- '.github/workflows/cache_data.yaml'
workflow_dispatch:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
Expand All @@ -31,14 +36,14 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.0
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand Down Expand Up @@ -75,7 +80,7 @@ jobs:
with:
name: gmt-cache
path: |
~/.gmt/cache
~/.gmt/server
~/.gmt/gmt_data_server.txt
~/.gmt/gmt_hash_server.txt
~/.gmt/cache
~/.gmt/server
~/.gmt/gmt_data_server.txt
~/.gmt/gmt_hash_server.txt
24 changes: 15 additions & 9 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Check Links
on:
# Uncomment the 'pull_request' line below to trigger the workflow in PR
# pull_request:
workflow_dispatch:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
Expand All @@ -22,38 +23,41 @@ jobs:

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

- name: Checkout the documentation
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
ref: gh-pages
path: documentation

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.9.3
uses: lycheeverse/lychee-action@v1.10.0
with:
output: /tmp/lychee-out.md
# 429: Too many requests
args: >
--accept 429
--exclude-mail
--exclude "^https://doi.org/10.5281/zenodo$"
--exclude "^https://zenodo.org/badge/DOI/$"
--exclude "^https://zenodo.org/badge/DOI/10.5281/zenodo$"
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
--exclude "^git"
--exclude "^file://"
--exclude "https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
--exclude "^https://docs.generic-mapping-tools.org/6.5/%s$"
--exclude "^https://docs.generic-mapping-tools.org/6.5/%3Cmodule-name%3E.html$"
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
--exclude "^https://hackmd.io/@pygmt"
--exclude "^https://doi.org"
--exclude "^https://www.researchgate.net/project/"
--exclude "^https://www.researchgate.net/"
--exclude "^https://test.pypi.org/simple/"
--verbose
"repository/**/*.rst"
Expand All @@ -67,7 +71,9 @@ jobs:

- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report on ${{ steps.date.outputs.date }}
content-filepath: ./lychee/out.md
run: |
cd repository/
title="Link Checker Report on ${{ steps.date.outputs.date }}"
gh issue create --title "$title" --body-file /tmp/lychee-out.md
env:
GH_TOKEN: ${{ github.token }}
34 changes: 17 additions & 17 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
- 'examples/**'
- 'README.md'
- '.github/workflows/ci_docs.yml'
workflow_dispatch:
release:
types:
- published
Expand Down Expand Up @@ -68,14 +69,18 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0

- name: Get current week number of year
id: date
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.0
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -84,17 +89,19 @@ jobs:
- nodefaults
cache-downloads: false
cache-environment: true
# environment cache is persistent for one week.
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
create-args: >-
python=3.12
gmt=6.5.0
ghostscript=10.02.1
ghostscript=10.03.1
numpy
pandas
xarray
netCDF4
packaging
contextily
geopandas
geopandas<1.0
ipython
rioxarray
build
Expand All @@ -111,21 +118,14 @@ jobs:
# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/[email protected]
with:
workflow: cache_data.yaml
workflow_conclusion: success
name: gmt-cache
path: .gmt

# Move downloaded files to ~/.gmt directory and list them
- name: Move and list downloaded remote files
run: |
mkdir -p ~/.gmt
mv .gmt/* ~/.gmt
# Download cached files to ~/.gmt directory and list them
gh run download --name gmt-cache --dir ~/.gmt/
# Change modification times of the two files, so GMT won't refresh it
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
ls -lhR ~/.gmt
env:
GH_TOKEN: ${{ github.token }}

# Install the package that we want to test
- name: Install the package
Expand All @@ -138,7 +138,7 @@ jobs:
run: make -C doc clean all

- name: Checkout the gh-pages branch
uses: actions/[email protected].1
uses: actions/[email protected].7
with:
ref: gh-pages
# Checkout to this folder instead of the current one
Expand All @@ -161,7 +161,7 @@ jobs:
# to get the right commit hash.
message="Deploy $version from $(git rev-parse --short HEAD)"
cd deploy
# Need to have this file so that Github doesn't try to run Jekyll
# Need to have this file so that GitHub doesn't try to run Jekyll
touch .nojekyll
# Delete all the files and replace with our new set
echo -e "\nRemoving old files from previous builds of ${version}:"
Expand Down
Loading

0 comments on commit ed67dd5

Please sign in to comment.