From 1e083520429ba80ea91c8ef39fc68fd828cf4328 Mon Sep 17 00:00:00 2001 From: jprestop Date: Mon, 6 Jul 2026 17:55:10 -0600 Subject: [PATCH 1/9] Per METplus#3247, adding automated link checking in conjunction with new repo dtcenter/metplus-action-linkcheck --- .github/workflows/linkcheck_pull_request.yml | 15 ++++++++++++ .github/workflows/linkcheck_scheduled.yml | 15 ++++++++++++ docs/conf.py | 24 +++++++++++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linkcheck_pull_request.yml create mode 100644 .github/workflows/linkcheck_scheduled.yml diff --git a/.github/workflows/linkcheck_pull_request.yml b/.github/workflows/linkcheck_pull_request.yml new file mode 100644 index 00000000..87639a3e --- /dev/null +++ b/.github/workflows/linkcheck_pull_request.yml @@ -0,0 +1,15 @@ +name: linkcheck-pr +on: + pull_request: + paths: + - 'docs/**' + +jobs: + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtcenter/metplus-action-linkcheck@v1 + with: + fail-on-broken-links: 'true' + upload-artifact: 'true' \ No newline at end of file diff --git a/.github/workflows/linkcheck_scheduled.yml b/.github/workflows/linkcheck_scheduled.yml new file mode 100644 index 00000000..7d686935 --- /dev/null +++ b/.github/workflows/linkcheck_scheduled.yml @@ -0,0 +1,15 @@ +name: linkcheck-scheduled +on: + schedule: + - cron: '0 6 * * 1' + workflow_dispatch: {} + +jobs: + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtcenter/metplus-action-linkcheck@v1 + with: + fail-on-broken-links: 'true' + \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 3da31ba3..4447ff62 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -97,7 +97,29 @@ numfig_format = { 'figure': 'Figure %s', } - + +# -- linkcheck builder configuration ---------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder + +linkcheck_timeout = 10 +linkcheck_retries = 2 +linkcheck_workers = 8 + +linkcheck_ignore = [ + # add regex patterns for URLs that should be skipped, e.g.: + # r'https://dtcenter\.org/.*', # if this site blocks automated requests + # r'https://matplotlib\.org/.*', # occasionally rate-limits automated clients + # r'https://scitools\.org\.uk/cartopy/.*', # occasionally slow + # r'https://doi\.org/.*', # DOI redirectors often 403 non-browser requests +] + +linkcheck_allowed_redirects = { + # map of regex -> regex for redirects that are fine to follow +} + +linkcheck_anchors = True +linkcheck_anchors_ignore = ['^!'] + # -- Export variables -------------------------------------------------------- rst_epilog = """ From 036d049f8bbe5a5b09835c79daae82a25da0a12f Mon Sep 17 00:00:00 2001 From: jprestop Date: Mon, 6 Jul 2026 18:23:01 -0600 Subject: [PATCH 2/9] Resolving error --- .github/workflows/linkcheck_scheduled.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linkcheck_scheduled.yml b/.github/workflows/linkcheck_scheduled.yml index 7d686935..9eb840b9 100644 --- a/.github/workflows/linkcheck_scheduled.yml +++ b/.github/workflows/linkcheck_scheduled.yml @@ -11,5 +11,4 @@ jobs: - uses: actions/checkout@v4 - uses: dtcenter/metplus-action-linkcheck@v1 with: - fail-on-broken-links: 'true' - \ No newline at end of file + fail-on-broken-links: 'true' \ No newline at end of file From 85a56899244a9653eb56469552a78ad5d64da75d Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 7 Jul 2026 13:17:45 -0600 Subject: [PATCH 3/9] Per METplus#3247, add workflow dispatch to the linkcheck PR workflow too --- .github/workflows/linkcheck_pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck_pull_request.yml b/.github/workflows/linkcheck_pull_request.yml index 87639a3e..481aab60 100644 --- a/.github/workflows/linkcheck_pull_request.yml +++ b/.github/workflows/linkcheck_pull_request.yml @@ -3,7 +3,8 @@ on: pull_request: paths: - 'docs/**' - + workflow_dispatch: {} + jobs: linkcheck: runs-on: ubuntu-latest From e3b868c2a10ec1c3189e3249846944ae04864b18 Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 7 Jul 2026 15:09:29 -0600 Subject: [PATCH 4/9] Per METplus#3247, combine workflows into one file --- .../{linkcheck_pull_request.yml => linkcheck.yml} | 6 ++++-- .github/workflows/linkcheck_scheduled.yml | 14 -------------- 2 files changed, 4 insertions(+), 16 deletions(-) rename .github/workflows/{linkcheck_pull_request.yml => linkcheck.yml} (85%) delete mode 100644 .github/workflows/linkcheck_scheduled.yml diff --git a/.github/workflows/linkcheck_pull_request.yml b/.github/workflows/linkcheck.yml similarity index 85% rename from .github/workflows/linkcheck_pull_request.yml rename to .github/workflows/linkcheck.yml index 481aab60..40838861 100644 --- a/.github/workflows/linkcheck_pull_request.yml +++ b/.github/workflows/linkcheck.yml @@ -1,10 +1,12 @@ -name: linkcheck-pr +name: linkcheck on: + schedule: + - cron: '0 6 * * 1' pull_request: paths: - 'docs/**' workflow_dispatch: {} - + jobs: linkcheck: runs-on: ubuntu-latest diff --git a/.github/workflows/linkcheck_scheduled.yml b/.github/workflows/linkcheck_scheduled.yml deleted file mode 100644 index 9eb840b9..00000000 --- a/.github/workflows/linkcheck_scheduled.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: linkcheck-scheduled -on: - schedule: - - cron: '0 6 * * 1' - workflow_dispatch: {} - -jobs: - linkcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtcenter/metplus-action-linkcheck@v1 - with: - fail-on-broken-links: 'true' \ No newline at end of file From 2a37f7ab99ed83838a521503ecd1e590cc651819 Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 7 Jul 2026 18:55:19 -0600 Subject: [PATCH 5/9] Per METplus#3247, added upload-artifact --- .github/workflows/linkcheck.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 40838861..a976fc11 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -15,4 +15,5 @@ jobs: - uses: dtcenter/metplus-action-linkcheck@v1 with: fail-on-broken-links: 'true' - upload-artifact: 'true' \ No newline at end of file + upload-artifact: 'true' + install-package: 'true' \ No newline at end of file From 72c2b5bc700d67b46256af2200d1135e66e2dd59 Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 14 Jul 2026 14:29:17 -0600 Subject: [PATCH 6/9] Per METplus#3247, modified name and checkout version. --- .github/workflows/linkcheck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index a976fc11..305c6dce 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -1,4 +1,4 @@ -name: linkcheck +name: Linkcheck on: schedule: - cron: '0 6 * * 1' @@ -11,7 +11,7 @@ jobs: linkcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtcenter/metplus-action-linkcheck@v1 with: fail-on-broken-links: 'true' From a70ab0d09513745d1ee91e0f57fa09235acc3a27 Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 14 Jul 2026 16:02:56 -0600 Subject: [PATCH 7/9] Trigger linkcheck run --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 4447ff62..fde51216 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -132,3 +132,4 @@ release_datestr = release_date, release_yearstr = release_year) + From 3b910f07ab474c172f03ba4c59aa8a50c39db644 Mon Sep 17 00:00:00 2001 From: jprestop Date: Mon, 27 Jul 2026 13:43:15 -0600 Subject: [PATCH 8/9] Unrelated to this PR but updating to resolve deprecated version. --- .github/workflows/documentation.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 02100ee4..0af1c868 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -29,12 +29,12 @@ jobs: python -m pip install -r docs/requirements.txt - name: Build docs run: ./.github/jobs/build_documentation.sh - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: always() with: name: documentation path: artifact/documentation - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: failure() with: name: documentation_warnings.log From 4acb235e30108876937c3dda432ecf7c7b812fc5 Mon Sep 17 00:00:00 2001 From: jprestop Date: Tue, 28 Jul 2026 10:37:46 -0600 Subject: [PATCH 9/9] Attempt to resolve unrelated python test errors --- metplotpy/plots/base_plot.py | 5 +++++ metplotpy/plots/taylor_diagram/taylor_diagram.py | 2 +- metplotpy/plots/tcmpr_plots/tcmpr.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/metplotpy/plots/base_plot.py b/metplotpy/plots/base_plot.py index 3551ba08..f7ad4541 100644 --- a/metplotpy/plots/base_plot.py +++ b/metplotpy/plots/base_plot.py @@ -369,6 +369,7 @@ def _add_legend(self, ax: plt.Axes, handles_and_labels=None, loc='upper center') if not handles: print("Warning: No labels found. Use ax.plot(..., label='name')") + return # handle plots that only have a single boolean for show legend show_legend = self.config_obj.show_legend @@ -379,6 +380,10 @@ def _add_legend(self, ax: plt.Axes, handles_and_labels=None, loc='upper center') filtered_handles = [h for h, show in zip(handles, show_legend) if show == 1] filtered_labels = [l for l, show in zip(labels, show_legend) if show == 1] + # Check if there are any handles left to plot + if not filtered_handles: + return + legend = ax.legend( handles=filtered_handles, labels=filtered_labels, diff --git a/metplotpy/plots/taylor_diagram/taylor_diagram.py b/metplotpy/plots/taylor_diagram/taylor_diagram.py index 146c6e9e..66be05c7 100644 --- a/metplotpy/plots/taylor_diagram/taylor_diagram.py +++ b/metplotpy/plots/taylor_diagram/taylor_diagram.py @@ -174,7 +174,7 @@ def _create_figure(self) -> None: # in Matplotlib 3.10, the default for apply_theta_transforms=True has been deprecated, explicitly set this # to True - tr = PolarAxes.PolarTransform(apply_theta_transforms=False) + tr = PolarAxes.PolarTransform() # Correlation labels rlocs = np.array([0, 0.2, 0.4, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1]) diff --git a/metplotpy/plots/tcmpr_plots/tcmpr.py b/metplotpy/plots/tcmpr_plots/tcmpr.py index 26bf45e5..21e3a836 100755 --- a/metplotpy/plots/tcmpr_plots/tcmpr.py +++ b/metplotpy/plots/tcmpr_plots/tcmpr.py @@ -240,7 +240,7 @@ def _add_legend(self, ax=None, handles_and_labels=None) -> None: """ if ax is None: ax = self.ax - super()._add_legend(ax) + super()._add_legend(ax, handles_and_labels=handles_and_labels) def _get_nstats(self) -> list: """