Skip to content

Fix scalar subsetting reductions and C-bridge dim handling - #65

Merged
t-kalinowski merged 3 commits into
mainfrom
fix-scalar-subset-dims
Dec 10, 2025
Merged

Fix scalar subsetting reductions and C-bridge dim handling#65
t-kalinowski merged 3 commits into
mainfrom
fix-scalar-subset-dims

Conversation

@t-kalinowski

Copy link
Copy Markdown
Owner

Fixes #64

  • scalar subsetting now preserves scalar-ness so reductions like min(m[a, 1], m[b, 1]) no longer emit minval on scalars, avoiding the Fortran compile error shown in the report.
  • [ translation now tracks axis via imap and carries correct dim info for logical/missing subscripts; C bridge generation strips dim names to prevent drop=FALSE failures.
  • Added broad tests covering scalar/packed/logical subsetting and reduction intrinsics (scalar, multi-arg, masked) to exercise all code paths.

- Treat scalar arguments as non-reduced in max/min/sum/prod.
- Fix `[` handling of `drop` and missing args; drop scalar
  subscripts and keep axis dims for logical scalars.
- Guard assignment metadata capture.
- Add tests for scalar reductions and tidy multiple-return test spacing.
- Keep names(c_dims) cleared before C glue to avoid named dims breaking bridge generation.
- Preserve axis sizes when expanding logical/missing subscripts by using imap and per-axis dims.
- Keep is_missing minimal.
- Add regression tests for subsetting and reductions, including a 1x1 drop=FALSE case that fails
  without the dim-name strip.
@t-kalinowski
t-kalinowski merged commit 2169eeb into main Dec 10, 2025
5 checks passed
@t-kalinowski
t-kalinowski deleted the fix-scalar-subset-dims branch December 10, 2025 17: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.

Compilation error with indexing and min()

1 participant