-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Several instruction classes don't properly inherit from a base class, breaking type inference:
InstructionFeedRatehas no parent classInstruction3DPrinterPlottingHeighthas no parent classInstruction3DPrinterNavigationHeighthas no parent class
Create a Protocol that all instruction classes implement, ensuring consistent interface.
Proposed Changes
Add to instruction module:
from typing import Protocol
class Instruction(Protocol):
def to_g_code(self) -> str: ...
def __str__(self) -> str: ...Ensure all instruction classes either:
- Inherit from a common base class, OR
- Implement the Protocol interface
Acceptance Criteria
- Create
Instructionprotocol in instruction module -
InstructionFeedRateimplements the protocol (add_BaseInstructioninheritance or ensure protocol compliance) -
Instruction3DPrinterPlottingHeightimplements the protocol -
Instruction3DPrinterNavigationHeightimplements the protocol - Update
TInstructionUniontype in_Layer.pyto use the protocol - All existing tests pass
- mypy passes with no new errors
Metadata
Metadata
Assignees
Labels
No labels