Skip to content

Commit e5f0af1

Browse files
committed
Merge branch 'pygmtlogo-parameterize' into pygmtlogo-font
2 parents f6d08a0 + b4e1e38 commit e5f0af1

6 files changed

Lines changed: 27 additions & 17 deletions

pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc

Lines changed: 0 additions & 5 deletions
This file was deleted.

pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc renamed to pygmt/tests/baseline/test_pygmtlogo_design_circle-horizontal.png.dvc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ outs:
22
- md5: 44a9a200fbac4c868b69cb1c13e6dfc5
33
size: 320394
44
hash: md5
5-
path: test_pygmtlogo_circle_design_horizontal.png
5+
path: test_pygmtlogo_design_circle-horizontal.png
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 5ee82660f20bc8424f3051af4f9fb9ac
3+
size: 173671
4+
hash: md5
5+
path: test_pygmtlogo_design_circle-vertical.png
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 9715eb13bec45201818d701970a529c8
3+
size: 63949
4+
hash: md5
5+
path: test_pygmtlogo_wordmark_horizontal_circle.png

pygmt/tests/baseline/test_pygmtlogo_circle_no_wordmark.png.dvc renamed to pygmt/tests/baseline/test_pygmtlogo_wordmark_none_circle.png.dvc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ outs:
22
- md5: fdc90d2867bcbc096bcf5a9303d15ddf
33
size: 31962
44
hash: md5
5-
path: test_pygmtlogo_circle_no_wordmark.png
5+
path: test_pygmtlogo_wordmark_none_circle.png

pygmt/tests/test_pygmtlogo.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,25 @@
1010

1111
@pytest.mark.mpl_image_compare(savefig_kwargs={"dpi": 600})
1212
@pytest.mark.parametrize("wordmark", ["horizontal", "vertical"])
13-
def test_pygmtlogo_circle_design(wordmark):
13+
@pytest.mark.parametrize("shape", ["circle"])
14+
def test_pygmtlogo_design(shape, wordmark):
1415
"""
15-
Test the design details of the PyGMT circular logo, with a wordmark.
16+
Test the design details of the PyGMT logo with a wordmark.
1617
1718
This is a regression test to ensure that the design of the logo does not change
1819
unintentionally. The debugging lines (gridlines and circles) are helpful for
1920
implementing the logo, but they are not included in the final logo design.
2021
"""
21-
fig = _create_logo(debug=True, wordmark=wordmark)
22+
fig = _create_logo(debug=True, shape=shape, wordmark=wordmark)
2223
return fig
2324

2425

2526
@pytest.mark.mpl_image_compare
26-
def test_pygmtlogo_circle_no_wordmark():
27+
@pytest.mark.parametrize("shape", ["circle"])
28+
def test_pygmtlogo_wordmark_none(shape):
2729
"""
28-
Test the PyGMT circular logo without the wordmark, including both light/dark themes,
29-
and colored/black-and-white versions.
30+
Test the PyGMT logo without the wordmark, including both light/dark themes, and
31+
colored/black-and-white versions.
3032
"""
3133
fig = Figure()
3234
fig.basemap(
@@ -41,18 +43,20 @@ def test_pygmtlogo_circle_no_wordmark():
4143
((3.5, 1.0), "dark", False),
4244
]:
4345
fig.pygmtlogo(
44-
position=Position((x, y), anchor="CM", cstype="mapcoords"),
46+
position=Position((x, y), anchor="MC", cstype="mapcoords"),
4547
theme=theme,
4648
color=color,
49+
shape=shape,
4750
)
4851
return fig
4952

5053

5154
@pytest.mark.mpl_image_compare
52-
def test_pygmtlogo_circle_horizontal_wordmark():
55+
@pytest.mark.parametrize("shape", ["circle"])
56+
def test_pygmtlogo_wordmark_horizontal(shape):
5357
"""
54-
Test the PyGMT circular logo with a horizontal wordmark, including both light/dark
55-
themes, and colored/black-and-white versions.
58+
Test the PyGMT logo with a horizontal wordmark, including both light/dark themes,
59+
and colored/black-and-white versions.
5660
"""
5761
fig = Figure()
5862
fig.basemap(
@@ -70,6 +74,7 @@ def test_pygmtlogo_circle_horizontal_wordmark():
7074
position=Position((x, y), anchor="ML", cstype="mapcoords"),
7175
theme=theme,
7276
color=color,
77+
shape=shape,
7378
wordmark="horizontal",
7479
)
7580
return fig

0 commit comments

Comments
 (0)