-
Notifications
You must be signed in to change notification settings - Fork 225
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 add-tutorial-meca
- Loading branch information
Showing
34 changed files
with
406 additions
and
290 deletions.
There are no files selected for viewing
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,39 +34,49 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
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 | ||
|
||
# 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 | ||
- 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/[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 | ||
pytest-rerunfailures | ||
pytest-xdist | ||
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
run: | | ||
gh run download -n gmt-cache -D gmt-cache | ||
# Move downloaded files to ~/.gmt directory and list them | ||
mkdir -p ~/.gmt | ||
mv gmt-cache/* ~/.gmt | ||
rmdir gmt-cache | ||
# 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 | ||
|
@@ -84,8 +91,6 @@ jobs: | |
- name: Run benchmarks | ||
uses: CodSpeedHQ/[email protected] | ||
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
with: | ||
# fetch all history so that setuptools-scm works | ||
fetch-depth: 0 | ||
|
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 |
---|---|---|
|
@@ -23,12 +23,12 @@ jobs: | |
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
with: | ||
path: repository | ||
|
||
- name: Checkout the documentation | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
with: | ||
ref: gh-pages | ||
path: documentation | ||
|
@@ -71,5 +71,5 @@ jobs: | |
run: | | ||
title="Link Checker Report on ${{ steps.date.outputs.date }}" | ||
gh issue create --title "$title" --body-file ./lychee/out.md | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
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 |
---|---|---|
|
@@ -69,11 +69,15 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
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/[email protected] | ||
|
@@ -85,6 +89,8 @@ 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 | ||
|
@@ -113,11 +119,8 @@ jobs: | |
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
run: | | ||
gh run download -n gmt-cache -D gmt-cache | ||
# Move downloaded files to ~/.gmt directory and list them | ||
mkdir -p ~/.gmt | ||
mv gmt-cache/* ~/.gmt | ||
rmdir gmt-cache | ||
# 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 | ||
|
@@ -135,7 +138,7 @@ jobs: | |
run: make -C doc clean all | ||
|
||
- name: Checkout the gh-pages branch | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
with: | ||
ref: gh-pages | ||
# Checkout to this folder instead of the current one | ||
|
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 |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
with: | ||
# fetch all history so that setuptools-scm works | ||
fetch-depth: 0 | ||
|
@@ -72,11 +72,8 @@ jobs: | |
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
run: | | ||
gh run download -n gmt-cache -D gmt-cache | ||
# Move downloaded files to ~/.gmt directory and list them | ||
mkdir -p ~/.gmt | ||
mv gmt-cache/* ~/.gmt | ||
rmdir gmt-cache | ||
# 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 | ||
|
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 |
---|---|---|
|
@@ -49,6 +49,8 @@ jobs: | |
test: | ||
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} / NumPy ${{ matrix.numpy-version }} | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
id-token: write # This is required for requesting OIDC token for codecov | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -92,11 +94,15 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
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/[email protected] | ||
|
@@ -108,6 +114,8 @@ 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=${{ matrix.python-version }}${{ matrix.optional-packages }} | ||
gmt=6.5.0 | ||
|
@@ -125,15 +133,14 @@ jobs: | |
pytest-cov | ||
pytest-doctestplus | ||
pytest-mpl | ||
pytest-rerunfailures | ||
pytest-xdist | ||
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
run: | | ||
gh run download -n gmt-cache -D gmt-cache | ||
# Move downloaded files to ~/.gmt directory and list them | ||
mkdir -p ~/.gmt | ||
mv gmt-cache/* ~/.gmt | ||
rmdir gmt-cache | ||
# Download 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 | ||
|
@@ -155,17 +162,17 @@ jobs: | |
# Upload diff images on test failure | ||
- name: Upload diff images if any test fails | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ failure() }} | ||
if: failure() | ||
with: | ||
name: artifact-${{ runner.os }}-${{ matrix.python-version }} | ||
path: tmp-test-dir-with-unique-name | ||
|
||
# Upload coverage to Codecov | ||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
uses: codecov/[email protected] | ||
if: success() || failure() | ||
with: | ||
use_oidc: true | ||
file: ./coverage.xml # optional | ||
env_vars: OS,PYTHON,NUMPY | ||
fail_ci_if_error: false | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_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 |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, macos-14, windows-2022] | ||
os: [ubuntu-24.04, macos-14, windows-2022] | ||
gmt_git_ref: [master] | ||
timeout-minutes: 30 | ||
defaults: | ||
|
@@ -47,11 +47,15 @@ jobs: | |
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected].4 | ||
uses: actions/[email protected].5 | ||
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/[email protected] | ||
|
@@ -63,6 +67,8 @@ 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 | ||
cmake | ||
|
@@ -120,9 +126,9 @@ jobs: | |
run: | | ||
python -m pip install --pre --prefer-binary \ | ||
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \ | ||
numpy pandas xarray netCDF4 packaging \ | ||
'numpy<2' pandas xarray netCDF4 packaging \ | ||
build contextily dvc geopandas ipython pyarrow rioxarray \ | ||
'pytest>=6.0' pytest-cov pytest-doctestplus pytest-mpl \ | ||
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures pytest-xdist\ | ||
sphinx-gallery | ||
# Show installed pkg information for postmortem diagnostic | ||
|
@@ -136,11 +142,8 @@ jobs: | |
# Download cached remote files (artifacts) from GitHub | ||
- name: Download remote data from GitHub | ||
run: | | ||
gh run download -n gmt-cache -D gmt-cache | ||
# Move downloaded files to ~/.gmt directory and list them | ||
mkdir -p ~/.gmt | ||
mv gmt-cache/* ~/.gmt | ||
rmdir gmt-cache | ||
# 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 | ||
|
Oops, something went wrong.