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 = False
Acceptance Criteria
Dependencies
Description
Similar to PlotterConfig, the
_AbstractLayer.__init__takes 10 parameters that are repeated in Layer2D/Layer3D. Create aLayerConfigdataclass.Current Problem
Layer constructors have long parameter lists:
Proposed Solution
Acceptance Criteria
LayerConfigdataclass inconfig.py_AbstractLayerto use the config internallyDependencies