Uh oh!
There was an error while loading. Please reload this page.
Let plot_dataset take back the colorbars it returns - #8448
Open
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 1 commit into
Open
Let plot_dataset take back the colorbars it returns#8448Jens Hedegaard Nielsen (jenshnielsen) wants to merge 1 commit into
Jens Hedegaard Nielsen (jenshnielsen) wants to merge 1 commit into
Conversation
plot_dataset returns a list of colorbars whose entries are None for the 1D plots, but its colorbars argument only accepted a sequence that was either all colorbars or all None. Passing the result back in, which is how the offline plotting tutorial plots into the same axes again, was therefore a type error. Take a Sequence[Colorbar | None]. A Sequence[Colorbar] is still one of those, so nothing that worked before stops working, and the body already built and handled lists containing None. plot_by_id forwards to plot_dataset and returns the same type, so it is widened with it.
Jens Hedegaard Nielsen (jenshnielsen)
requested a review
from a team
as a code ownerAugust 26, 2026 08:59
Jens Hedegaard Nielsen (jenshnielsen)
enabled auto-merge
August 26, 2026 08:59
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #8448 +/- ##
=======================================
Coverage 71.12% 71.12% =======================================
Files 305 305 Lines 31952 31952 =======================================
Hits 22725 22725 Misses 9227 9227 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
plot_dataset returns a list of colorbars whose entries are None for the 1D plots, but its colorbars argument only accepted a sequence that was either all colorbars or all None. Passing the result back in, which is how the offline plotting tutorial plots into the same axes again, was therefore a type error.
Take a Sequence[Colorbar | None]. A Sequence[Colorbar] is still one of those, so nothing that worked before stops working, and the body already built and handled lists containing None.
plot_by_id forwards to plot_dataset and returns the same type, so it is widened with it.
Lifted from #8441