fix inference of shape from labels#41751
Merged
vbraun merged 3 commits intosagemath:developfrom Mar 22, 2026
Merged
Conversation
mantepse
commented
Mar 4, 2026
|
Documentation preview for this PR (built with commit 7e1d4a1; changes) is ready! 🎉 |
tscrim
approved these changes
Mar 6, 2026
Collaborator
tscrim
left a comment
There was a problem hiding this comment.
LGTM modulo a minor function renaming.
| return (list(shape), [0]*len(shape)) | ||
|
|
||
| def _process_filling_and_shape(self, filling, shape): | ||
| def _process_filling_and_shape(self, filling, shape, labels): |
Collaborator
There was a problem hiding this comment.
Suggested change
| def _process_filling_and_shape(self, filling, shape, labels): | |
| def _process_filling_shape_labels(self, filling, shape, labels): |
Might be a more accurate name given what it does.
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Mar 21, 2026
sagemathgh-41751: fix inference of shape from labels In the forward case, that is, if `filling` is given, previously an unspecified `shape` was only inferred from the filling. However, if `labels` is given, we can better infer `shape` from these. URL: sagemath#41751 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton, Martin Rubey, Travis Scrimshaw
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 free
to 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.
In the forward case, that is, if
fillingis given, previously an unspecifiedshapewas only inferred from the filling. However, iflabelsis given, we can better infershapefrom these.