Skip to content

fix: fixes #58 loop dim of (1,) gets squeezed for field qtys#59

Merged
eckelsjd merged 1 commit intomainfrom
fix-singleton
Nov 18, 2025
Merged

fix: fixes #58 loop dim of (1,) gets squeezed for field qtys#59
eckelsjd merged 1 commit intomainfrom
fix-singleton

Conversation

@eckelsjd
Copy link
Copy Markdown
Owner

Fixes #58

Proposed Changes

  • Do not squeeze (1,) dims from loop shape or output shape in utils.format_outputs()
  • Handle special serial cases in Component.call_model so singletons don't get an extra dim

Note: this means field quantities returned by Component.predict() or similar will have a leading (1,) dimension to match other scalar return arrays (when the loop dim is (1,), otherwise the behavior is unchanged). We are defining this as the desired behavior, as it is better to be consistent across all return values.

@eckelsjd eckelsjd merged commit 0aa1ed7 into main Nov 18, 2025
7 of 10 checks passed
@eckelsjd eckelsjd deleted the fix-singleton branch November 18, 2025 13:26
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.

Loop shape of (1,) mistakenly squeezed for single sample predictions

1 participant