Skip to content

Refactor colorbar handling into class #168

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cvanelteren
Copy link
Contributor

@cvanelteren cvanelteren commented Apr 22, 2025

Why this PR?

The codebase currently contains mainy functions that have grown naturally over time. They are getting to a point where maintaining them because cumbersome. We start by moving the colorbar handling into a proper class and removing the monkey patches.

This is following #165 and #166

What this PR changes

It introduces a new class UltraColorbar which handles the colorbar settings and axis handling for the axes class effectively replacing Axes._add_colorbar and Figure.colorbar and integrating their logic. Note the functions will remain available to not break the backend but the internal logic is moved to the class.

@cvanelteren cvanelteren marked this pull request as draft April 22, 2025 10:36
@cvanelteren
Copy link
Contributor Author

Note to self: the current state is broken. At one of the earlier commits I was able to output the colorbar, but there was something broken with the minorticks being updated properly. I then rewrote the class and moved some of the input parsing to a dataclass to enhance clarity and remove verbosity inside the class to focus on the logical operators.

It still needs a lot of work but we will slowly get there.

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.

1 participant