Skip to content

Refactor Ops module to remove external dependencies on Command classes#246

Open
knipknap wants to merge 13 commits into
mainfrom
newops
Open

Refactor Ops module to remove external dependencies on Command classes#246
knipknap wants to merge 13 commits into
mainfrom
newops

Conversation

@knipknap
Copy link
Copy Markdown
Contributor

Summary

This PR refactors the Ops module to remove external dependencies on Command classes, absorbs bulk operations into Ops, adds index-based access methods along with a command type enum, and replaces dict return types with NamedTuples in the Ops read API.

Changes

  • Refactor Ops module to remove external dependencies on Command classes
  • Absorb bulk operations into Ops
  • Add index-based access methods along with command type enum
  • Replace dict return types with NamedTuples in Ops read API
  • Port remaining code and tests to the Ops index-based API
  • Port simulator, encoders and other code to the new index based Ops API

Testing

  • All existing tests pass with the new API
  • Added test coverage for new functionality

knipknap added 13 commits May 19, 2026 19:04
Add per-type accessors (bezier_params, power, speed, frequency,
pulse_width, laser_uid, layer_uid, workpiece_uid, section_params,
extra_axes, dwell_duration) and a linearize() method to Ops.
Migrate gcode, vertex, cairo, and ruida encoders from Command
object dispatch to CommandType/CommandCategory-based dispatch.
Port all transformers, producers, simulators, encoders, and ~700+
tests from direct Command/ops.commands usage to the index-based Ops
API. Add lazy state computation in clipping._get_state() to avoid
expensive preload_state() call. Update tracking docs to reflect
remaining work.
state_at(), preloaded_state() now return MachineState NamedTuple.
inspect() returns CommandInfo NamedTuple. This makes the read API
PyO3-friendly as required for the upcoming Rust port.
Inline group_by_state_continuity and flip_segment into Ops methods.
Delete group.py and flip.py. Refactor estimate_time to use Ops index
API instead of raw Command list. Add 42 tests covering 19 previously
untested public Ops methods.
- Add scripts/build-raygeo.sh for maturin wheel build/install
- Add raygeo-build, raygeo-check, raygeo-test pixi tasks
- Bump raygeo dependency to >=0.2.0
- Add patchelf to native dependencies
- Document raygeo section in AGENTS.md
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