Repository navigation
refactor(core): minimal-first cleanups in core engine - #122
Merged
Merged
Conversation
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.
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.
Behavior-preserving simplifications surfaced by a minimal-first sweep (net −20 LoC):
AXIS_LOOKUP(XYZ-era leftover, verified unreferenced).self.message/self.layer_index(verified nothing reads them).sanitize_program→ one comprehension (no doublestrip())._wrap_xidentity helper (carriage axis is linear; only the mandrel axis wraps via_wrap).tow_length_sqwas a byte-identical copy ofdistance_sq→ reusedistance(one sqrt, same result; makes the tow==distance identity explicit).Verified: ruff/format/mypy clean; full
pytest119 passed; no functional change.