Rewrite CI to lint/typecheck/audit/test only; add HPC deployment path
- Replace the Docker build/publish CI stages with ruff (lint + format check), ty (type check), pip-audit, and pytest run directly against python:3.11-slim; Docker remains for manual/server deployment only. - Swap black/pylint/mypy for ruff/ty across pyproject.toml, and fix every resulting lint, format, and type diagnostic in gallery/ and plotstyle/. - Fix tests broken/stale from before the package restructuring: wrong `utils.*` import paths, mock patch targets pointed at the wrong module, and PDF-conversion tests still assuming ImageMagick instead of the current PyMuPDF-first path. Drop test_container.py (obsolete Docker-container smoke tests, fully superseded elsewhere). - Add a plain-venv + systemd --user timer deployment path (deploy/systemd/) for HPC login nodes without a Docker daemon, where public_html is already served by existing infrastructure. - Document both in CLAUDE.md, including running CI's checks locally before committing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import warnings
|
||||
from typing import Optional
|
||||
|
||||
from matplotlib.axes import Axes
|
||||
from matplotlib.colors import to_rgba
|
||||
@@ -21,7 +22,7 @@ def style_legend(
|
||||
ax: Axes,
|
||||
loc: str = "outside right upper",
|
||||
frameon: bool = False,
|
||||
title: str = None,
|
||||
title: Optional[str] = None,
|
||||
**kwargs,
|
||||
):
|
||||
"""Add a figure-level legend, placed outside the axes by default.
|
||||
@@ -43,12 +44,15 @@ def style_legend(
|
||||
)
|
||||
|
||||
fig = ax.get_figure()
|
||||
assert fig is not None, "ax must be attached to a figure"
|
||||
handles = kwargs.pop("handles", None)
|
||||
labels = kwargs.pop("labels", None)
|
||||
if handles is None or labels is None:
|
||||
handles, labels = ax.get_legend_handles_labels()
|
||||
|
||||
legend = fig.legend(handles, labels, loc=loc, frameon=frameon, title=title, **kwargs)
|
||||
# matplotlib-stubs' `loc` Literal doesn't include the "outside ..." compound
|
||||
# locations matplotlib actually supports at runtime (e.g. "outside right upper").
|
||||
legend = fig.legend(handles, labels, loc=loc, frameon=frameon, title=title, **kwargs) # ty: ignore[invalid-argument-type]
|
||||
if legend.get_title() is not None:
|
||||
legend.get_title().set_fontweight("bold")
|
||||
return legend
|
||||
|
||||
Reference in New Issue
Block a user