Skip to content

refactor: drop dead locals + remove unused CodeTemplate#150

Merged
devdanzin merged 1 commit into
mainfrom
generator-cleanup-dead-code
Jun 30, 2026
Merged

refactor: drop dead locals + remove unused CodeTemplate#150
devdanzin merged 1 commit into
mainfrom
generator-cleanup-dead-code

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

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 with ruff --isolated).
  • write_code.py: remove CodeTemplate (−40 LOC) and its now-unused re/textwrap imports. 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 types into the adjacent compare_results write_block (they belong to that helper) — the last small static self.write run.

Verification

Golden snapshot unchanged; h5py harness byte-identical; 328 OK; ruff check + ruff format --check clean.

🤖 Generated with Claude Code

…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>
@devdanzin devdanzin merged commit b4b1a83 into main Jun 30, 2026
2 checks passed
@devdanzin devdanzin deleted the generator-cleanup-dead-code branch June 30, 2026 09:34
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.

1 participant