Repository navigation
plot_network caption, reserved legend rows, x264 preset (0.2.0) - #191
Merged
Merged
Conversation
…raws a frame's caption plot_network now finishes its image with _finish_frame, the function that finishes each animate_network frame, so caption=text gives the frame of a one-window movie with captions=[text]: a _with_header band without views, legend and frame_size, else a line under the view titles. caption=None renders as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
legend=[[], row] or [row, []] leaves a band of the normal row height in the background color where the empty row is, in plot_network and animate_network; a legend of empty rows only reserves its bands. legend=[] still raises ValueError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
…mate_network preset is one of x264's ten preset names, else ValueError naming the value and the allowed names; with a GIF it raises ValueError as crf and faststart do. preset=None passes no -preset, so the encoding is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
Changelog 0.2.0 items and design-spec paragraphs for the three additions; tutorial 11 shows a captioned still with legend=[[], row], tutorial 10's re-encoding cell adds crf=28 with preset="slow" (sizes now in three decimals). Both notebooks re-executed; no asset's code changed, so the committed assets are kept. Docstrings say slower presets usually give smaller files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
…errors, caption claims - An empty legend row's band is cleared to the background after the views are drawn, so it no longer holds the end of the divider between views; frames without empty rows are pixel-identical. - For a GIF, crf or faststart without preset raise the error message of 56cb1a1; preset is named only when one was given. - plot_network's caption docstring no longer says the still always equals a one-window movie frame: the caption is drawn by the same code, and the images are equal where both crops are the same. - Tests assert the whole blank band, pin the old GIF messages, and check the caption of a titled, fixed-size still on its own (dark text under the titles; panes lower and, in a height-limited frame, shorter). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
…y precisely Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three options for the 0.2.0 network plots and animations, found while a downstream tutorial was ported to the 0.2.0 API (follow-up to #188 / #189).
What changes
plot_network(..., caption=None)animate_networkframe's caption: under the view titles withviews,legendorframe_size; in a band above the image otherwise.legend=[[], row]orlegend=[row, []]reserves one blank band of the normal row height in that position, inplot_networkandanimate_network.legend=[]still raises.preset=Nonewrite_animationandanimate_network: the x264-presetname (ultrafast ... placebo). An unknown name raisesValueError; GIF output raises, ascrfdoes.HTFAResults.plot_networkforwardscaption. The changelog's 0.2.0 section, the design spec, and tutorials 10 and 11 describe the three options.Behavior of existing calls
Calls that pass none of the three arguments are unchanged: 6 edge-free stills and the frames and mp4 bytes of 2 captioned movies are identical to 56cb1a1 (14 of 14 files).
preset=Nonegives byte-identical files. The GIF error messages forcrfandfaststartkeep their text when no preset is given.A still with
caption=equals a one-window movie frame with the same caption when both crop boxes match (always withoutviews,legendorframe_size); with those arguments a still's crop comes from the nodes as drawn and a movie's from opaque nodes at their largest radius, so the framing can differ.One existing test changed
test_legend_validationexpectedlegend=[[]]to raise; with the empty-row rule it is valid. The other invalid cases stay, and a row mixed with a bare entry was added.Checks
make lintclean;make test1227 passed, 19 skipped (before the review fixes); after themtests/test_brainnet.py,tests/test_headless.py,tests/test_docs.py185 passed, 5 skipped;make docs0 warnings.🤖 Generated with Claude Code
https://claude.ai/code/session_01DcKtyt2ULJKvi7Z1bbZU4G