Description
The _AbstractPlotter.__init__ takes 10 parameters, and these are repeated in Plotter2D/Plotter3D docstrings. Introduce a PlotterConfig dataclass to group common configuration.
Current Problem
def __init__(
self,
title: str,
x_min: float,
x_max: float,
y_min: float,
y_max: float,
feed_rate: float,
handle_out_of_bounds: THandleOutOfBounds,
output_directory: str,
include_comments: bool,
return_home_before_plotting: bool,
): ...
Proposed Solution
@dataclass
class PlotterConfig:
title: str
x_min: float
x_max: float
y_min: float
y_max: float
feed_rate: float
handle_out_of_bounds: HandleOutOfBounds = "Warning"
output_directory: str = "./output"
include_comments: bool = True
return_home_before_plotting: bool = True
The plotter classes can then accept either individual parameters (for backwards compatibility) or a config object.
Acceptance Criteria
Dependencies
Description
The
_AbstractPlotter.__init__takes 10 parameters, and these are repeated in Plotter2D/Plotter3D docstrings. Introduce aPlotterConfigdataclass to group common configuration.Current Problem
Proposed Solution
The plotter classes can then accept either individual parameters (for backwards compatibility) or a config object.
Acceptance Criteria
PlotterConfigdataclass in a newconfig.pyfile_AbstractPlotterto use the config internallyPlotterConfigfrom package__init__.pyDependencies