Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Mar 26, 2025

Fixes #3569

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

Copilot AI left a comment

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
4 checks passed
@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