xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

Add a bounds check and negative slice support to strided view fill_args

Open Ivorforce opened this issue 1 year ago • 0 comments

Checklist

  • [x] The title and commit message(s) are descriptive.
  • [x] 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

Currently, when slicing a strided view, it may slice outside of the bounds unnoticed. Ranges already support both negative indices (same as here) as well as bounds checks (clamped).

The behavior in this PR mimics NumPy behavior for negative and out of bounds index access.

Ivorforce avatar Oct 05 '24 19:10 Ivorforce