Skip to content

HyperTools 1.2.1: animation trail and marker arguments (#299), gallery layout points (#297) - #300

Merged
jeremymanning merged 31 commits into
masterfrom
post-1.2.0
Nov 24, 2026
Merged

jeremymanning merged 31 commits into
masterfrom
post-1.2.0

Conversation

@jeremymanning

@jeremymanning jeremymanning commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

HyperTools 1.2.1, on top of the 1.2.0 release (master == v1.2.0). Nothing here is tagged or uploaded. The branch goes to master by fast-forward (see RELEASE_CHECKLIST.md), not by a merge commit.

Closes #297
Closes #299

What this changes

GH #299 (animations)

  • Trails and chemtrails are drawn for marker formats ('-o', 'o'), not only for lines.
  • New arguments: head_marker=, tail_linewidth=, trail_alpha=, hold=, caption_kwargs=, suptitle= / suptitle_kwargs=. Arguments that only matplotlib supports raise NotImplementedError on plotly animations.

GH #297 (layout)

  • The animated 3-D cube and its axis labels stay inside the canvas and off the legend on every frame; the layout of legend, titles, caption and cube is fixed once for the whole animation.
  • Crowded labels= are moved off each other and off legends, colorbars, titles and captions. In an animation the label places are planned over all frames, so labels follow their points without reversing direction.
  • Continuous hue= on animated markers; half fillstyle= (and markerfacecoloralt=) honored on hue-colored markers.
  • A named 2-D legend loc is placed inside the drawn frame.
  • Example fixes (weather, teapot, market, bechdel).

Streaming plots

  • labels= on streams (a callable or an iterable consumed in step), placed from the data seen so far.
  • legend=, caption=, suptitle= and their styling arguments on streams, placed once with the first stream_init samples.

Other

  • A legend_colors= (label, color) pair key takes its dataset's line styling.
  • Version 1.2.1; CHANGELOG section dated 2026-11-24; README image links point at v1.2.1.
  • The process-leak sanity check in tests/test_multibyte.py no longer misreads a reused pid.
  • LSL tests on macOS also query each outlet port directly, so discovery does not depend on multicast delivery.
  • Label, legend and layout tests pass under matplotlib 3.10 and 3.11.

Known state

  • With about 30 crowded labels in an animation, some label pairs still overlap on some frames.
  • Local full suite on 27958d0: 9264 passed, 24 skipped.

Details per review round are in notes/session_2026-11-22_feat295-animated-panels.md and in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG

jeremymanning and others added 17 commits November 23, 2026 00:03
… with

The leaked-browser test's own sanity check failed once on the v1.2.0 tag run
(macOS, Python 3.13): the last snapshot caught the stand-in browser already
ended ("<defunct>") and, with one command line kept per process, erased the
"sleep 600" seen before it. The watcher now keeps the history; the liveness
check accepts any command line seen for a process, which is stricter than
before. Notes: the 1.2.0 release record; the release-notes draft now equals
the published body.

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…head_marker=, tail_linewidth=, trail_alpha=, hold=, caption_kwargs=, suptitle= (GH #299)

The trail artists of an animated plot were created only when some dataset
had a PURE line format (is_line), so '-o', 'o-', '.-' and '--s' silently
got no trail. Every flagged dataset now gets its trail, drawn in its own
format.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…gelog, notes); a trail keeps its own dataset's color

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…and legend, labels off each other, animated marker hue)

Library:
- plot._keep_cube_clear: a single 3-D plot's cube is measured at every
  camera angle and zoomed out until it keeps a margin from the canvas
  edges, the legend and the figure's other axes (static and animated,
  one function)
- matplotlib_backend.declutter_labels, run at draw time: an observation
  label whose box would cover an earlier one takes another corner
- _apply_multicolor_animation(markers=True): an animated markers-only
  plot with a continuous hue= is revealed frame by frame, with its trail

Examples: animate_market_sectors uses the library legend;
animate_weather_decades leaves room for its last marker; plot_shapes_zoo
draws the sparse teapot with '.'; plot_datasets_tour plots the Bechdel
dollar columns on a log scale. Tutorial notebook sources follow (not
re-executed).

Tests: tests/test_issue297_layout.py. CHANGELOG and notes updated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…mated '-o', serial hue trails, checked styling values)

Labels: declutter_labels keeps a label where it is until its box is
covered, moves it to the nearest free place at the shortest reach, and
never sends it back; reset at the end of plot() and when an animation
starts over. 60-frame spin: 26 changes of place for 8 labels (71
before), 130 for 30 (777 before). 3-D label anchors are projected at
draw time (they were stale after the cube was shrunk for a legend).

Continuous hue in animations: a line-and-marker format draws colored
markers on tail and trail; serial marker trails no longer raise; serial
trails are cleared; trail alpha is trail_alpha x alpha; an animated hue
line honors alpha=; mixed formats draw each dataset by its own format
(static too); head markers and trails fade with the right dataset.

Arguments: tail_linewidth= warns on a markers-only format and no longer
widens a spinning line; head_marker=, caption_kwargs=, suptitle_kwargs=
and title_kwargs= check their values and name the key; a suptitle clears
a top caption that grows. Docstring, guide and changelog: static plotly
warns, hold= in a gif, the cube margin as measured.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…ces; generator prose in American spelling

Both notebooks regenerated from their example scripts and executed with
scripts/execute_tutorial.py; the clips are re-rendered (library legend
clear of the cube, last-month marker inside the canvas). Market data
fetched live (318 months through Oct 2026).

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

The stateful label declutter still moved labels during an animation and
made draw_frame(i) depend on the frames drawn before it. An animated
plot now runs the same declutter_labels once (freeze_label_places: frame
0's view, every label taken as shown) and every label holds that place
on every frame. Static figures are unchanged. Tests assert zero changes
of place, identical pixels in any drawing order, saved frames equal to
drawn frames, and identical static saves.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…lib; label placement in points, per axes, memoized, held while plot() lays out; measurement keeps the figure's canvas; grid styling warnings; per-dataset trail lists with hue; labels with morph; hue marker styling; trace followers; every-frame caption and title room; cube fit in one projection)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…e renderer; morph labels warn; CHANGELOG 1.2.1 proofread; docstring and animation guide for every-frame text room, ctx.artists followers, trail lists with hue)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…, reading the labels the axes holds now; label size measured again after rotation or parse_math; half fillstyle hue markers drawn whole with markerfacecoloralt; morph labels check through the shared datatype predicates)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…ing a label changes it, so every redraw was a new placement problem); new-canvas callback test counts from the canvas's own callbacks

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…, suptitle and caption; a named 2-D legend loc is inside the drawn frame; one head marker per dataset with categories; serial frame 0 shows the head; head_marker dict takes matplotlib short names and a face color; trail_alpha warning under 'window'; a hold too short for a frame warns; docstrings for four definitions; LSL test discovery timeouts 30 s)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…nimated labels; LSL loopback test config); not yet verified

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…t port directly (KnownPeers); discovery timeouts back to 30 s; measurements and open questions in the test module docstring and the session notes

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…per-frame animated labels verified on checkpoint d9058df: round 5 file 50 passed on matplotlib 3.10 and 3.11.2; rounds 1 to 4, issue 297 and 299 files and 71 related files green; ruff clean)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…nned over all frames so they do not overlap (each label takes the cheapest path through the frames among 72 places, moves before another arrives, rests a second, never turns back; crossing glides planned again; panels keep off each other's labels; 8 and 12 labels and a 3-D window 0 overlapping pairs on every frame, 30 labels 0.75 a frame against 5.6 for stills and 10.9 before; tests for the per-frame overlap bounds)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
@jeremymanning jeremymanning changed the title test: steady the leaked-browser test's process watcher (after 1.2.0) HyperTools 1.2.1: animation trail and marker arguments (#299), gallery layout points (#297) Nov 24, 2026
jeremymanning and others added 12 commits November 23, 2026 21:39
…nded, freed, picklable and kept up to date (above 300 labels one table row and no frame run; at most 3600 labels x frames planned, frames between interpolated; table 28 bytes a label and planned frame; frame function held weakly so closed figures are freed; a pickled or copied figure draws with its labels where the frame had them; the plan is made again when a label's size or the obstacles change; tests for each and for edge inputs)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…red at one fixed dpi so the arrangement is the same at every dpi and format; cube may come down to 55% of its size, was 70%, to clear a corner legend that 3.11 draws a quarter taller; pair bounds recorded for the long-text and unequal-panels cases; traced timings in the changelog corrected)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
A stream's labels are a callable labels(index, sample) or an iterable
consumed in step with the samples. Each label follows its sample's drawn
position, leaves with it under stream_window=, and is placed by the one
placement rule (_arrange_labels) from where the update before left it.

Also: a '-o' stream draws a marker on every sample (the head's
markers-only copy was never updated), and a stream into a caller's ax=
updates its own line.

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

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

A labels= callable or iterator that raised for a sample in the middle of
a chunk (or inside stream_init) discarded the chunk's earlier samples and
their labels; so did a sample that could not be read. Samples are now
read and labeled one at a time, the good prefix is kept and drawn, and
label k always belongs to sample k.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…e (a dead weak proxy met in the gc scan raised ReferenceError in full-suite runs)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…tic cube that fits is not touched

1.2.1 gallery review follow-ups.

- legend_colors=[(label, color), ...] drew every key as one fixed
  2-point swatch, so the market-sectors clip's heavy "Market" path had a
  thin key (1.1.0 and 1.2.0 too; the 1.2.0 example drew its own legend).
  With one pair per drawn dataset each key now takes that dataset's fmt
  and given linewidth, linestyle, marker, markersize and alpha, on
  static, animated and panels plots (plotly: the width).
- The GH #297 cube fit (be7244a) set every static 3-D plot's box aspect
  again at zoom 1, which moved it one unit in the last place and 2 to 7
  antialiased pixels in three gallery figures. A zoom already in effect
  is not applied again; the figures match 1.2.0 byte for byte.
- An animation given a format string and linestyle=/marker= no longer
  makes matplotlib warn "redundantly defined".

Tests: tests/test_legend_key_styles.py, tests/test_static_cube_untouched.py.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…teps); home path in the session notes written with a tilde

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…ed, 55% cube floor kept, three more stream arguments, prepare the release then ask)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
Forwarded (with legend_kwargs=, legend_colors=, caption_kwargs= and
suptitle_kwargs=) to the static plot of the first stream_init samples,
which lays them out once; the display box is frozen, so that layout
holds for the whole stream. A per-frame (callable) caption raises
TypeError before a sample is consumed. Stream labels keep off all three.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…; resume notes, final state before the suspend

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
…ts legend keys match their paths

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG
jeremymanning and others added 2 commits November 24, 2026 12:58
… takes a sample

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 marked this pull request as ready for review November 24, 2026 19:16
@jeremymanning
jeremymanning merged commit 3e614e9 into master Nov 24, 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

Development

Successfully merging this pull request may close these issues.

Animated line+marker format ('-o') silently drops chemtrails=/trail lines Gallery figures: five small layout points carried over from 1.1.0

1 participant