Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sigma_clip mutates original array like sigma_clip! #62

Open
m4ttes4 opened this issue Nov 1, 2024 · 0 comments
Open

sigma_clip mutates original array like sigma_clip! #62

m4ttes4 opened this issue Nov 1, 2024 · 0 comments

Comments

@m4ttes4
Copy link

m4ttes4 commented Nov 1, 2024

The sigma_clip function modifies the original array, which it should not do. The mutating behavior should be reserved for the sigma_clip! function, while sigma_clip should return a new array without altering the original one.

Here is an example following the one presented in the documentation:

julia> x = randn(100_000);

julia> extrema(x)
(-4.319272752707137, 4.141796263661749)

julia> x_clip = sigma_clip(x, 1);

julia> extrema(x_clip)
(-1.00008381672931, 0.9976227973860834)

julia> extrema(x) # It should be like the original, but it's not
(-1.00008381672931, 0.9976227973860834)

Expected Behavior:

The sigma_clip function should return a new array without modifying x.
Only sigma_clip! should modify the original array.

Environment:
Julia Version: 1.11.1 (but also 1.10...)
Package Version: latest

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

No branches or pull requests

1 participant