Skip to content

Commit ddebe30

Browse files
Merge branch 'master' into move-plotting-functions
2 parents 175c9ba + d4cb9ea commit ddebe30

File tree

8 files changed

+63
-47
lines changed

8 files changed

+63
-47
lines changed

.github/workflows/ci_tests.yaml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,6 @@ on:
2121
- cron: '0 0 * * *'
2222

2323
jobs:
24-
style_check:
25-
name: Style Checks
26-
runs-on: ubuntu-latest
27-
28-
steps:
29-
# Checkout current git repository
30-
- name: Checkout
31-
uses: actions/checkout@v2.3.1
32-
33-
# Setup Miniconda
34-
- name: Set up Python
35-
uses: actions/setup-python@v2
36-
with:
37-
python-version: 3.8
38-
39-
- name: Install packages
40-
run: |
41-
pip install black blackdoc docformatter flake8 pylint isort
42-
sudo apt-get install dos2unix
43-
44-
- name: Formatting check (black, blackdoc, docformatter, flake8 and isort)
45-
run: make check
46-
47-
- name: Linting (pylint)
48-
run: make lint
49-
50-
- name: Ensure files use UNIX line breaks and have 644 permission
51-
run: |
52-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix --quiet {} \;
53-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
54-
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
55-
5624
test:
5725
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
5826
runs-on: ${{ matrix.os }}

.github/workflows/style_checks.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Style Checks
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
# Schedule daily tests
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
style_check:
13+
name: Style Checks
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Checkout current git repository
18+
- name: Checkout
19+
uses: actions/checkout@v2.3.4
20+
21+
# Setup Miniconda
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.9
26+
27+
- name: Install packages
28+
run: |
29+
pip install black blackdoc docformatter flake8 pylint isort
30+
sudo apt-get install dos2unix
31+
32+
- name: Formatting check (black, blackdoc, docformatter, flake8 and isort)
33+
run: make check
34+
35+
- name: Linting (pylint)
36+
run: make lint
37+
38+
- name: Ensure files use UNIX line breaks and have 644 permission
39+
run: |
40+
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix --quiet {} \;
41+
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
42+
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ read it carefully.
3939
* [Editing the Documentation](#editing-the-documentation)
4040
- [Gallery plots](#gallery-plots)
4141
- [Tutorials](#tutorials)
42+
- [Example code standards](#example-code-standards)
4243
* [Contributing Code](#contributing-code)
4344
- [General guidelines](#general-guidelines)
4445
- [Setting up your environment](#setting-up-your-environment)
@@ -267,7 +268,7 @@ directory).
267268

268269
We use some tools:
269270

270-
- [Black](https://github.com/ambv/black)
271+
- [Black](https://github.com/psf/black)
271272
- [blackdoc](https://github.com/keewis/blackdoc)
272273
- [docformatter](https://github.com/myint/docformatter)
273274
- [isort](https://pycqa.github.io/isort/)

MAINTENANCE.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ conda and the `Makefile` to run the tests and checks.
4747

4848
### GitHub Actions
4949

50-
There are 4 configuration files located in `.github/workflows`:
50+
There are 5 configuration files located in `.github/workflows`:
5151

52-
1. `ci_tests.yaml` (Style Checks, Tests on Linux/macOS/Windows)
52+
1. `style_checks.yaml` (Code lint and style checks)
5353

54-
This is ran on every commit on the *master* and Pull Request branches.
54+
This is ran on every commit to the *master* and Pull Request branches.
55+
It is also scheduled to run daily on the *master* branch.
56+
57+
2. `ci_tests.yaml` (Tests on Linux/macOS/Windows)
58+
59+
This is ran on every commit to the *master* and Pull Request branches.
5560
It is also scheduled to run daily on the *master* branch.
5661

5762
On the *master* branch, the workflow also handles the documentation deployment:
@@ -60,18 +65,18 @@ On the *master* branch, the workflow also handles the documentation deployment:
6065
*master* branch onto the `dev` folder of the *gh-pages* branch.
6166
* Updated the `latest` documentation link to the new release.
6267

63-
2. `ci_tests_dev.yaml` (GMT Dev Tests on Linux/macOS/Windows).
68+
3. `ci_tests_dev.yaml` (GMT Dev Tests on Linux/macOS/Windows).
6469

6570
This is triggered when a PR is marked as "ready for review", or using the slash
6671
command `/test-gmt-dev`. It is also scheduled to run daily on the *master* branch.
6772

68-
3. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI)
73+
4. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI)
6974

7075
This is scheduled to run every Sunday at 12 noon.
7176
If new remote files are needed urgently, maintainers can manually uncomment
7277
the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache.
7378

74-
4. `publish-to-pypi.yml` (Publish wheels to PyPI and TestPyPI)
79+
5. `publish-to-pypi.yml` (Publish wheels to PyPI and TestPyPI)
7580

7681
This workflow is ran to publish wheels to PyPI and TestPyPI (for testing only).
7782
Archives will be pushed to TestPyPI on every commit to the *master* branch and

doc/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# intersphinx configuration
4949
intersphinx_mapping = {
5050
"python": ("https://docs.python.org/3/", None),
51-
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
52-
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
53-
"xarray": ("http://xarray.pydata.org/en/stable/", None),
51+
"numpy": ("https://numpy.org/doc/stable/", None),
52+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
53+
"xarray": ("https://xarray.pydata.org/en/stable/", None),
5454
}
5555

5656
# options for sphinx-copybutton

pygmt/clib/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ def virtualfile_from_vectors(self, *vectors):
11791179
strings = np.apply_along_axis(
11801180
func1d=" ".join, axis=0, arr=string_arrays
11811181
)
1182-
strings = np.asanyarray(a=strings, dtype=np.str)
1182+
strings = np.asanyarray(a=strings, dtype=str)
11831183
self.put_strings(
11841184
dataset, family="GMT_IS_VECTOR|GMT_IS_DUPLICATE", strings=strings
11851185
)

pygmt/tests/test_clib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def test_virtualfile_from_vectors():
432432
assert output == expected
433433

434434

435-
@pytest.mark.parametrize("dtype", [np.str, np.object])
435+
@pytest.mark.parametrize("dtype", [str, object])
436436
def test_virtualfile_from_vectors_one_string_or_object_column(dtype):
437437
"""
438438
Test passing in one column with string or object dtype into virtual file
@@ -451,7 +451,7 @@ def test_virtualfile_from_vectors_one_string_or_object_column(dtype):
451451
assert output == expected
452452

453453

454-
@pytest.mark.parametrize("dtype", [np.str, np.object])
454+
@pytest.mark.parametrize("dtype", [str, object])
455455
def test_virtualfile_from_vectors_two_string_or_object_columns(dtype):
456456
"""
457457
Test passing in two columns of string or object dtype into virtual file

pygmt/tests/test_clib_put_strings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_put_strings():
2626
)
2727
x = np.array([1, 2, 3, 4, 5], dtype=np.int32)
2828
y = np.array([6, 7, 8, 9, 10], dtype=np.int32)
29-
strings = np.array(["a", "bc", "defg", "hijklmn", "opqrst"], dtype=np.str)
29+
strings = np.array(["a", "bc", "defg", "hijklmn", "opqrst"], dtype=str)
3030
lib.put_vector(dataset, column=lib["GMT_X"], vector=x)
3131
lib.put_vector(dataset, column=lib["GMT_Y"], vector=y)
3232
lib.put_strings(
@@ -62,5 +62,5 @@ def test_put_strings_fails():
6262
lib.put_strings(
6363
dataset=None,
6464
family="GMT_IS_VECTOR|GMT_IS_DUPLICATE",
65-
strings=np.empty(shape=(3,), dtype=np.str),
65+
strings=np.empty(shape=(3,), dtype=str),
6666
)

0 commit comments

Comments
 (0)