Skip to content

HyperTools 1.1.1: quiet backend warning, caller-figure layout, findfont lines (#290, #291, #292) - #293

Merged
jeremymanning merged 8 commits into
masterfrom
fix/1.1.1-issues-290-292
Nov 21, 2026
Merged

jeremymanning merged 8 commits into
masterfrom
fix/1.1.1-issues-290-292

Conversation

@jeremymanning

Copy link
Copy Markdown
Member

Patch release 1.1.1: fixes for three issues met when hyp.plot draws into a figure the caller built, found by executing notebooks under jupyter nbconvert with matplotlib 3.11. No API changes.

Closes #290
Closes #291
Closes #292

What changed

Behavior changes to be aware of

  • A caller-built figure is no longer tightened. Call fig.tight_layout() after plotting, create the figure with layout='constrained', or build the grid with hyp.subplots.
  • A legend= beside a caller's axes is no longer fitted by widening the caller's figure, so without a layout it can cover the next panel or run off the canvas. Measured in 2-D and 3-D with one and two panels: on a figure left alone, fig.tight_layout() and layout='constrained' both place every legend without clipping or overlap; on a figure the fit had widened, the caller's fig.tight_layout() left the last legend clipped.
  • Under matplotlib 3.11, three cases can still log a findfont weight line: bold or other non-regular text, a font= naming a family with no regular face, and text whose only covering font has none. See "Documented limitations" in the changelog.

Also in this PR

  • A crash for axes that live in a SubFigure when legend= is given (present in 1.1.0).
  • Two tests that fail on current releases of their dependencies, with or without this branch: a nested pytest.approx that pytest 9.2 rejects, and an LSL fixture whose 5 s teardown wait is shorter than the 7 s that pylsl 1.18.7 takes to destroy an outlet. The assertions are unchanged.
  • Two tests that assumed 1.1.0 was the newest version were updated for a patch release.

Verification

  • tests/test_caller_figure_hygiene.py (new, 37 tests): passes on matplotlib 3.10.8 and 3.11.2; against master's code under 3.11 it gives 22 failed and 11 errors.
  • Full suite, Python 3.12 with matplotlib 3.11.2 and current dependencies: 6822 passed, 33 skipped.
  • Full suite, Python 3.12 with matplotlib 3.10.8: 6845 passed, 23 skipped, 1 failed when run at the same time as the other suite (an LSL test that resolves any stream on the network saw the other run's outlets); that file passes when run alone (27 passed, 1 skipped).
  • ruff check . clean; Sphinx -W build with all 51 gallery examples succeeded.
  • Reviewed in two rounds by three independent reviewers and the Codex CLI; findings and what was done about each are in notes/session_2026-11-21_release-1.1.1.md. Reviewer comparison against master: figures hypertools makes itself are pixel-identical (PNGs), animations byte-identical (6 gifs), plotly figures identical (8).

Not in this PR

Nothing here puts the repository in release form. readme.md still pins its images to the v1.1.0 tag, and the galleries, tag, and PyPI upload follow RELEASE_CHECKLIST.md after the merge. Until then the release-gate job on master is expected to fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG

jeremymanning and others added 8 commits November 21, 2026 14:54
…290, #291, #292)

- #290: the import-time BACKEND_WARNING is issued only by a call that
  displays an interactive/animated matplotlib plot, once per session.
- #291: hyp.plot(ax=) no longer runs tight_layout on a figure the caller
  built (hyp.subplots grids and hypertools' own figures are still laid
  out, through the figure rather than pyplot); the legend fit leaves a
  caller's layout engine in place.
- #292: fallback font families with no regular-weight face are left out
  of the sans-serif stack, so matplotlib >= 3.11 logs no findfont line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…rded after delivery)

- hyp.plot(ax=) no longer fits a legend by widening a caller-built figure:
  measured, a widened figure leaves the last legend clipped under the
  caller's own tight_layout, while an untouched one lays out cleanly.
  Also fixes a crash for axes that live in a SubFigure.
- the backend warning is recorded as issued only after warnings.warn
  returns; argument inspection tolerates array-valued animate=.
- changelog limitations, release checklist preface for 1.1.1, session notes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
… second call)

- every figure hypertools creates is marked, so hyp.plot(more,
  ax=fig.axes[0], legend=...) still tightens it and fits the legend.
- the warning's argument inspection runs inside the try/finally that
  restores rcParams; a plotly Figure passed as ax= never gets the
  matplotlib backend warning.
- changelog, docstring and checklist wording corrected.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
- pytest 9.2 rejects nested sequences in approx: compare as arrays.
- pylsl 1.18.7 (liblsl 1.18.0.b7) takes up to 7 s to destroy an outlet an
  inlet connected to; the outlet fixture's teardown budget was 5 s.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
Yahoo answers a throttled address with HTTP 429 and a plain-text body,
which surfaced as 'returned a non-JSON response ... JSONDecodeError' and
failed eight live tests on one CI runner. The loader now says the address
is being rate-limited; the tests' transient-network classifier reads that
as an outage (skip, or fail under HYPERTOOLS_REQUIRE_LIVE_SOURCES=1).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
@jeremymanning
jeremymanning merged commit 8434216 into master Nov 21, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant