-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Similar to PlotterConfig, the _AbstractLayer.__init__ takes 10 parameters that are repeated in Layer2D/Layer3D. Create a LayerConfig dataclass.
Current Problem
Layer constructors have long parameter lists:
def __init__(
self,
plotter_x_min: float,
plotter_y_min: float,
plotter_x_max: float,
plotter_y_max: float,
feed_rate: float,
handle_out_of_bounds: THandleOutOfBounds,
color: Optional[str],
line_width: float,
include_comments: bool,
preview_only: bool = False,
): ...Proposed Solution
@dataclass
class LayerConfig:
plotter_x_min: float
plotter_x_max: float
plotter_y_min: float
plotter_y_max: float
feed_rate: float
handle_out_of_bounds: HandleOutOfBounds
include_comments: bool
color: Optional[str] = None
line_width: float = 2.0
preview_only: bool = FalseAcceptance Criteria
- Create
LayerConfigdataclass inconfig.py - Update
_AbstractLayerto use the config internally - Layer2D and Layer3D use simplified constructors
- Docstrings reference the config class
- All existing tests pass
Dependencies
- Depends on Simplify type aliases in shared_types.py #57 (type alias changes)
- Depends on Create PlotterConfig dataclass to reduce parameter sprawl #59 (PlotterConfig pattern established)
Metadata
Metadata
Assignees
Labels
No labels