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

Tweak shape repr in _api.check_shape error message. #26513

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 13, 2023

Fill in "None" dims from the end with the letters N, M, L, K, ... so as to get e.g. "(N, 2)", "(M, 2, N)", "(L, M, N)", etc.

PR summary

PR checklist

@@ -151,12 +151,10 @@ def check_shape(shape, /, **kwargs):
if (len(data_shape) != len(shape)
or any(s != t and t is not None for s, t in zip(data_shape, shape))):
dim_labels = iter(itertools.chain(
'MNLIJKLH',
'NMLIJKLH',
Copy link
Member

Choose a reason for hiding this comment

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

It's not new, but should L appear in this list twice? That seems odd/likely for unintended

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed, fixed.

Fill in "None" dims *from the end* with the letters N, M, L, K, ... so
as to get e.g. "(N, 2)", "(M, 2, N)", "(L, M, N)", etc.
@ksunden ksunden added this to the v3.8.0 milestone Aug 15, 2023
@ksunden ksunden merged commit 0e3fd10 into matplotlib:main Aug 15, 2023
39 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 15, 2023
QuLogic added a commit that referenced this pull request Aug 16, 2023
…513-on-v3.8.x

Backport PR #26513 on branch v3.8.x (Tweak shape repr in _api.check_shape error message.)
@anntzer anntzer deleted the csn branch August 16, 2023 08:18
@ksunden ksunden mentioned this pull request Sep 15, 2023
5 tasks
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.

None yet

3 participants