Skip to content

Feature: allow cycle objects to be set on rc - #378

Merged
cvanelteren merged 5 commits into
Ultraplot:mainfrom
cvanelteren:allow-cycle-instance
Oct 25, 2025
Merged

Feature: allow cycle objects to be set on rc#378
cvanelteren merged 5 commits into
Ultraplot:mainfrom
cvanelteren:allow-cycle-instance

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

Closes#200

With the improved Configurator instantiation, we can now more easily allow for cycle passing to enhance user experience to define default cycle colors. This PR introduces the ability for users to pass on lists of colors or Cycle objects directly.

@cvanelterencvanelteren changed the title Allow cycle instanceFeature: allow cycle objects to be set on rcOct 25, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 enables users to set cycle objects directly on the rc configuration, improving user experience for defining default cycle colors. Users can now pass color lists or Cycle objects in addition to string names.

Key Changes:

  • Extended _validate_cmap function to handle Cycle objects and color lists when validating cycle configurations
  • Added test coverage for different cycle input formats (string names, color lists, Cycle objects, and invalid inputs)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

FileDescription
ultraplot/internals/rcsetup.pyModified _validate_cmap to accept and validate Cycle objects and iterables when cycle=True parameter is set
ultraplot/tests/test_config.pyAdded parameterized test to verify cycle setting behavior with various input types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadultraplot/internals/rcsetup.py
Comment threadultraplot/internals/rcsetup.py
@cvanelteren
cvanelteren enabled auto-merge (squash) October 25, 2025 15:07
@codecov

codecovBot commented Oct 25, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing linesPatch %Lines
ultraplot/internals/rcsetup.py87.50%0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@cvanelteren
cvanelteren merged commit 4ac496f into Ultraplot:mainOct 25, 2025
25 checks passed
Sign up for freeto 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.

how to set the default color cycle

2 participants

@cvanelteren