From edca55aa285c166e736d23ccfc65f3e041837d7e Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sat, 21 Nov 2026 23:25:59 -0500 Subject: [PATCH 1/7] release: 1.1.1 release form; seed two gallery examples README images pinned to the v1.1.1 tag (13 URLs). The k-means panel of plot_colorbar.py and the UMAP panel of plot_digits.py came out different on every docs build; both now pass random_state=0, so the gallery is the same from build to build apart from examples that read live data. Changelog entry, release notes draft and session notes. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- CHANGELOG.md | 9 ++++- examples/plot_colorbar.py | 4 ++- examples/plot_digits.py | 5 ++- notes/release_notes_v1.1.1_draft.md | 37 ++++++++++++++++++++ notes/session_2026-11-21_release-1.1.1.md | 41 +++++++++++++++++++++++ readme.md | 26 +++++++------- 6 files changed, 106 insertions(+), 16 deletions(-) create mode 100644 notes/release_notes_v1.1.1_draft.md diff --git a/CHANGELOG.md b/CHANGELOG.md index e6879ec6a..36ee21338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,13 +75,20 @@ draws into a figure the caller built, found by executing notebooks with same glyphs are still reached through 'Hiragino Sans'); a font named with `font=`, and a font found to be the only one covering the text, are kept regardless. - - **A Yahoo Finance rate limit is reported as one.** When Yahoo throttles an address it answers HTTP 429 with a plain-text body, which `hyp.load('yahoo:')` reported as "returned a non-JSON response (HTTP 429) ... JSONDecodeError". The error now says that Yahoo is rate-limiting the address and to try again later. +### Documentation + +- **Two gallery examples are now seeded.** The k-means panel of + `plot_colorbar.py` and the UMAP panel of `plot_digits.py` came out + different on every docs build (cluster colors permuted; a different UMAP + layout). Both now pass `random_state=0`, so every gallery figure that + does not read live data is the same from build to build. + ### Documented limitations - **Some text can still log under matplotlib 3.11.** The line above is diff --git a/examples/plot_colorbar.py b/examples/plot_colorbar.py index e87ffd770..80cee79c5 100644 --- a/examples/plot_colorbar.py +++ b/examples/plot_colorbar.py @@ -30,6 +30,8 @@ # Discrete groups (here, k-means clusters) get a segmented colorbar with # one tick/block per group instead of a continuous gradient. A dict lets # you set a label or move the colorbar to another side of the figure. +# (k-means starts from random centers; ``random_state`` keeps the cluster +# numbering, and so the colors, the same from run to run.) -hyp.plot(data, '.', n_clusters=4, +hyp.plot(data, '.', n_clusters=4, random_state=0, colorbar={'label': 'cluster', 'location': 'right'}) diff --git a/examples/plot_digits.py b/examples/plot_digits.py index b34ceaa82..e29f6585f 100644 --- a/examples/plot_digits.py +++ b/examples/plot_digits.py @@ -38,4 +38,7 @@ # %% # ... and with UMAP, which is faster and keeps more of the global layout. -hyp.plot(data, '.', reduce='UMAP', hue=hue, ndims=2, legend=True) +# UMAP's layout is random unless it is seeded; ``random_state`` makes the +# figure the same on every run. +hyp.plot(data, '.', reduce='UMAP', random_state=0, hue=hue, ndims=2, + legend=True) diff --git a/notes/release_notes_v1.1.1_draft.md b/notes/release_notes_v1.1.1_draft.md new file mode 100644 index 000000000..6786d507e --- /dev/null +++ b/notes/release_notes_v1.1.1_draft.md @@ -0,0 +1,37 @@ +# HyperTools 1.1.1 + +A patch release with no API changes. It fixes noise and side effects met when `hyp.plot` draws into a figure the caller built (`ax=`), found by executing notebooks with `jupyter nbconvert` under matplotlib 3.11, and one misleading error message from the Yahoo Finance loader. + +Every change is listed in the [changelog](https://github.com/ContextLab/hypertools/blob/v1.1.1/CHANGELOG.md); these notes summarize it. + +## Install + +```bash +pip install --upgrade hypertools +``` + +Python 3.10 through 3.13. Extras are unchanged from 1.1.0. + +## Fixed + +- **The backend warning is issued once, and only when it applies ([#290](https://github.com/ContextLab/hypertools/issues/290)).** When hypertools cannot set up an interactive matplotlib backend at import (for example in a notebook kernel without `ipympl`), `hyp.plot` repeated the warning on every call, including static plots and calls that show no live figure. It is now issued only by a call that displays an animated or interactive plot that matplotlib renders, and once per session per message. +- **`hyp.plot(..., ax=ax)` leaves the layout of the caller's figure alone ([#291](https://github.com/ContextLab/hypertools/issues/291)).** Static plots ended with `plt.tight_layout()` even when the caller passed its own axes, which moved every axes of the figure, discarded `subplots_adjust` margins, replaced a `layout='constrained'` engine, and acted on pyplot's current figure rather than the one that owns `ax`. A figure the caller built is now left as the caller arranged it. Figures hypertools makes itself (its own figure, a `panels=` grid, a `hyp.subplots` grid) are laid out as before. +- **A legend or title added to the caller's axes is fitted automatically, inside that axes' own room.** Through 1.1.0 a `legend=` beside a caller's axes was fitted by widening the caller's figure, which stretched its other axes and switched off its layout engine. Now, when the figure is drawn, only the axes passed as `ax=` is narrowed just far enough that its legend ends before the canvas edge or the next panel, and lowered just far enough that its title stays on the canvas. No call is needed, and the fit follows a later `fig.tight_layout()`, `fig.subplots_adjust(...)`, resize or save. A legend with no room beside the axes is drawn inside it; one too large for its panel either way is left in place with a `UserWarning` naming the remedies. +- **No `findfont` log lines for ordinary text under matplotlib 3.11 ([#292](https://github.com/ContextLab/hypertools/issues/292)).** matplotlib 3.11 logs a line each time a family in the font list has no face at a text's exact weight; one of the fallback families hypertools listed has no regular face on macOS, so every figure logged the line several times. Fallback families with no regular-weight face are now left out of the list. +- **A Yahoo Finance rate limit is reported as one.** `hyp.load('yahoo:')` reported an HTTP 429 from Yahoo as a JSON decoding failure. The error now says that Yahoo is rate-limiting the address and to try again later. + +## Upgrading from 1.1.0 + +- **If you relied on the automatic `tight_layout`** of a figure made with `plt.subplots`, call `fig.tight_layout()` after plotting, create the figure with `layout='constrained'`, or build the grid with `hyp.subplots`. +- On an axes whose legend or title was fitted, `ax.get_position()` reports the position of the last draw (the fit is an axes locator, recomputed on each draw). + +## Known limitations + +- The automatic fit does not detect an inset or other axes placed by hand where the legend goes, or a legend over the tick labels of its own axes' twin. +- Bold or other non-regular text can still log `findfont` lines under matplotlib 3.11 when an installed fallback family ships a regular face only; see "Documented limitations" in the changelog. + +## Links + +- Documentation: https://hypertools.readthedocs.io/en/stable/ +- Changelog: https://github.com/ContextLab/hypertools/blob/v1.1.1/CHANGELOG.md +- PyPI: https://pypi.org/project/hypertools/1.1.1/ diff --git a/notes/session_2026-11-21_release-1.1.1.md b/notes/session_2026-11-21_release-1.1.1.md index f52c6f9c5..0894230ab 100644 --- a/notes/session_2026-11-21_release-1.1.1.md +++ b/notes/session_2026-11-21_release-1.1.1.md @@ -305,3 +305,44 @@ pass on matplotlib 3.10.8 and 3.11.2. - Sphinx `-b html -W -E -a` with every gallery example re-executed, at 49165c09: build succeeded. - `ruff check`: all checks passed. + +## Gallery rebuild and before/after review (2026-11-21, late evening) + +Request: rebuild the gallery, review before/after for ALL figures (own review +plus an independent one, ideally Codex), and build a draft release. Working +unattended; the user is on a phone. + +- PR #294 (automatic legend/title fit) merged as e3abb840 with all CI green. +- Built the gallery in release form from e3abb840 (51 of 51 examples + executed, sphinx exit 0, 32 min). Compared it with two baselines using + a scratch script (pixel statistics on every PNG, every GIF frame, every + MP4 frame, plotly payload hashes): the published 1.1.0 gallery + (`docs-gallery-v1.1.0`, 519b4af2) and the pre-fit 1.1.1 gallery (built + from 514a12cb). +- Result: 89 figures + 51 thumbnails. 87 of 89 byte-identical to the + pre-fit build; 85 of 89 to 1.1.0. The differences: + - `plot_colorbar_002.png`: k-means unseeded, cluster colors permuted on + every build (same points). Not from the code change. + - `plot_digits_003.png`: UMAP unseeded, new layout every build. + - `animate_market_sectors_001.gif/.mp4` (vs 1.1.0 only): live Yahoo data, + one more month (ends October 31, 2026 instead of September 30, 2026). +- No gallery example puts a legend on an axes the example made itself (five + use `ax=`, with titles only, which already fit), so the fit changing no + gallery figure is expected. My earlier guess that four examples would + render differently was wrong. +- Fix: both examples now pass `random_state=0` (the library's own argument; + passing UMAP's `random_state` through the `reduce` dict works too but + prints umap's n_jobs warning). Verified: two runs each give identical + figures, no warnings with `-W error::UserWarning`. +- Release form: README images flipped to `v1.1.1` (13 URLs), tutorial + install cells already correct (migrator: 76 of 76). NOTE: the migrator + must run on the `master` branch; on any other branch it retargets the + tutorials to that branch. +- Plan: commit on local `master` (not pushed to `master`; pushed as + `release/1.1.1` so nothing on `master` changes before the user's go), + rebuild the gallery from that commit, repeat the comparison, independent + review (Codex + fresh subagent), publish the pre-built gallery (keeping + the old commit c90dd87e reachable on a `docs-gallery-v1.1.1-prev` branch + because `master`'s docs build fetches it by id), record it, publish the + notebooks, build wheel + sdist, create a DRAFT GitHub release (no tag). + Tag, PyPI and the `master` push wait for the user's go. diff --git a/readme.md b/readme.md index e6b110f5f..c0bea7f7c 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -![Hypertools logo](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/hypercube.png) +![Hypertools logo](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/hypercube.png) [![Tests](https://img.shields.io/github/actions/workflow/status/ContextLab/hypertools/test.yml?label=tests)](https://github.com/ContextLab/hypertools/actions/workflows/test.yml) [![Documentation Status](https://readthedocs.org/projects/hypertools/badge/?version=latest)](https://hypertools.readthedocs.io/en/latest/?badge=latest) @@ -7,7 +7,7 @@ "_To deal with hyper-planes in a 14 dimensional space, visualize a 3D space and say 'fourteen' very loudly. Everyone does it._" - Geoff Hinton -![Hypertools example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/story_trajectories.gif) +![Hypertools example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/story_trajectories.gif) ## Overview @@ -52,7 +52,7 @@ the link under a clip for the full code and the full-length animation. Six stock-market sectors, each reduced to 3-D on its own and then hyperaligned into a shared space, with a heavier path for the market as a whole. -![Market sectors example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/tour_market_sectors.gif) +![Market sectors example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/tour_market_sectors.gif) [Tutorial: market sectors](https://hypertools.readthedocs.io/en/latest/tutorials/market_sectors.html) @@ -62,7 +62,7 @@ Give `hyp.plot` a list of strings and it embeds them, projects them into 2-D or 3-D, and plots the result. Here a paragraph about each of five paintings becomes its own cloud, drawn in a color pulled from the canvas itself. -![Painting embeddings example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/tour_painting_embeddings.gif) +![Painting embeddings example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/tour_painting_embeddings.gif) [Tutorial: painting embeddings](https://hypertools.readthedocs.io/en/latest/tutorials/painting_embeddings.html) @@ -72,7 +72,7 @@ becomes its own cloud, drawn in a color pulled from the canvas itself. Tea-Party from *Alice's Adventures in Wonderland*: each segment is one turn of the conversation, colored by speaker and placed by what is being said. -![Conversation example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/tour_conversation_shape.gif) +![Conversation example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/tour_conversation_shape.gif) [Tutorial: the shape of a conversation](https://hypertools.readthedocs.io/en/latest/tutorials/conversation_shape.html) @@ -81,7 +81,7 @@ the conversation, colored by speaker and placed by what is being said. Monthly temperatures in 20 cities around the globe, from 1875 to 2013, drawn as a single path and colored by the average temperature that month. -![Weather example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/tour_weather_decades.gif) +![Weather example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/tour_weather_decades.gif) [Tutorial: weather across the decades](https://hypertools.readthedocs.io/en/latest/tutorials/weather_decades.html) @@ -97,7 +97,7 @@ shapes = [hyp.load(n) for n in names] hyp.plot(shapes, '.', color='k', animate='morph', title=names) ``` -![Morph example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/tour_morph_shapes_zoo.gif) +![Morph example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/tour_morph_shapes_zoo.gif) [Tutorial: morphing the shapes zoo](https://hypertools.readthedocs.io/en/latest/tutorials/morph_shapes_zoo.html) @@ -256,7 +256,7 @@ list_of_labels = ['A'] * 300 + ['B'] * 300 # one label per observation hyp.plot(list_of_arrays, animate=True, hue=list_of_labels) ``` -![Plot example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/plot.gif) +![Plot example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/plot.gif) ## Align @@ -275,11 +275,11 @@ hyp.plot(list_of_arrays, align='hyper') ### BEFORE -![Align before example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/align_before.gif) +![Align before example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/align_before.gif) ### AFTER -![Align after example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/align_after.gif) +![Align after example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/align_after.gif) ## Cluster @@ -299,7 +299,7 @@ array = np.vstack([rng.standard_normal((100, 3)) + offset hyp.plot(array, 'o', cluster='GaussianMixture', n_clusters=3) ``` -![Cluster Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/cluster_example.png) +![Cluster Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/cluster_example.png) ## Surfaces @@ -317,7 +317,7 @@ blob_b = rng.standard_normal((100, 3)) + [4, 0, 0] hyp.plot([blob_a, blob_b], '.', surface=True) ``` -![Surface Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/surface_example.png) +![Surface Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/surface_example.png) ## Describe @@ -332,4 +332,4 @@ list_of_arrays = [np.cumsum(rng.standard_normal((200, 20)), axis=0) hyp.describe(list_of_arrays, reduce='PCA', max_dims=14) ``` -![Describe Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.0/images/describe_example.png) +![Describe Example](https://raw.githubusercontent.com/ContextLab/hypertools/v1.1.1/images/describe_example.png) From a7193bb105e37283a013b6b4b94fe29e9f484318 Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sat, 21 Nov 2026 23:29:41 -0500 Subject: [PATCH 2/7] fix: a UMAP seeded through the reduce dict no longer warns about n_jobs umap-learn forces n_jobs=1 when seeded and warns that it did. hypertools passed n_jobs=1 itself for the top-level random_state= on the bare-name form only; reduce={'model': 'UMAP', 'kwargs': {'random_state': 0}} (the form several gallery examples use) and the dict form with a top-level seed still drew the warning. An explicit n_jobs still gets umap's warning. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- CHANGELOG.md | 8 ++++++ hypertools/reduce/reduce.py | 32 +++++++++++++++++------ notes/session_2026-11-21_release-1.1.1.md | 9 +++++++ tests/test_reduce_third_party_warnings.py | 24 +++++++++++++++++ 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36ee21338..bfbecf686 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,14 @@ draws into a figure the caller built, found by executing notebooks with `hyp.load('yahoo:')` reported as "returned a non-JSON response (HTTP 429) ... JSONDecodeError". The error now says that Yahoo is rate-limiting the address and to try again later. +- **A seeded UMAP no longer warns about `n_jobs`.** umap-learn runs + single-threaded whenever it is seeded and says so with "n_jobs value 1 + overridden to 1 by setting random_state". hypertools already kept that + warning away for the top-level `random_state=`; a seed passed in the + `reduce` dict (`reduce={'model': 'UMAP', 'kwargs': {'random_state': + 0}}`, as several gallery examples do) still drew it. Both forms are now + quiet and give the same embedding. A call that sets `n_jobs` itself + still gets umap's warning. ### Documentation diff --git a/hypertools/reduce/reduce.py b/hypertools/reduce/reduce.py index 09d735504..df4af78e7 100644 --- a/hypertools/reduce/reduce.py +++ b/hypertools/reduce/reduce.py @@ -328,6 +328,17 @@ def reduce(x, reduce='IncrementalPCA', ndims=None, return_model=False, and inspect.isclass(c_model) and 'random_state' in inspect.signature(c_model).parameters): c_kwargs['random_state'] = random_state + # a seeded UMAP runs single-threaded and warns "n_jobs value + # ... overridden to 1"; whoever set the seed (the user in + # 'kwargs', or the top-level random_state just injected) did + # not choose n_jobs, so pass the value umap will use anyway + # (see the same step for the bare-name form below) + if (inspect.isclass(c_model) + and getattr(c_model, '__name__', '') == 'UMAP' + and c_kwargs.get('random_state') is not None + and 'n_jobs' not in c_kwargs and len(c_args) == 0 + and 'n_jobs' in inspect.signature(c_model).parameters): + c_kwargs['n_jobs'] = 1 # construct immediately; the resulting instance flows through # the same already-constructed-instance handling below as a # bare instance passed directly as `reduce=`. An ALREADY- @@ -484,14 +495,19 @@ def reduce(x, reduce='IncrementalPCA', ndims=None, return_model=False, and 'random_state' not in model_params and 'random_state' in inspect.signature(model).parameters): model_params['random_state'] = random_state - # umap-learn forces n_jobs=1 whenever a random_state is set and - # warns that it did ("n_jobs value -1 overridden to 1 ..."), which - # would blame the user for a seed hypertools injected. Pass the - # n_jobs umap is going to use anyway, unless the user chose one. - if (getattr(model, '__name__', '') == 'UMAP' - and 'n_jobs' not in model_params - and 'n_jobs' in inspect.signature(model).parameters): - model_params['n_jobs'] = 1 + + # umap-learn forces n_jobs=1 whenever a random_state is set and warns + # that it did ("n_jobs value -1 overridden to 1 ..."). The user asked + # for a seed (top-level `random_state=`, or in the `reduce` dict's + # kwargs), not for a number of jobs, so the warning tells them nothing + # they chose: pass the n_jobs umap is going to use anyway. A user who + # set n_jobs themselves still gets umap's warning about it. + if (not model_is_instance + and getattr(model, '__name__', '') == 'UMAP' + and model_params.get('random_state') is not None + and 'n_jobs' not in model_params + and 'n_jobs' in inspect.signature(model).parameters): + model_params['n_jobs'] = 1 # sklearn TSNE's default perplexity (30) requires n_samples > 30, so # small datasets crashed on a parameter the user never set diff --git a/notes/session_2026-11-21_release-1.1.1.md b/notes/session_2026-11-21_release-1.1.1.md index 0894230ab..efc8bf1ca 100644 --- a/notes/session_2026-11-21_release-1.1.1.md +++ b/notes/session_2026-11-21_release-1.1.1.md @@ -346,3 +346,12 @@ unattended; the user is on a phone. because `master`'s docs build fetches it by id), record it, publish the notebooks, build wheel + sdist, create a DRAFT GitHub release (no tag). Tag, PyPI and the `master` push wait for the user's go. +- Found while running the examples gate: `animate_painting_embeddings.py` + and `animate_conversation.py` seed UMAP through the `reduce` dict, which + drew umap's "n_jobs value 1 overridden to 1 by setting random_state" + warning (not shown on the docs pages, but shown to anyone running the + example). Fixed in `hypertools/reduce/reduce.py`: the dict form now passes + `n_jobs=1` when the model is seeded and the caller named no `n_jobs` + (same as the bare-name form already did). Regression test in + `tests/test_reduce_third_party_warnings.py`; changelog entry. The first + gallery build from the release commit was stopped for this and restarted. diff --git a/tests/test_reduce_third_party_warnings.py b/tests/test_reduce_third_party_warnings.py index 8124317bd..d1d1c6c3f 100644 --- a/tests/test_reduce_third_party_warnings.py +++ b/tests/test_reduce_third_party_warnings.py @@ -23,6 +23,30 @@ def test_seeded_umap_does_not_warn_about_n_jobs(): assert not [m for m in w if 'n_jobs' in str(m.message)] +def test_umap_seeded_through_the_reduce_dict_does_not_warn_about_n_jobs(): + """A seed passed as ``reduce={'model': 'UMAP', 'kwargs': + {'random_state': ...}}`` (the form several gallery examples use) is the + same request as the top-level ``random_state=``: neither names n_jobs, + so neither should draw umap's n_jobs warning, and both give the same + embedding.""" + pytest.importorskip('umap') + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always') + out = hyp.reduce( + _digits400(), + reduce={'model': 'UMAP', 'kwargs': {'random_state': 0}}, ndims=3) + plotted = hyp.plot( + _digits400(), '.', + reduce={'model': 'UMAP', 'kwargs': {'random_state': 0}}, ndims=3, + show=False) + assert not [m for m in w if 'n_jobs' in str(m.message)] + assert plotted is not None + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + top = hyp.reduce(_digits400(), reduce='UMAP', ndims=3, random_state=0) + np.testing.assert_allclose(np.asarray(out), np.asarray(top)) + + def test_seeded_umap_honours_an_explicit_n_jobs(): pytest.importorskip('umap') from hypertools.reduce.common import resolve_reducer From a7dfad3aabbea643e8777f734e755052eb7b3256 Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sat, 21 Nov 2026 23:32:08 -0500 Subject: [PATCH 3/7] docs: plot_shapes_zoo example draws no stray axis labels The biplane is the one shape that loads as a DataFrame (columns x, y, z), so its panel alone carried axis labels, one of them in the grid's empty cell (in the 1.1.0 gallery too). The example passes empty labels. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- CHANGELOG.md | 4 ++++ examples/plot_shapes_zoo.py | 6 +++++- notes/session_2026-11-21_release-1.1.1.md | 11 +++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfbecf686..2f51b3350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,10 @@ draws into a figure the caller built, found by executing notebooks with different on every docs build (cluster colors permuted; a different UMAP layout). Both now pass `random_state=0`, so every gallery figure that does not read live data is the same from build to build. +- **`plot_shapes_zoo.py`: no stray axis labels.** The biplane is the one + shape that loads as a DataFrame (columns `x`, `y`, `z`), so its panel + alone carried axis labels, one of them out in the grid's empty cell. The + example now passes empty labels. ### Documented limitations diff --git a/examples/plot_shapes_zoo.py b/examples/plot_shapes_zoo.py index e63c241fb..8d060b2ba 100644 --- a/examples/plot_shapes_zoo.py +++ b/examples/plot_shapes_zoo.py @@ -25,6 +25,10 @@ # fits each panel's own reduction separately, exactly as the equivalent # per-panel hyp.plot(shape, ax=ax) loop did, since these clouds differ # enough in scale that one shared fit would be dominated by the largest. +# The biplane loads as a DataFrame with columns x, y and z, which hypertools +# would write beside that one panel as axis labels; the empty labels keep +# all seven panels alike. hyp.plot([hyp.load(shape) for shape in shapes], ',', color='k', panels=(2, 4), panel_fit='independent', - title=[shape.capitalize() for shape in shapes], size=(12, 6)) + title=[shape.capitalize() for shape in shapes], size=(12, 6), + xlabel='', ylabel='', zlabel='') diff --git a/notes/session_2026-11-21_release-1.1.1.md b/notes/session_2026-11-21_release-1.1.1.md index efc8bf1ca..c98e59d2c 100644 --- a/notes/session_2026-11-21_release-1.1.1.md +++ b/notes/session_2026-11-21_release-1.1.1.md @@ -355,3 +355,14 @@ unattended; the user is on a phone. (same as the bare-name form already did). Regression test in `tests/test_reduce_third_party_warnings.py`; changelog entry. The first gallery build from the release commit was stopped for this and restarted. +- Own review of all 89 figures (contact sheets, 117 tiles: every still, + middle and last frame of every animation): everything matches 1.1.0 + apart from the three explained cases. One defect that 1.1.0 has too: + `plot_shapes_zoo_001.png` showed stray x/y/z axis labels beside the + Biplane panel (the biplane loads as a DataFrame, the other six shapes as + arrays; column names become axis labels by design). Example now passes + `xlabel='', ylabel='', zlabel=''`. Second gallery build stopped and + restarted for this. +- Observed, left as is (faithful rendering of raw data, same as 1.1.0): + in `plot_datasets_tour_001.png` the penguins and Kaggle-iris panels are + near-lines because one unnormalized column dominates. From 46c3bb39dc6aa505c4dc8cdd4633b760c7c059d3 Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sun, 22 Nov 2026 00:07:31 -0500 Subject: [PATCH 4/7] release: date 1.1.1 2026-11-22; notes on the gallery review Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- CHANGELOG.md | 2 +- notes/release_notes_v1.1.1_draft.md | 5 ++++ notes/session_2026-11-21_release-1.1.1.md | 28 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f51b3350..380106e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.1.1 (2026-11-21) +## 1.1.1 (2026-11-22) A patch release: three fixes for noise and side effects met when `hyp.plot` draws into a figure the caller built, found by executing notebooks with diff --git a/notes/release_notes_v1.1.1_draft.md b/notes/release_notes_v1.1.1_draft.md index 6786d507e..24897412d 100644 --- a/notes/release_notes_v1.1.1_draft.md +++ b/notes/release_notes_v1.1.1_draft.md @@ -19,6 +19,11 @@ Python 3.10 through 3.13. Extras are unchanged from 1.1.0. - **A legend or title added to the caller's axes is fitted automatically, inside that axes' own room.** Through 1.1.0 a `legend=` beside a caller's axes was fitted by widening the caller's figure, which stretched its other axes and switched off its layout engine. Now, when the figure is drawn, only the axes passed as `ax=` is narrowed just far enough that its legend ends before the canvas edge or the next panel, and lowered just far enough that its title stays on the canvas. No call is needed, and the fit follows a later `fig.tight_layout()`, `fig.subplots_adjust(...)`, resize or save. A legend with no room beside the axes is drawn inside it; one too large for its panel either way is left in place with a `UserWarning` naming the remedies. - **No `findfont` log lines for ordinary text under matplotlib 3.11 ([#292](https://github.com/ContextLab/hypertools/issues/292)).** matplotlib 3.11 logs a line each time a family in the font list has no face at a text's exact weight; one of the fallback families hypertools listed has no regular face on macOS, so every figure logged the line several times. Fallback families with no regular-weight face are now left out of the list. - **A Yahoo Finance rate limit is reported as one.** `hyp.load('yahoo:')` reported an HTTP 429 from Yahoo as a JSON decoding failure. The error now says that Yahoo is rate-limiting the address and to try again later. +- **A seeded UMAP no longer warns about `n_jobs`.** A seed passed in the `reduce` dict (`reduce={'model': 'UMAP', 'kwargs': {'random_state': 0}}`) drew umap-learn's "n_jobs value 1 overridden to 1" warning; it is now quiet, like the top-level `random_state=`. + +## Documentation + +- Two gallery examples (`plot_colorbar.py`, `plot_digits.py`) are now seeded, so their figures are the same on every docs build, and `plot_shapes_zoo.py` no longer shows stray axis labels beside one panel. ## Upgrading from 1.1.0 diff --git a/notes/session_2026-11-21_release-1.1.1.md b/notes/session_2026-11-21_release-1.1.1.md index c98e59d2c..6ed853e93 100644 --- a/notes/session_2026-11-21_release-1.1.1.md +++ b/notes/session_2026-11-21_release-1.1.1.md @@ -366,3 +366,31 @@ unattended; the user is on a phone. - Observed, left as is (faithful rendering of raw data, same as 1.1.0): in `plot_datasets_tour_001.png` the penguins and Kaggle-iris panels are near-lines because one unnormalized column dominates. + +### 2026-11-22 (after midnight) + +- Independent reviews of all 117 tiles (fresh subagent; Codex CLI with the + ten contact sheets attached): no regression from 1.1.0; the three + differing figures judged harmless; both flagged the shapes-zoo labels + (fixed). Minor points they raised that are IDENTICAL in the released + 1.1.0 and were left for the user to decide: conversation clip's box + touches the left canvas edge; teapot is faint under the one-pixel + marker; two label boxes overlap in `plot_labels`; market-sectors legend + sits close to the box in the GIF thumbnail; weather clip's last marker is + half clipped at the right edge. +- Third build (from a7dfad3a, 51 of 51 executed): 136 of 140 media files + byte-identical to the reviewed e3abb840 build; the four that differ are + the three changed examples (colorbar_002, digits_003, shapes_zoo_001 and + its thumbnail). Viewed all three: correct. +- Page-text diff against 1.1.0 (versions and timings normalized) found one + environment artifact: `plot_datasets_tour` printed kagglehub's "outdated + version (installed: 1.0.2)" notice. Upgraded kagglehub in the build venv + to 1.0.3. +- The date rolled over during the build. The release gate requires the + CHANGELOG heading not to be earlier than the release commit, and the + gallery record commit would be dated 2026-11-22, so the heading is now + 2026-11-22 and the gallery is rebuilt once more from this commit (the + gate allows only the record commit after the build). +- Issue #295 (animate= with panels=, per-frame caption, +faststart) was + filed 2026-11-22 from the timecorr work. It is a feature request, not in + this build; whether it goes into 1.1.1 is the user's decision. From d743ff5de886b10d572f63ba08ffd1c37f58da87 Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sun, 22 Nov 2026 00:45:20 -0500 Subject: [PATCH 5/7] release: record the pre-built gallery Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- docs/prebuilt_gallery.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/prebuilt_gallery.json b/docs/prebuilt_gallery.json index 5e9b85333..5b5129f43 100644 --- a/docs/prebuilt_gallery.json +++ b/docs/prebuilt_gallery.json @@ -1,5 +1,5 @@ { - "commit": "c90dd87e32e545ad17d12f2568993fbd0fc55f24", - "source_commit": "514a12cb72269baca147a12d8c4cd8a783e4dd54", + "commit": "2cf4fd0dd9fe7d49e82ac91d007d3ffd7c3a54a6", + "source_commit": "46c3bb39dc6aa505c4dc8cdd4633b760c7c059d3", "version": "1.1.1" } From 12e98347ace2fedd241a1d1623799eeee03ae648 Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sun, 22 Nov 2026 01:38:39 -0500 Subject: [PATCH 6/7] test: the no-warning forecast animation tests do not depend on machine speed On a slow Windows runner two Kalman fits took 0.5 s, so the 'needs 8 forecast fits ... roughly 12.8 s' notice fired inside tests that assert no warnings at all. Both pass slow_warning_seconds=None, as tests/plot/test_forecast_schedule.py does. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- notes/session_2026-11-21_release-1.1.1.md | 26 +++++++++++++++++++++++ tests/plot/test_predict_animation.py | 8 +++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/notes/session_2026-11-21_release-1.1.1.md b/notes/session_2026-11-21_release-1.1.1.md index 6ed853e93..05f388f62 100644 --- a/notes/session_2026-11-21_release-1.1.1.md +++ b/notes/session_2026-11-21_release-1.1.1.md @@ -394,3 +394,29 @@ unattended; the user is on a phone. - Issue #295 (animate= with panels=, per-frame caption, +faststart) was filed 2026-11-22 from the timecorr work. It is a feature request, not in this build; whether it goes into 1.1.1 is the user's decision. + +### Release commit, first cut (d743ff5d) and its CI + +- Fourth build (from 46c3bb39): all 140 media files byte-identical to the + third, no kagglehub notice. Full suite on 46c3bb39: 6910 passed, 24 + skipped, 0 failed. Rehearsal: REHEARSAL PASSED (full). +- Published `docs-gallery-v1.1.1` (2cf4fd0d), recorded it (d743ff5d), + pushed as `release/1.1.1` (PR #296), published `docs-notebooks/v1.1.1/`. + All 25 release gates passed locally and in a depth-1 clone with only + pytest, nbformat and nbclient installed. Built wheel + sdist, smoke + tested, created the DRAFT GitHub release (no tag). +- The user looked at the review page + (https://claude.ai/artifact/W1YfFGsWHoKsxh3ofWgmuj): "Updated gallery + looks good; changes all go in the right direction". +- CI on d743ff5d: 14 jobs green, `test (windows-latest, 3.11)` failed in + `tests/plot/test_predict_animation.py::test_the_plotly_backend_DRAWS_the_same_case_the_same_way`: + it asserts no warnings at all, and on that runner two Kalman fits took + 0.5 s, so hypertools' own "needs 8 forecast fits ... roughly 12.8 s" + notice fired. Machine-speed dependent, nothing to do with this change. + Fix: that test and its matplotlib twin pass `slow_warning_seconds=None`, + as `tests/plot/test_forecast_schedule.py` does. +- A new commit invalidates everything pinned to d743ff5d, so the gallery is + rebuilt from the new commit and both galleries, the dist files and the + draft release's assets are redone. +- Gap in the automatic "work in flight" check: it did not see the running + `wait-for-ci.py` waiter and asked for another. diff --git a/tests/plot/test_predict_animation.py b/tests/plot/test_predict_animation.py index c558e7f69..71fbb9f82 100644 --- a/tests/plot/test_predict_animation.py +++ b/tests/plot/test_predict_animation.py @@ -401,9 +401,12 @@ def test_hue_regrouping_now_ANIMATES_its_forecasts_like_the_static_plot(): labels = np.array(['a', 'a', 'b', 'b'] * 15) with warnings.catch_warnings(record=True) as caught: warnings.simplefilter('always') + # slow_warning_seconds=None: the "these forecast fits will take + # N s" notice depends on how fast the machine is (it fired on a + # slow Windows CI runner) and is not what this test is about fig, ani = hyp.plot(data, '-', predict='Kalman', t=3, hue=labels, animate=True, duration=2, frame_rate=4, - show=False) + show=False, slow_warning_seconds=None) assert not caught, [str(w.message) for w in caught] ax = _ax(fig) ani._func(6, *ani._args) # must not raise @@ -433,9 +436,10 @@ def test_the_plotly_backend_DRAWS_the_same_case_the_same_way(): with hyp.set_interactive_backend('plotly'): with warnings.catch_warnings(record=True) as caught: warnings.simplefilter('always') + # slow_warning_seconds=None: see the matplotlib twin above fig = hyp.plot(data, '-', predict='Kalman', t=3, hue=labels, animate=True, duration=2, frame_rate=4, - show=False) + show=False, slow_warning_seconds=None) assert not caught, [str(w.message) for w in caught] roles = [(tr.meta or {}).get('hyp_forecast_role') for tr in fig.data] assert 'live' in [r for r in roles if r is not None], roles From bceea7c253f8a14cf0aa6ae538e984636525eebd Mon Sep 17 00:00:00 2001 From: Jeremy Manning Date: Sun, 22 Nov 2026 02:11:41 -0500 Subject: [PATCH 7/7] release: record the pre-built gallery Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01DcKtysUSGLqA8RApYP9xYG --- docs/prebuilt_gallery.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/prebuilt_gallery.json b/docs/prebuilt_gallery.json index 5b5129f43..ac65d5ae4 100644 --- a/docs/prebuilt_gallery.json +++ b/docs/prebuilt_gallery.json @@ -1,5 +1,5 @@ { - "commit": "2cf4fd0dd9fe7d49e82ac91d007d3ffd7c3a54a6", - "source_commit": "46c3bb39dc6aa505c4dc8cdd4633b760c7c059d3", + "commit": "598c4d87cd56c0e02d45b7282716381458673ab9", + "source_commit": "12e98347ace2fedd241a1d1623799eeee03ae648", "version": "1.1.1" }