-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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 = TrueThe plotter classes can then accept either individual parameters (for backwards compatibility) or a config object.
Acceptance Criteria
- Create
PlotterConfigdataclass in a newconfig.pyfile - Update
_AbstractPlotterto use the config internally - Plotter2D and Plotter3D maintain backwards-compatible constructors
- Docstrings reference the config class instead of repeating all parameters
- All existing tests pass
- Export
PlotterConfigfrom package__init__.py
Dependencies
- Depends on Simplify type aliases in shared_types.py #57 (type alias changes)
Metadata
Metadata
Assignees
Labels
No labels