Skip to content

Remove dead/unreachable code in layer_strategies.py #105

Closed

Description

@CameronBrooks11

What

Remove dead/unreachable code in layer_strategies.py.

Why

Two spots are confusing dead code:

  1. build_layer_summary has an if isinstance(layer, HelicalLayer): return base / return base where both branches return the identical string — the conditional does nothing.
  2. The num_circuits % pattern_number != 0 warn-and-silently-return block is now unreachable: validate_helical_layer() raises on that exact condition upstream before dispatch. The silent-skip also contradicts the raise-on-invalid convention used everywhere else and could mask a config error if validation were ever bypassed.

Where

  • fiberpath/planning/layer_strategies.py:25 — build_layer_summary identical branches
  • fiberpath/planning/layer_strategies.py:126–132 — unreachable divisibility warn/return

Acceptance criteria

  • build_layer_summary simplified to a single return (or given a real reason to branch)
  • Unreachable divisibility block removed (validation upstream is the single source of truth)
  • Planner tests still pass

Activity

  1. added
    python
    on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    python

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions