Skip to content

fix: remove dead import and redundant entry dicts in generate_sweep_configs#1095

Closed
aryanputta wants to merge 1 commit intoSemiAnalysisAI:mainfrom
aryanputta:fix/remove-dead-code-generate-sweep-configs
Closed

fix: remove dead import and redundant entry dicts in generate_sweep_configs#1095
aryanputta wants to merge 1 commit intoSemiAnalysisAI:mainfrom
aryanputta:fix/remove-dead-code-generate-sweep-configs

Conversation

@aryanputta
Copy link
Copy Markdown

Summary

Two dead code issues in utils/matrix_logic/generate_sweep_configs.py:

  • Unused import: from ast import ForFor is an AST node class that's never referenced in this file. Left over from an earlier draft, importing it silently pulls in ast for no reason.
  • Redundant dict construction: In both the multinode and single-node branches of generate_full_sweep(), an entry dict was built and immediately thrown away because the very next line starts a for runner_value in runners_for_entry: loop that rebuilds an identical dict. The outer construction was dead code — it was never validated or appended. Removed it and hoisted seq_len_str / runners_for_entry above the loop where they belong.

Test plan

  • python3 -c "from utils.matrix_logic.generate_sweep_configs import generate_full_sweep" — no ImportError
  • Existing unit tests pass: python3 -m pytest utils/matrix_logic/
  • Output of generate_full_sweep is identical before and after (behavior unchanged, only dead code removed)

…onfigs

Two dead code issues in generate_full_sweep():

1. `from ast import For` at the top of the file — For is an AST node
   class that is never referenced anywhere in this module. Left over
   from an earlier draft.

2. In both the multinode and single-node branches, an `entry` dict was
   built and immediately discarded because it was unconditionally
   overwritten by an identical dict inside the `for runner_value`
   loop. Removed the outer construction and hoisted the
   `runners_for_entry` and `seq_len_str` assignments above the loop
   where they belong.

Signed-off-by: Aryan Putta <aryansputta@gmail.com>
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Collaborator

@Oseltamivir Oseltamivir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no impact PR, merged with #1096

@aryanputta aryanputta deleted the fix/remove-dead-code-generate-sweep-configs branch April 20, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants