Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_theme() should accept feature_list #1078

Merged
merged 3 commits into from
Apr 15, 2024
Merged

set_theme() should accept feature_list #1078

merged 3 commits into from
Apr 15, 2024

Conversation

RYangazov
Copy link
Contributor

@RYangazov RYangazov commented Apr 11, 2024

@RYangazov RYangazov force-pushed the set-theme branch 3 times, most recently from 48de488 to 0b69e40 Compare April 11, 2024 15:43
@RYangazov RYangazov marked this pull request as ready for review April 11, 2024 15:44
@RYangazov RYangazov changed the title Set multiple themes and flavors set_theme() should accept feature_list Apr 11, 2024
@RYangazov RYangazov requested a review from alshan April 11, 2024 15:51
theme_name = theme_options.pop('name', None)
plot_spec += FeatureSpec('theme', theme_name, **theme_options)

if theme_options.get('feature-list') is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is 3rd place where we merge 2 or more themes to 1. First two are:

This would result in too many duplications. We need to factor out and reuse as much code as possible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

if 'feature-list' in theme_options:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't merge theme configs, only store them. A merge is done by these two places.
We changed the way how we store a config from JSON to API objects.
Now it should be clear that this code is only used to delegate the config merge to this "mergers".
If we need to refactor this duplication from the links, I propose to do it with another PR, as it can be tricky.

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.

2 participants