Skip to content

Commit

Permalink
Merge branch 'master' into filename-with-spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed May 9, 2021
2 parents e7d4923 + 036e2b0 commit 6a170cd
Show file tree
Hide file tree
Showing 307 changed files with 2,736 additions and 1,309 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.0
uses: conda-incubator/setup-miniconda@v2.1.1
with:
channels: conda-forge
miniconda-version: "latest"
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 @@ -26,7 +26,7 @@ jobs:
path: documentation

- name: Link Checker
uses: lycheeverse/lychee-action@v1.0.6
uses: lycheeverse/lychee-action@v1.0.8
with:
# 429: Too many requests
args: >
Expand All @@ -52,7 +52,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v2.3.2
uses: peter-evans/create-issue-from-file@v3
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
11 changes: 6 additions & 5 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

Expand All @@ -56,7 +56,7 @@ jobs:

# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.0
uses: conda-incubator/setup-miniconda@v2.1.1
with:
activate-environment: pygmt
python-version: ${{ matrix.python-version }}
Expand All @@ -66,17 +66,18 @@ jobs:
# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: |
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
conda install -c conda-forge/label/dev gmt=6.2.0rc1
conda install numpy pandas xarray netCDF4 packaging \
ipython make myst-parser \
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme=0.5.1
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
# Show installed pkg information for postmortem diagnostic
- name: List installed packages
run: conda list

# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/action-download-artifact@v2.13.0
uses: dawidd6/action-download-artifact@v2.14.0
with:
workflow: cache_data.yaml
workflow_conclusion: success
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

Expand All @@ -76,7 +76,7 @@ jobs:

# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.0
uses: conda-incubator/setup-miniconda@v2.1.1
with:
activate-environment: pygmt
python-version: ${{ matrix.python-version }}
Expand All @@ -86,7 +86,8 @@ jobs:
# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: |
conda install gmt=6.1.1 numpy=${{ matrix.numpy-version }} \
conda install -c conda-forge/label/dev gmt=6.2.0rc1
conda install numpy=${{ matrix.numpy-version }} \
pandas xarray netCDF4 packaging \
codecov coverage[toml] dvc ipython make \
pytest-cov pytest-mpl pytest>=6.0 \
Expand All @@ -98,7 +99,7 @@ jobs:

# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/action-download-artifact@v2.13.0
uses: dawidd6/action-download-artifact@v2.14.0
with:
workflow: cache_data.yaml
workflow_conclusion: success
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:

# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.3.1
uses: codecov/codecov-action@v1.5.0
with:
file: ./coverage.xml # optional
env_vars: OS,PYTHON,NUMPY
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:

# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.0
uses: conda-incubator/setup-miniconda@v2.1.1
with:
activate-environment: pygmt
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:

# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/action-download-artifact@v2.13.0
uses: dawidd6/action-download-artifact@v2.14.0
with:
workflow: cache_data.yaml
workflow_conclusion: success
Expand Down
49 changes: 36 additions & 13 deletions .github/workflows/dvc-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: Setup continuous machine learning (CML)
uses: iterative/setup-cml@v1.0.0

- name: Pull image data from cloud storage
run: dvc pull --remote upstream

# Produce the markdown diff report, which should look like:
# ## Summary of changed images
#
Expand All @@ -32,32 +35,52 @@ jobs:
# | Status | Path |
# |----------|-------------------------------------|
# | added | pygmt/tests/baseline/test_image.png |
- name: Put list of images that were added or changed into report
# | deleted | pygmt/tests/baseline/test_image2.png |
# | modified | pygmt/tests/baseline/test_image3.png |
- name: Generate the image diff report
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
id: image-diff
run: |
echo -e "## Summary of changed images\n" > report.md
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
dvc diff --show-md master HEAD >> report.md
cat report.md
- name: Pull image data from cloud storage
run: dvc pull --remote upstream

- name: Put image diff(s) into report
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
id: image-diff
run: |
# Get just the filename of the changed image from the report
awk 'NF==5 && NR>=7 {print $4}' report.md > diff_files.txt
# Get just the filename of the added and modified image from the report
awk 'NF==5 && NR>=7 && $2=="added" {print $4}' report.md > added_files.txt
awk 'NF==5 && NR>=7 && $2=="modified" {print $4}' report.md > modified_files.txt
# Append each image to the markdown report
echo -e "## Image diff(s)\n" >> report.md
echo -e "<details>\n" >> report.md
# Added images
echo -e "### Added images\n" >> report.md
while IFS= read -r line; do
echo -e "- $line \n" >> report.md
cml-publish --title $line --md "$line" >> report.md < /dev/null
done < diff_files.txt
done < added_files.txt
# Modified images
echo -e "### Modified images\n" >> report.md
# Upload new images
while IFS= read -r line; do
cml-publish --title $line --md "$line" >> modified_images_new.md < /dev/null
done < modified_files.txt
# Pull images in the master branch from cloud storage
git checkout master
dvc pull --remote upstream
# Upload old images
while IFS= read -r line; do
cml-publish --title $line --md "$line" >> modified_images_old.md < /dev/null
done < modified_files.txt
# Append image report for modified images
echo -e "| Path | Old | New |" >> report.md
echo -e "|---|---|---|" >> report.md
paste modified_files.txt modified_images_old.md modified_images_new.md -d"|" |
awk -F"|" 'function basename(file) {sub(".*/", "", file); return file} {printf("| %s | %s | %s |\n", basename($1), $2, $3)}' >> report.md
echo -e "</details>\n" >> report.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ref: ${{ github.event.client_payload.pull_request.head.ref }}

# Setup Python environment
- uses: actions/setup-python@v2.2.1
- uses: actions/setup-python@v2.2.2

# Install formatting tools
- name: Install formatting tools
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2.2.1
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
# types: [created, edited]
jobs:
slashCommandDispatch:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
# Generate token from GenericMappingTools bot
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Setup Miniconda
- name: Set up Python
uses: actions/setup-python@v2.2.1
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9

Expand Down
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Manoa.
The following people have contributed code and/or documentation to the project
(alphabetical by name) and are considered to be "PyGMT Developers":

* [Abhishek Anant](https://twitter.com/itsabhianant) | [0000-0002-5751-2010](https://orcid.org/0000-0002-5751-2010) | Unaffiliated
* [Dongdong Tian](https://seisman.info/) | [0000-0001-7967-1197](https://orcid.org/0000-0001-7967-1197) | Michigan State University
* [Jiayuan Yao](https://github.com/core-man) | [0000-0001-7036-4238](https://orcid.org/0000-0001-7036-4238) | Nanyang Technological University
* [Kathryn Materna](https://github.com/kmaterna) | [0000-0002-6687-980X](https://orcid.org/0000-0002-6687-980X) | US Geological Survey
Expand Down
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ When editing documentation, use the following standards to demonstrate the examp

1. Python arguments, such as import statements, Boolean expressions, and function
arguments should be wrapped as ``code`` by using \`\` on both sides of the code.
Example: \`\`import pygmt\`\` results in ``import pygmt``.
Examples: \`\`import pygmt\`\` results in ``import pygmt``, \`\`True\`\` results in `True`,
\`\`style="v"\`\` results in `style="v"`.
2. Literal GMT arguments should be **bold** by wrapping the arguments with \*\*
(two asterisks) on both sides. The argument description should be in *italicized*
with \* (single asterisk) on both sides.
Example: `**+l**\ *label*` results in **+l***label*.
3. Optional arguments are placed wrapped with [ ] (square brackets).
Examples: `**+l**\ *label*` results in **+l***label*, `**05m**` results in **05m**.
3. Optional arguments are wrapped with [ ] (square brackets).
4. Arguments that are mutually exclusive are separated with a | (bar) to denote "or".
5. Default arguments for parameters and configuration settings are wrapped
with [ ] (square brackers) with the prefix "Default is". Example: [Default is
**p**].

## Contributing Code

Expand Down Expand Up @@ -215,7 +219,7 @@ General guidelines for pull requests (PRs):
do.
* Each pull request should consist of a **small** and logical collection of changes.
* Larger changes should be broken down into smaller components and integrated
separately.
separately. For example, break the wrapping of aliases into multiple pull requests.
* Bug fixes should be submitted in separate PRs.
* Use underscores for all Python (*.py) files as per [PEP8](https://www.python.org/dev/peps/pep-0008/),
not hyphens. Directory names should also use underscores instead of hyphens.
Expand Down Expand Up @@ -299,6 +303,12 @@ warn us and you can make a new commit with the formatted code.
Even better, you can just write `/format` in the first line of any comment in a
Pull Request to lint the code automatically.

When wrapping a new alias, use an underscore to separate words bridged by vowels
(aeiou), such as `no_skip` and `z_only`. Do not use an underscore to separate
words bridged only by consonants, such as `distcalc`, and `crossprofile`. This
convention is not applied by the code checking tools, but the PyGMT maintainers
will comment on any pull requests as needed.

We also use [flake8](http://flake8.pycqa.org/en/latest/) and
[pylint](https://www.pylint.org/) to check the quality of the code and quickly catch
common errors.
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exclude .gitignore
exclude .pylintrc
exclude AUTHORSHIP.md
exclude CONTRIBUTING.md
exclude MAINTENANCE.md
exclude Makefile
exclude environment.yml
exclude package.json
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test:
@echo ""
@cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()"
@echo ""
cd $(TESTDIR); pytest $(PYTEST_COV_ARGS) $(PROJECT)
cd $(TESTDIR); PYGMT_USE_EXTERNAL_DISPLAY="false" pytest $(PYTEST_COV_ARGS) $(PROJECT)
cp $(TESTDIR)/coverage.xml .
cp -r $(TESTDIR)/htmlcov .
rm -r $(TESTDIR)
Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ html: api
@echo
@echo "Building HTML files."
@echo
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
# Set PYGMT_USE_EXTERNAL_DISPLAY to "false" to disable external display
PYGMT_USE_EXTERNAL_DISPLAY="false" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

Expand Down
26 changes: 26 additions & 0 deletions doc/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,32 @@ p {
max-width: 1000px;
}

/* Format parameters section similar to sphinx_rtd_theme v4.x.x (not a grid) */
html.writer-html5 .rst-content dl.field-list {
display: initial;
}

/* Add a grey box around parameters similar to sphinx_rtd_theme v4.x.x) */
.rst-content dl:not(.docutils) dl dt {
margin-bottom: 4px;
border: none;
border-left: solid 3px #ccc;
background: #f0f0f0;
color: #555;
}

.rst-content dl:not(.docutils) dt {
display: table;
margin: 6px 0;
font-size: 90%;
line-height: normal;
background: #e7f2fa;
color: #2980B9;
border-top: solid 3px #6ab0de;
padding: 6px;
position: relative;
}

/* Remove the padding from the Parameters table */
.rst-content table.field-list .field-name {
padding-left: 0px;
Expand Down
Loading

0 comments on commit 6a170cd

Please sign in to comment.