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

any(isnan, ArrayPartition([ NaN ], [ NaN ])) returns false #392

Closed
bvdmitri opened this issue Jun 27, 2024 · 1 comment
Closed

any(isnan, ArrayPartition([ NaN ], [ NaN ])) returns false #392

bvdmitri opened this issue Jun 27, 2024 · 1 comment
Labels

Comments

@bvdmitri
Copy link
Contributor

Describe the bug 🐞

Seems like any does not behave correctly for ArrayPartition

Expected behavior

any(isnan, ArrayPartition([ NaN ], [ NaN ])) should return true, but currently returns false

Minimal Reproducible Example 👇

julia> using RecursiveArrayTools

julia> p = ArrayPartition([ NaN ], [ NaN ])
([NaN], [NaN])

julia> collect(p)
2-element Vector{Float64}:
 NaN
 NaN

julia> any(isnan, p)
false

julia> any(isnan, collect(p))
true

Interestingly enough, all does behave correctly

julia> p = ArrayPartition([ NaN ], [ NaN ])
([NaN], [NaN])

julia> all(isnan, p)
true

julia> p = ArrayPartition([ NaN ], [ 2.0 ])
([NaN], [2.0])

julia> all(isnan, p)
false

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
(@temp) pkg> st
Status `~/.julia/environments/temp/Project.toml`
⌃ [731186ca] RecursiveArrayTools v3.23.1
  • Output of versioninfo()
julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 11 × Apple M3 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 5 virtual cores)

Additional context

Add any other context about the problem here.

@bvdmitri bvdmitri added the bug label Jun 27, 2024
@bvdmitri
Copy link
Contributor Author

duplicate of #196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant