Skip to content

Enable more reduction operations along multiple dimensions - #3673

Merged
nvaytet merged 3 commits into
mainfrom
multid-reduction
Mar 27, 2025
Merged

nvaytet merged 3 commits into
mainfrom
multid-reduction

Conversation

@nvaytet

@nvaytet nvaytet commented Mar 26, 2025

Copy link
Copy Markdown
Member

Fixes #3569

@nvaytet
nvaytet requested a review from Copilot March 26, 2025 17:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The purpose of this PR is to enable reduction operations along multiple dimensions.

  • Added a new test (test_reduce_two_dims) to verify that reduction functions work correctly when applied over multiple dimensions.
  • Refactored reduction functions in src/scipp/core/reduction.py to support multiple dimensions via the new _apply_op helper.
  • Updated docstrings and type hints across reduction functions to consistently indicate support for multiple dimensions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/core/reduction_test.py Introduced tests for multi-dimension reductions with various dimension orderings.
src/scipp/core/reduction.py Refactored reduction functions to leverage _apply_op for handling multiple dimensions.
Comments suppressed due to low confidence (1)

tests/core/reduction_test.py:981

  • [nitpick] Consider renaming 'possibles' to a more descriptive name like 'dim_permutations' to enhance code clarity.
possibles = (['xx', 'yy', 'zz'], ['yy', 'zz', 'xx'], ['zz', 'xx', 'yy'])

@nvaytet
nvaytet merged commit 0687af6 into main Mar 27, 2025
@nvaytet
nvaytet deleted the multid-reduction branch March 27, 2025 09:44
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.

Reduction over multiple specified dimensions

3 participants