Skip to content

refactor(core): minimal-first cleanups in core engine - #122

Merged
CameronBrooks11 merged 1 commit into
mainfrom
refactor/core-minimal-cleanups
Jun 25, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
refactor/core-minimal-cleanups

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Behavior-preserving simplifications surfaced by a minimal-first sweep (net −20 LoC):

  • helpers.py: remove dead AXIS_LOOKUP (XYZ-era leftover, verified unreferenced).
  • exceptions.py: drop unused self.message/self.layer_index (verified nothing reads them).
  • generator.py: sanitize_program → one comprehension (no double strip()).
  • plotter.py: inline the no-op _wrap_x identity helper (carriage axis is linear; only the mandrel axis wraps via _wrap).
  • simulator.py: tow_length_sq was a byte-identical copy of distance_sq → reuse distance (one sqrt, same result; makes the tow==distance identity explicit).

Verified: ruff/format/mypy clean; full pytest 119 passed; no functional change.

Small, behavior-preserving simplifications (all verified unused/identical):

- planning/helpers.py: remove dead AXIS_LOOKUP dict (XYZ-era leftover, never
  referenced; get_axis_letter uses the dialect mapping).
- planning/exceptions.py: drop unused self.message / self.layer_index
  attributes (RuntimeError already carries the message; nothing reads them).
- gcode/generator.py: sanitize_program as a single comprehension (no double
  strip()).
- visualization/plotter.py: inline the no-op _wrap_x identity helper (the
  carriage axis is linear and never wraps; only the mandrel axis uses _wrap).
- simulation/simulator.py: tow_length_sq was an identical copy of distance_sq;
  reuse `distance` directly (one sqrt instead of two, same result).

Full pytest green (119 passed); no behavior change.
@CameronBrooks11 CameronBrooks11 added the python Pull requests that update Python code label Jun 25, 2026
@CameronBrooks11
CameronBrooks11 merged commit 2e0bc25 into main Jun 25, 2026
24 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/core-minimal-cleanups branch June 25, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant