Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Figure.hlines for plotting horizontal lines #923

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7ed3b49
Add new modules to plot horizontal and vertical lines
michaelgrund Feb 17, 2021
096b9de
added further content
michaelgrund Feb 17, 2021
92fa9c0
added some first tests
michaelgrund Feb 17, 2021
975b305
some formatting
michaelgrund Feb 17, 2021
f25a89c
corrected typo
michaelgrund Feb 17, 2021
3cee081
Merge branch 'master' into hlines-module
michaelgrund Feb 18, 2021
a0c29fc
Merge branch 'master' into hlines-module
michaelgrund Feb 20, 2021
51dcb6a
Merge branch 'master' into hlines-module
michaelgrund Feb 20, 2021
4fdc984
Merge branch 'master' into hlines-module
michaelgrund Feb 23, 2021
154d05e
Merge branch 'master' into hlines-module
michaelgrund Apr 3, 2021
ddd04b4
Merge branch 'master' into hlines-module
michaelgrund Apr 5, 2021
d0bc35c
moved gallery example to new subfolder /lines
michaelgrund Apr 7, 2021
450d8de
Merge branch 'master' into hlines-module
michaelgrund Apr 7, 2021
f75fbe1
disable pylint warnings
michaelgrund Apr 7, 2021
a375a77
replace hyphen by underscore in gallery example file name
michaelgrund Apr 7, 2021
71113dd
disable pylint warnings
michaelgrund Apr 7, 2021
1438d43
formatting
michaelgrund Apr 7, 2021
e3a564e
Merge branch 'master' into hlines-module
michaelgrund Apr 9, 2021
d6a8fa5
Merge branch 'master' into hlines-module
michaelgrund Apr 19, 2021
ff13180
Merge branch 'master' into hlines-module
michaelgrund Apr 21, 2021
1881e95
Merge branch 'master' into hlines-module
michaelgrund Apr 22, 2021
7222e9b
Merge branch 'main' into hlines-module
michaelgrund Aug 10, 2021
65eb85d
update hlines module
michaelgrund Aug 10, 2021
2353587
Merge branch 'hlines-module' of https://github.com/GenericMappingTool…
michaelgrund Aug 10, 2021
49008ed
formatting
michaelgrund Aug 10, 2021
457bf72
adjust docstring
michaelgrund Aug 10, 2021
f2c84a7
adjust priliminary tests
michaelgrund Aug 10, 2021
50dccf9
Merge branch 'main' into hlines-module
michaelgrund Aug 11, 2021
e7726c0
update
michaelgrund Aug 11, 2021
60d6e55
Merge branch 'hlines-module' of https://github.com/GenericMappingTool…
michaelgrund Aug 11, 2021
46f8702
formatting
michaelgrund Aug 11, 2021
5648778
Merge branch 'main' into hlines-module
michaelgrund Aug 17, 2021
d553e28
Merge branch 'main' into hlines-module
michaelgrund Aug 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge branch 'master' into hlines-module
  • Loading branch information
michaelgrund committed Apr 3, 2021
commit 154d05e1d0ff4ce209f44bc8540e0e612d45add2
14 changes: 0 additions & 14 deletions .codecov.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .dvc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/config.local
/tmp
/cache
4 changes: 4 additions & 0 deletions .dvc/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[core]
remote = upstream
['remote "upstream"']
url = https://dagshub.com/GenericMappingTools/pygmt.dvc
3 changes: 3 additions & 0 deletions .dvcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add patterns of files dvc should ignore, which could improve
# the performance. Learn more at
# https://dvc.org/doc/user-guide/dvcignore
27 changes: 19 additions & 8 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
---
name: PyGMT release checklist
about: Checklist for a new PyGMT release.
title: Release PyGMT x.x.x
title: Release PyGMT vX.Y.Z
labels: maintenance
assignees: ''

---

**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/0.x.x)
**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/?)
**Scheduled Date**: YYYY/MM/DD
**Pull request due date**: YYYY/MM/DD

**Priority PRs/issues to complete prior to release**
- [ ] Wrap X ()
- [ ] Wrap Y ()

**Before release**:
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
- [ ] Update Changelog
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
- [ ] Update citation information https://github.com/GenericMappingTools/pygmt#citing-pygmt
- [ ] 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 information https://github.com/GenericMappingTools/pygmt#citing-pygmt
- [ ] Add the documentation link https://github.com/GenericMappingTools/pygmt#documentation-for-other-versions
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-python-and-gmt-versions
- [ ] Copy draft changelog from Release Drafter and edit it to look nice

**Release**:
- [ ] Go to [GitHub Release](https://github.com/GenericMappingTools/pygmt/releases) and make a release, this will automatically create a tag too
- [ ] Manually upload the pygmt-vX.Y.Z.zip file to https://zenodo.org/deposit, make sure you file it under the correct reserved DOI
- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
- [ ] Edit the draft release notes with the finalized changelog
- [ ] Set the tag version and release title to vX.Y.Z
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too
- [ ] Manually upload the pygmt-vX.Y.Z.zip file 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) [Usually done automatically by conda-forge's bot]
Expand All @@ -27,7 +38,7 @@ assignees: ''
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/)
- [ ] [Major/Minor releases only] GMT [website](https://github.com/GenericMappingTools/website) (News)
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools)

- [ ] [Twitter](https://twitter.com/gmt_dev)
---

- [ ] Party :tada: (don't tick before all other checkboxes are ticked!)
19 changes: 19 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
codecov:
notify:
require_ci_to_pass: no

coverage:
status:
project:
default:
target: auto # increase overall coverage on each pull request
threshold: 0.25% # Allow the coverage to drop by X%
if_not_found: success
if_ci_failed: failure
patch:
default:
target: 90% # >=90% of new changes should be tested
if_not_found: success
if_ci_failed: failure

comment: off
13 changes: 9 additions & 4 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
version-resolver:
minor:
labels:
- 'feature'
default: patch
categories:
- title: 'New Features'
label: 'feature'
Expand All @@ -18,9 +23,9 @@ exclude-labels:
category-template: '### $TITLE'
change-template: '* $TITLE ([#$NUMBER]($URL))'
template: |
## Release v$NEXT_PATCH_VERSION (20YY/MM/DD)
## Release v$RESOLVED_VERSION (20YY/MM/DD)

[![Digital Object Identifier for PyGMT v$NEXT_PATCH_VERSION](https://zenodo.org/badge/DOI/10.5281/zenodo.3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
[![Digital Object Identifier for PyGMT v$RESOLVED_VERSION](https://zenodo.org/badge/DOI/10.5281/zenodo.3781524.svg)](https://doi.org/10.5281/zenodo.3781524)

### Highlights

Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,39 @@ jobs:
gmt_cache:
name: Cache GMT artifacts
runs-on: macOS-latest
defaults:
run:
shell: bash -l {0}

steps:
# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.0.1
uses: conda-incubator/setup-miniconda@v2.1.0
with:
channels: conda-forge
miniconda-version: "latest"

# Install GMT
- name: Install GMT
shell: bash -l {0}
run: conda install -c conda-forge gmt=6.1.1

# Download remote files
- name: Download remote data
shell: bash -l {0}
run: |
gmt which -Ga @earth_relief_10m_p @earth_relief_10m_g \
@earth_relief_30m_p @earth_relief_30m_g \
@earth_relief_01d_p @earth_relief_01d_g \
@earth_relief_05m_p @earth_relief_05m_g
# Download one tile of the 03s srtm data.
# @N35E135.earth_relief_03s_g.nc is for internal use only.
# The naming scheme may change.
# DO NOT USE IT IN SCRIPTS.
gmt which -Ga @N35E135.earth_relief_03s_g.nc
# @srtm_tiles.nc is needed for 03s and 01s relief data
gmt which -Ga @srtm_tiles.nc
gmt which -Ga @ridge.txt @Table_5_11.txt @test.dat.nc \
@tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz \
@usgs_quakes_22.txt
@usgs_quakes_22.txt @fractures_06.txt

# Upload the downloaded files as artifacts to GitHub
- name: Upload artifacts to GitHub
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ jobs:
path: documentation

- name: Link Checker
uses: lycheeverse/[email protected].4
uses: lycheeverse/[email protected].6
with:
# 429: Too many requests
args: >
--accept 429
--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://www.generic-mapping-tools.org/_static/gmt-logo.png/$"
Expand All @@ -40,6 +42,7 @@ jobs:
--exclude "^git"
--exclude "^file:https://"
--exclude "^https://docs.generic-mapping-tools.org/latest/%s$"
--exclude "https://hackmd.io/@pygmt"
--verbose
"repository/**/*.rst"
"repository/**/*.md"
Expand Down
164 changes: 164 additions & 0 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# This workflow installs PyGMT, builds and deploys documentation

name: Docs

on:
push:
branches: [ master ]
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- 'pygmt/tests/**'
- '*.md'
- '*.json'
- 'LICENSE.txt'
- '.gitignore'
- '.pylintrc'
release:
types:
- published

jobs:
docs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest, macOS-latest, windows-latest]
# Is it a draft Pull Request (true or false)?
isDraft:
- ${{ github.event.pull_request.draft }}
# Only run one job (Ubuntu + Python 3.9) for draft PRs
exclude:
- os: macOS-latest
isDraft: true
- os: windows-latest
isDraft: true
defaults:
run:
shell: bash -l {0}

steps:
# Cancel previous runs that are not completed
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
# fecth all history so that setuptools-scm works
fetch-depth: 0

# Setup Miniconda
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
activate-environment: pygmt
python-version: ${{ matrix.python-version }}
channels: conda-forge
miniconda-version: "latest"

# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: |
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
ipython make myst-parser \
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme=0.5.1

# 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/[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
# Change modification times of the two files, so GMT won't refresh it
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
ls -lhR ~/.gmt

# Install the package that we want to test
- name: Install the package
run: |
python setup.py sdist --formats=zip
pip install dist/*

# Build the documentation
- name: Build the documentation
run: make -C doc clean all

- name: Checkout the gh-pages branch
uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
with:
ref: gh-pages
# Checkout to this folder instead of the current one
path: deploy
# Download the entire history
fetch-depth: 0
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')

- name: Push the built HTML to gh-pages
run: |
# Detect if this is a release or from the master branch
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
# Get the tag name without the "refs/tags/" part
version="${GITHUB_REF#refs/*/}"
else
version=dev
fi
echo "Deploying version: $version"
# Make the new commit message. Needs to happen before cd into deploy
# 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
touch .nojekyll
# Delete all the files and replace with our new set
echo -e "\nRemoving old files from previous builds of ${version}:"
rm -rvf ${version}
echo -e "\nCopying HTML files to ${version}:"
cp -Rvf ../doc/_build/html/ ${version}/
# If this is a new release, update the link from /latest to it
if [[ "${version}" != "dev" ]]; then
echo -e "\nSetup link from ${version} to 'latest'."
rm -f latest
ln -sf ${version} latest
fi
# Stage the commit
git add -A .
echo -e "\nChanges to be applied:"
git status
# Configure git to be the GitHub Actions account
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# If this is a dev build and the last commit was from a dev build
# (detect if "dev" was in the previous commit message), reuse the
# same commit
if [[ "${version}" == "dev" && `git log -1 --format='%s'` == *"dev"* ]]; then
echo -e "\nAmending last commit:"
git commit --amend --reset-author -m "$message"
else
echo -e "\nMaking a new commit:"
git commit -m "$message"
fi
# Make the push quiet just in case there is anything that could leak
# sensitive information.
echo -e "\nPushing changes to gh-pages."
git push -fq origin gh-pages 2>&1 >/dev/null
echo -e "\nFinished uploading generated files."
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.