-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into shift_origin-context-manager
- Loading branch information
Showing
237 changed files
with
6,110 additions
and
3,640 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
@@ -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 }} | ||
|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
@@ -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' | ||
|
@@ -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: | | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -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" | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ on: | |
- 'examples/**' | ||
- 'README.md' | ||
- '.github/workflows/ci_docs.yml' | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
@@ -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: | | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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}:" | ||
|
Oops, something went wrong.