From 3fdfb565f226c85a122bc8dd28e5580b9b57d911 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 14 May 2026 12:13:19 +0800 Subject: [PATCH 1/3] Figure.pygmtlogo: Parameterize existing tests --- ...t_pygmtlogo_design_circle-horizontal.png.dvc | 5 +++++ ...est_pygmtlogo_design_circle-vertical.png.dvc | 5 +++++ ...> test_pygmtlogo_no_wordmark_circle.png.dvc} | 2 +- pygmt/tests/test_pygmtlogo.py | 17 ++++++++++------- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 pygmt/tests/baseline/test_pygmtlogo_design_circle-horizontal.png.dvc create mode 100644 pygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png.dvc rename pygmt/tests/baseline/{test_pygmtlogo_circle_no_wordmark.png.dvc => test_pygmtlogo_no_wordmark_circle.png.dvc} (61%) diff --git a/pygmt/tests/baseline/test_pygmtlogo_design_circle-horizontal.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_design_circle-horizontal.png.dvc new file mode 100644 index 00000000000..55cb442316c --- /dev/null +++ b/pygmt/tests/baseline/test_pygmtlogo_design_circle-horizontal.png.dvc @@ -0,0 +1,5 @@ +outs: +- md5: 8924c7d80afcc92df4e77e6856b553a4 + size: 336254 + hash: md5 + path: test_pygmtlogo_design_circle-horizontal.png diff --git a/pygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png.dvc new file mode 100644 index 00000000000..ec88138185f --- /dev/null +++ b/pygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png.dvc @@ -0,0 +1,5 @@ +outs: +- md5: 5ee82660f20bc8424f3051af4f9fb9ac + size: 173671 + hash: md5 + path: test_pygmtlogo_design_circle-vertical.png diff --git a/pygmt/tests/baseline/test_pygmtlogo_circle_no_wordmark.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc similarity index 61% rename from pygmt/tests/baseline/test_pygmtlogo_circle_no_wordmark.png.dvc rename to pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc index ad21905884e..05507c48df6 100644 --- a/pygmt/tests/baseline/test_pygmtlogo_circle_no_wordmark.png.dvc +++ b/pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc @@ -2,4 +2,4 @@ outs: - md5: fdc90d2867bcbc096bcf5a9303d15ddf size: 31962 hash: md5 - path: test_pygmtlogo_circle_no_wordmark.png + path: test_pygmtlogo_no_wordmark_circle.png diff --git a/pygmt/tests/test_pygmtlogo.py b/pygmt/tests/test_pygmtlogo.py index 4db0dc05b84..5836887e9cb 100644 --- a/pygmt/tests/test_pygmtlogo.py +++ b/pygmt/tests/test_pygmtlogo.py @@ -10,23 +10,25 @@ @pytest.mark.mpl_image_compare(savefig_kwargs={"dpi": 600}) @pytest.mark.parametrize("wordmark", ["horizontal", "vertical"]) -def test_pygmtlogo_circle_design(wordmark): +@pytest.mark.parametrize("shape", ["circle"]) +def test_pygmtlogo_design(shape, wordmark): """ - Test the design details of the PyGMT circular logo, with a wordmark. + Test the design details of the PyGMT logo with a wordmark. This is a regression test to ensure that the design of the logo does not change unintentionally. The debugging lines (gridlines and circles) are helpful for implementing the logo, but they are not included in the final logo design. """ - fig = _create_logo(debug=True, wordmark=wordmark) + fig = _create_logo(debug=True, shape=shape, wordmark=wordmark) return fig @pytest.mark.mpl_image_compare -def test_pygmtlogo_circle_no_wordmark(): +@pytest.mark.parametrize("shape", ["circle"]) +def test_pygmtlogo_no_wordmark(shape): """ - Test the PyGMT circular logo without the wordmark, including both light/dark themes, - and colored/black-and-white versions. + Test the PyGMT logo without the wordmark, including both light/dark themes, and + colored/black-and-white versions. """ fig = Figure() fig.basemap( @@ -41,8 +43,9 @@ def test_pygmtlogo_circle_no_wordmark(): ((3.5, 1.0), "dark", False), ]: fig.pygmtlogo( - position=Position((x, y), anchor="CM", cstype="mapcoords"), + position=Position((x, y), anchor="MC", cstype="mapcoords"), theme=theme, color=color, + shape=shape, ) return fig From b29bdc991fba20a4b111c102aafb1dbcc644638d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 14 May 2026 12:57:35 +0800 Subject: [PATCH 2/3] Remove two dvc files --- .../baseline/test_pygmtlogo_circle_design_horizontal.png.dvc | 5 ----- .../baseline/test_pygmtlogo_circle_design_vertical.png.dvc | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc delete mode 100644 pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc diff --git a/pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc deleted file mode 100644 index 3648ff8045d..00000000000 --- a/pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc +++ /dev/null @@ -1,5 +0,0 @@ -outs: -- md5: de3f281a09815faff7fed339c1635bc5 - size: 336254 - hash: md5 - path: test_pygmtlogo_circle_design_horizontal.png diff --git a/pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc deleted file mode 100644 index dc0b53a0cd7..00000000000 --- a/pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc +++ /dev/null @@ -1,5 +0,0 @@ -outs: -- md5: dd09fa24c575eabac7659dc49f313f5f - size: 173671 - hash: md5 - path: test_pygmtlogo_circle_design_vertical.png From b4e1e38e6f36613550906330d777fdbacacde4f6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 14 May 2026 13:02:20 +0800 Subject: [PATCH 3/3] Rename test_pygmtlogo_no_wordmark to test_pygmtlogo_wordmark_none --- ...rcle.png.dvc => test_pygmtlogo_wordmark_none_circle.png.dvc} | 2 +- pygmt/tests/test_pygmtlogo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename pygmt/tests/baseline/{test_pygmtlogo_no_wordmark_circle.png.dvc => test_pygmtlogo_wordmark_none_circle.png.dvc} (60%) diff --git a/pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc b/pygmt/tests/baseline/test_pygmtlogo_wordmark_none_circle.png.dvc similarity index 60% rename from pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc rename to pygmt/tests/baseline/test_pygmtlogo_wordmark_none_circle.png.dvc index 05507c48df6..eb9140b19c1 100644 --- a/pygmt/tests/baseline/test_pygmtlogo_no_wordmark_circle.png.dvc +++ b/pygmt/tests/baseline/test_pygmtlogo_wordmark_none_circle.png.dvc @@ -2,4 +2,4 @@ outs: - md5: fdc90d2867bcbc096bcf5a9303d15ddf size: 31962 hash: md5 - path: test_pygmtlogo_no_wordmark_circle.png + path: test_pygmtlogo_wordmark_none_circle.png diff --git a/pygmt/tests/test_pygmtlogo.py b/pygmt/tests/test_pygmtlogo.py index 5836887e9cb..6280a6573b1 100644 --- a/pygmt/tests/test_pygmtlogo.py +++ b/pygmt/tests/test_pygmtlogo.py @@ -25,7 +25,7 @@ def test_pygmtlogo_design(shape, wordmark): @pytest.mark.mpl_image_compare @pytest.mark.parametrize("shape", ["circle"]) -def test_pygmtlogo_no_wordmark(shape): +def test_pygmtlogo_wordmark_none(shape): """ Test the PyGMT logo without the wordmark, including both light/dark themes, and colored/black-and-white versions.