Add `clip`
Open
Nobody has claimed this yet.
enhancement
good first issue
- Dominant language
- C++
- Stars
- 146
- Forks
- 23
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 7
Description
Add sc.clip corresponding to np.clip https://numpy.org/doc/stable/reference/generated/numpy.clip.html
Alternatively, it can be called clamp (https://en.cppreference.com/w/cpp/algorithm/clamp) which I think is more common in graphics programming.
Currently, we need to either use numpy or workaround it like this
var = sc.where(var < lo, lo, var)
var = sc.where(var > hi, hi, var)
I encountered this for the second time now when setting fit windows and making sure they are within the range of the data.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.