Refactor colorbar handling into class #168
Draft
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.
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 replacingAxes._add_colorbar
andFigure.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.