SmartPlotter simplification by delegating each plot type to a separate function file #582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #581
Description
In this PR, we have initiated the refactoring of the
SmartPlotter
class by extracting the plotting logic into separate functions, each housed in its own Python file. The goal of this first phase is to keep the core data processing and display strategy logic intact while decoupling the plotting responsibility. This helps in simplifying the class and making the code more modular, maintainable, and testable.Key Changes:
Decoupled Plotting Functions: Each type of plot previously managed by
SmartPlotter
has been moved to its own Python file as a standalone function. These functions are now responsible for rendering the respective plots.Updated
SmartPlotter
: TheSmartPlotter
class remains in charge of preparing the data and determining which plot to display based on the use case. The class now delegates the actual rendering of the plot to the newly created plotting functions.Benefits:
SmartPlotter
: By moving the plotting logic out,SmartPlotter
is now focused on handling data and managing display strategies, rather than also managing the intricacies of every plot.SmartPlotter
, without needing to modify the core class itself.Next Steps:
This is just the first step in simplifying the
SmartPlotter
class. Future refactoring efforts could focus on further simplifying the data processing and display strategies, or on improving the interface for selecting and configuring plots.