docs: remove the Finished./Finish. notebook-generation crutch - #39
Merged
Conversation
1 occurrences: 1 trailing block. These trailing docstring blocks were a crutch against notebook generation "cutting off weird" when a script's last cell was not a docstring. That shape converts correctly and is now pinned by a regression test in PyAutoHands (PyAutoLabs/PyAutoHands#214), so the crutch is dead weight — it rendered as a pointless final markdown cell in every generated notebook. Refs PyAutoLabs/PyAutoHands#211 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013XzXdQMU3KV2tyZaMNPvsM
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.
Removes the
Finished./Finish.notebook-generation crutch fromHowToFit— 1 occurrence: 1 trailing block.Artifacts: 1 notebook regenerated.
Why
These trailing docstring blocks were a crutch against notebook generation "cutting off weird" when a script's last cell was not a docstring. That belief is obsolete: deleting the block and running the real
add_notebook_quotes→ipynb-py-convertchain gives a complete, unmangled final code cell, and PyAutoLabs/PyAutoHands#214 addstest_script_ending_in_code_keeps_a_complete_final_code_cellto pin it. The crutch rendered as a pointless final markdown cell in every generated notebook.Shapes handled
A blanket regex would be wrong — five distinct shapes exist and each needs different handling. The sweep used Python's own
tokenizeto locate the exact string token each occurrence lives in, because a line-based scanner cannot tell a narrative docstring's bare delimiter from a function docstring that opens with text on the delimiter line, and this corpus contains both.Verification
black --checkclean.__Env__section turns the canonical merged form into the standalone-fallback form; both are supported. Checked by runningenv_config.read_env_declarationon the old and new content of all 169 changed files across the series: 169 unchanged, 0 changed, 0 errors..pyfiles; the first attempt normalised them and rewrote whole files (~6000 line churn). The sweep reads and writes withnewline="", so the diff is deletions only.# %%or''', and no notebook has aFinish.markdown cell.Merge order
PyAutoLabs/PyAutoHands#214 merges first — this repo invokes
../PyAutoHands/autohands/generate.pyfrom the local checkout, so the regenerated notebooks here are only correct against that version.Part of PyAutoLabs/PyAutoHands#211.
🤖 Generated with Claude Code
https://claude.ai/code/session_013XzXdQMU3KV2tyZaMNPvsM