From 12ea18a66f4ef9c0570ce6ea27fa403a4b7371ad Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 14:10:05 +0100 Subject: [PATCH 01/14] bump to 60 minutes --- .github/workflows/build-ultraplot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index e6653b6e1..cd88b89a9 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -17,7 +17,7 @@ jobs: build-ultraplot: name: Test Python ${{ inputs.python-version }} with ${{ inputs.matplotlib-version }} runs-on: ubuntu-latest - timeout-minutes: 25 + timeout-minutes: 60 defaults: run: shell: bash -el {0} From 363551e642dd1ba217096b64c919c3f7522afbaa Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 15:31:41 +0100 Subject: [PATCH 02/14] use mpl-hash --- .github/workflows/build-ultraplot.yml | 13 +++++++++++-- pyproject.toml | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index cd88b89a9..727fe3aac 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -76,14 +76,23 @@ jobs: git fetch origin ${{ github.event.pull_request.base.sha }} git checkout ${{ github.event.pull_request.base.sha }} python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" - pytest -W ignore --mpl-generate-path=baseline --mpl-default-style="./ultraplot.yml" + pytest -W ignore \ + --mpl-generate-path=baseline \ + --mpl-generate-hash-library=baseline/comparison_hashes.json \ + --mpl-default-style="./ultraplot.yml" git checkout ${{ github.sha }} # Return to PR branch - name: Image Comparison Ultraplot run: | mkdir -p results python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" - pytest -W ignore --mpl --mpl-baseline-path=baseline --mpl-generate-summary=html --mpl-results-path=./results/ --mpl-default-style="./ultraplot.yml" --store-failed-only ultraplot/tests + pytest -W ignore \ + --mpl \ + --mpl-hash-library=baseline/comparison_hashes.json \ + --mpl-results-path=./results/ \ + --mpl-generate-summary=html \ + --mpl-default-style="./ultraplot.yml" \ + --store-failed-only ultraplot/tests # Return the html output of the comparison even if failed - name: Upload comparison failures diff --git a/pyproject.toml b/pyproject.toml index 2e0aee22b..970144625 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,3 +50,7 @@ include-package-data = true [tool.setuptools_scm] write_to = "ultraplot/_version.py" write_to_template = "__version__ = '{version}'\n" + +[tool.pytest.ini_options] +mpl-baseline-dir = "./baseline" +mpl = "hash" From 057ff6e3c0ff40f2154f2bdb6f5f606ff2514917 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Tue, 28 Oct 2025 10:37:44 -0500 Subject: [PATCH 03/14] Add test message to module docstring --- ultraplot/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ultraplot/__init__.py b/ultraplot/__init__.py index 2a2db3bd1..ed550a735 100644 --- a/ultraplot/__init__.py +++ b/ultraplot/__init__.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 """ A succinct matplotlib wrapper for making beautiful, publication-quality graphics. +test me """ # SCM versioning name = "ultraplot" From 4f1e20df36b7e07b906c73b26cfe5a1a4f119c1a Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 18:00:02 +0100 Subject: [PATCH 04/14] bump --- .github/workflows/build-ultraplot.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index 727fe3aac..38dfe3a53 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -77,9 +77,10 @@ jobs: git checkout ${{ github.event.pull_request.base.sha }} python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" pytest -W ignore \ - --mpl-generate-path=baseline \ - --mpl-generate-hash-library=baseline/comparison_hashes.json \ - --mpl-default-style="./ultraplot.yml" + --mpl-generate-path=baseline \ + --mpl-generate-hash-library=baseline/comparison_hashes.json \ + --mpl-default-style="./ultraplot.yml"\ + ultraplot/tests git checkout ${{ github.sha }} # Return to PR branch - name: Image Comparison Ultraplot From 11b5fdb8582b5d5c942f4587b2bfdebc160f4bd8 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 18:14:58 +0100 Subject: [PATCH 05/14] only generate hashes --- .github/workflows/build-ultraplot.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index 38dfe3a53..c41a7bc1b 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -77,8 +77,7 @@ jobs: git checkout ${{ github.event.pull_request.base.sha }} python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" pytest -W ignore \ - --mpl-generate-path=baseline \ - --mpl-generate-hash-library=baseline/comparison_hashes.json \ + --mpl-generate-hash-library=./baseline/comparison_hashes.json \ --mpl-default-style="./ultraplot.yml"\ ultraplot/tests git checkout ${{ github.sha }} # Return to PR branch @@ -89,11 +88,11 @@ jobs: python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" pytest -W ignore \ --mpl \ - --mpl-hash-library=baseline/comparison_hashes.json \ + --mpl-hash-library=./baseline/comparison_hashes.json \ --mpl-results-path=./results/ \ --mpl-generate-summary=html \ --mpl-default-style="./ultraplot.yml" \ - --store-failed-only ultraplot/tests + ultraplot/tests # Return the html output of the comparison even if failed - name: Upload comparison failures From f100dab10af844d410a50a8a551339c0adfdc5ab Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 19:14:17 +0100 Subject: [PATCH 06/14] sanity checks --- ultraplot/tests/test_demos.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ultraplot/tests/test_demos.py b/ultraplot/tests/test_demos.py index ebaf9a24d..846ca5b8c 100644 --- a/ultraplot/tests/test_demos.py +++ b/ultraplot/tests/test_demos.py @@ -9,6 +9,7 @@ def test_show_channels_requires_arg(): demos.show_channels() +@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_channels_basic(): """Basic invocation of show_channels returns a figure and axes of expected length.""" @@ -24,6 +25,7 @@ def test_show_channels_basic(): return fig +@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_colorspaces_default_and_options(): """show_colorspaces should create three panels (hcl/hsl/hpl).""" @@ -37,6 +39,7 @@ def test_show_colorspaces_default_and_options(): return fig +@pytest.mark.skip("sanitycheck") @pytest.mark.parametrize("demo", ["show_cmaps", "show_cycles"]) @pytest.mark.mpl_image_compare def test_show_cmaps_and_cycles_return_fig_and_axes(demo): @@ -75,6 +78,7 @@ def test__filter_colors_behavior(): assert not demos._filter_colors(hcl_endpoint, ihue=3, nhues=4, minsat=10) +@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare @pytest.mark.parametrize("nhues,minsat", [(4, 10), (8, 15)]) def test_show_colors_basic_and_titles(nhues, minsat): @@ -92,6 +96,7 @@ def test_show_colors_basic_and_titles(nhues, minsat): return fig +@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_fonts_with_existing_font(): """show_fonts should accept a real font name from the system and return a figure.""" From c1d0f1145ad4ac1b473332386ace92cb345468b3 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 20:38:40 +0100 Subject: [PATCH 07/14] debug closing command --- ultraplot/tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ultraplot/tests/conftest.py b/ultraplot/tests/conftest.py index db2482d90..d55300b62 100644 --- a/ultraplot/tests/conftest.py +++ b/ultraplot/tests/conftest.py @@ -18,6 +18,7 @@ def rng(): def close_figures_after_test(): yield uplt.close("all") + assert uplt.pyplot.get_fignums() == [], f"Open figures {uplt.pyplot.get_fignums()}" # Define command line option From ce64bde6bd947aa4640a30abb7ba04877bdcc530 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 20:42:09 +0100 Subject: [PATCH 08/14] rm hashing --- .github/workflows/build-ultraplot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index c41a7bc1b..2ec5e6b08 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -77,7 +77,7 @@ jobs: git checkout ${{ github.event.pull_request.base.sha }} python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" pytest -W ignore \ - --mpl-generate-hash-library=./baseline/comparison_hashes.json \ + --mpl-generate-path=./baseline/ \ --mpl-default-style="./ultraplot.yml"\ ultraplot/tests git checkout ${{ github.sha }} # Return to PR branch @@ -88,7 +88,7 @@ jobs: python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')" pytest -W ignore \ --mpl \ - --mpl-hash-library=./baseline/comparison_hashes.json \ + --mpl-baseline-path=./baseline/ \ --mpl-results-path=./results/ \ --mpl-generate-summary=html \ --mpl-default-style="./ultraplot.yml" \ From 1e90db646bd838c61cd78c704d6690ae91a2f64c Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 20:54:10 +0100 Subject: [PATCH 09/14] rm hashing --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 970144625..2e0aee22b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,3 @@ include-package-data = true [tool.setuptools_scm] write_to = "ultraplot/_version.py" write_to_template = "__version__ = '{version}'\n" - -[tool.pytest.ini_options] -mpl-baseline-dir = "./baseline" -mpl = "hash" From 9293cb08e9a5640e1eba1c89c7451a5e1ce7e3c4 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 21:08:06 +0100 Subject: [PATCH 10/14] sanity checks --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e9a3519f..e2e00aacb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,7 @@ jobs: uses: ./.github/workflows/build-ultraplot.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}-${{ matrix.matplotlib-version }} - cancel-in-progress: true + cancel-in-progress: false with: python-version: ${{ matrix.python-version }} matplotlib-version: ${{ matrix.matplotlib-version }} @@ -153,4 +153,3 @@ jobs: exit 1 fi fi - From 1dfe4f2f0d4e165e40fb54adea23732f37aa4307 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 28 Oct 2025 21:18:06 +0100 Subject: [PATCH 11/14] sanity checks --- .github/workflows/build-ultraplot.yml | 1 + .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index 2ec5e6b08..371ca1e4a 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -52,6 +52,7 @@ jobs: slug: Ultraplot/ultraplot compare-baseline: + name: Compare baseline Python ${{ inputs.python-version }} with ${{ inputs.matplotlib-version }} runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2e00aacb..01d9c856f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,7 @@ jobs: uses: ./.github/workflows/build-ultraplot.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}-${{ matrix.matplotlib-version }} - cancel-in-progress: false + cancel-in-progress: true with: python-version: ${{ matrix.python-version }} matplotlib-version: ${{ matrix.matplotlib-version }} From 67bc5ef0b16b6b2bb293dc3d9730c71f1e47add2 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Wed, 29 Oct 2025 10:02:31 +0100 Subject: [PATCH 12/14] aggresively clean all --- ultraplot/tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ultraplot/tests/conftest.py b/ultraplot/tests/conftest.py index d55300b62..f296ab9d1 100644 --- a/ultraplot/tests/conftest.py +++ b/ultraplot/tests/conftest.py @@ -1,6 +1,7 @@ import os, shutil, pytest, re, numpy as np, ultraplot as uplt from pathlib import Path -import warnings, logging +import warnings, logging, gc +from matplotlib._pylab_helpers import Gcf logging.getLogger("matplotlib").setLevel(logging.ERROR) SEED = 51423 @@ -19,6 +20,8 @@ def close_figures_after_test(): yield uplt.close("all") assert uplt.pyplot.get_fignums() == [], f"Open figures {uplt.pyplot.get_fignums()}" + Gcf.destroy_all() + gc.collect() # Define command line option From f238f5c2241acb28d3e5595a1c330693218546a1 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Wed, 29 Oct 2025 10:20:45 +0100 Subject: [PATCH 13/14] rm skip --- ultraplot/tests/test_demos.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ultraplot/tests/test_demos.py b/ultraplot/tests/test_demos.py index 62d225dd5..ab8300de8 100644 --- a/ultraplot/tests/test_demos.py +++ b/ultraplot/tests/test_demos.py @@ -30,7 +30,6 @@ def test_show_channels_basic(): return fig -@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_colorspaces_default_and_options(): """show_colorspaces should create three panels (hcl/hsl/hpl).""" @@ -44,7 +43,6 @@ def test_show_colorspaces_default_and_options(): return fig -@pytest.mark.skip("sanitycheck") @pytest.mark.parametrize("demo", ["show_cmaps", "show_cycles"]) @pytest.mark.mpl_image_compare def test_show_cmaps_and_cycles_return_fig_and_axes(demo): @@ -83,7 +81,6 @@ def test__filter_colors_behavior(): assert not demos._filter_colors(hcl_endpoint, ihue=3, nhues=4, minsat=10) -@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare @pytest.mark.parametrize("nhues,minsat", [(4, 10), (8, 15)]) def test_show_colors_basic_and_titles(nhues, minsat): @@ -101,7 +98,6 @@ def test_show_colors_basic_and_titles(nhues, minsat): return fig -@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_fonts_with_existing_font(): """show_fonts should accept a real font name from the system and return a figure.""" From cbd90d389976347611e2f888bc0d392a8a84ed0e Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Wed, 29 Oct 2025 11:19:31 +0100 Subject: [PATCH 14/14] final touches --- .github/workflows/build-ultraplot.yml | 4 ++-- ultraplot/__init__.py | 1 - ultraplot/tests/test_demos.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ultraplot.yml b/.github/workflows/build-ultraplot.yml index 371ca1e4a..ab19ab15c 100644 --- a/.github/workflows/build-ultraplot.yml +++ b/.github/workflows/build-ultraplot.yml @@ -15,7 +15,7 @@ env: jobs: build-ultraplot: - name: Test Python ${{ inputs.python-version }} with ${{ inputs.matplotlib-version }} + name: Test Python ${{ inputs.python-version }} with MPL ${{ inputs.matplotlib-version }} runs-on: ubuntu-latest timeout-minutes: 60 defaults: @@ -52,7 +52,7 @@ jobs: slug: Ultraplot/ultraplot compare-baseline: - name: Compare baseline Python ${{ inputs.python-version }} with ${{ inputs.matplotlib-version }} + name: Compare baseline Python ${{ inputs.python-version }} with MPL ${{ inputs.matplotlib-version }} runs-on: ubuntu-latest defaults: run: diff --git a/ultraplot/__init__.py b/ultraplot/__init__.py index ed550a735..2a2db3bd1 100644 --- a/ultraplot/__init__.py +++ b/ultraplot/__init__.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 """ A succinct matplotlib wrapper for making beautiful, publication-quality graphics. -test me """ # SCM versioning name = "ultraplot" diff --git a/ultraplot/tests/test_demos.py b/ultraplot/tests/test_demos.py index ab8300de8..f76d86ffd 100644 --- a/ultraplot/tests/test_demos.py +++ b/ultraplot/tests/test_demos.py @@ -14,7 +14,6 @@ def test_show_channels_requires_arg(): demos.show_channels() -@pytest.mark.skip("sanitycheck") @pytest.mark.mpl_image_compare def test_show_channels_basic(): """Basic invocation of show_channels returns a figure and axes of expected length."""