Skip to content

Fix clip function behavior when a_min is greater than a_max#2909

Merged
JohanMabille merged 4 commits intoxtensor-stack:masterfrom
Alex-PLACET:fix_xmath_clip
May 6, 2026
Merged

Fix clip function behavior when a_min is greater than a_max#2909
JohanMabille merged 4 commits intoxtensor-stack:masterfrom
Alex-PLACET:fix_xmath_clip

Conversation

@Alex-PLACET
Copy link
Copy Markdown
Contributor

@Alex-PLACET Alex-PLACET commented May 6, 2026

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

Address #2860

Now clips follow the rule: When a_min is greater than a_max, clip returns an array in which all values are equal to a_max

@Alex-PLACET Alex-PLACET changed the title Fix xmath clip Fix clip function behavior when a_min is greater than a_max May 6, 2026
@Alex-PLACET Alex-PLACET marked this pull request as ready for review May 6, 2026 07:31
@JohanMabille JohanMabille merged commit 3b8e0c4 into xtensor-stack:master May 6, 2026
24 checks passed
@Alex-PLACET Alex-PLACET deleted the fix_xmath_clip branch May 6, 2026 13:14
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.

xt::clip() is missing a special case when a_min is greater than a_max

2 participants