Skip to content

Conversation

@GiulioRomualdi
Copy link
Member

Eliminate the redundant ColorPalette class and its associated matplotlib dependency. The ColorPalette functionality is now integrated into the utils module.

@GiulioRomualdi GiulioRomualdi requested review from Giulero, Copilot and traversaro and removed request for Copilot October 6, 2025 08:03
@GiulioRomualdi GiulioRomualdi self-assigned this Oct 6, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes a duplicated ColorPalette class and eliminates the matplotlib dependency by consolidating color palette functionality into the utils module. The change simplifies the codebase by removing redundancy and reduces dependencies.

  • Removed redundant ColorPalette class from the plotter module
  • Eliminated matplotlib dependency from setup.cfg
  • Enhanced the existing ColorPalette in utils with improved type hints and additional methods

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
setup.cfg Removed matplotlib dependency from install requirements
robot_log_visualizer/utils/utils.py Enhanced ColorPalette class with type hints, added default color cycle, and new methods
robot_log_visualizer/plotter/pyqtgraph_viewer_canvas.py Updated import and adapted code to use Color objects from utils ColorPalette
robot_log_visualizer/plotter/color_palette.py Completely removed the duplicated ColorPalette class file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +193 to +194
palette_color = next(self._palette)
pen = pg.mkPen(palette_color.as_hex(), width=2)
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The code now calls next(self._palette) and then palette_color.as_hex() separately. Consider using next(self._palette).as_hex() directly to avoid storing the intermediate Color object if it's not used elsewhere.

Suggested change
palette_color = next(self._palette)
pen = pg.mkPen(palette_color.as_hex(), width=2)
pen = pg.mkPen(next(self._palette).as_hex(), width=2)

Copilot uses AI. Check for mistakes.
@GiulioRomualdi GiulioRomualdi merged commit fa0fcd1 into main Oct 6, 2025
7 checks passed
@GiulioRomualdi GiulioRomualdi deleted the remove_matplotlib branch October 6, 2025 08:15
xela-95 pushed a commit to xela-95/robot-log-visualizer that referenced this pull request Oct 17, 2025
xela-95 pushed a commit to xela-95/robot-log-visualizer that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants