refactor: drop dead locals + remove unused CodeTemplate#150
Merged
Conversation
…ic block Cleanup follow-up to the generator refactor (under #106). - write_h5py_code.py: remove the dead `fs_kwargs_expr` local in `_write_h5py_file` (assigned "for logging" but never read; the only F841 in the file once the per-file ignore is bypassed). - write_code.py: remove `CodeTemplate` (−40 LOC) and its now-unused `re`/`textwrap` imports. It was dead since the JIT subsystem was deleted, and its distinctive feature (injecting a re-indented MULTI-LINE value into a `{placeholder}`) is not needed anywhere -- every generator block interpolates only scalars, which f-strings handle. write_block + f-strings cover all fixed-shape needs. - write_python_code.py: fold the `# Helper...` comment + `import math`/`import types` into the adjacent `compare_results` write_block (they belong to that helper). All behaviour-preserving: golden snapshot unchanged, h5py harness byte-identical, 328 OK, ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Cleanup follow-up to the generator refactor (under #106).
write_h5py_code.py: remove the deadfs_kwargs_exprlocal in_write_h5py_file(assigned "for logging" but never read — the onlyF841in the file once the per-file ignore is bypassed withruff --isolated).write_code.py: removeCodeTemplate(−40 LOC) and its now-unusedre/textwrapimports. It has been dead since the JIT subsystem was deleted. Its distinctive feature — injecting a re-indented multi-line value into a{placeholder}— isn't needed anywhere: every fixed-shape block in the generator interpolates only scalars/identifiers, which f-strings handle.write_block+ f-strings cover all current needs. (If a future block needs multi-line placeholder substitution, revive from git history.)write_python_code.py: fold the# Helper…comment +import math/import typesinto the adjacentcompare_resultswrite_block(they belong to that helper) — the last small staticself.writerun.Verification
Golden snapshot unchanged; h5py harness byte-identical; 328 OK;
ruff check+ruff format --checkclean.🤖 Generated with Claude Code