ArrayPartition violates the documentation of eltype
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Describe the bug 🐞
In some situations ArrayPartition violates the documentation of eltype:
eltype(type)
Determine the type of the elements generated by iterating a collection...
But this is not always the case (see MWE below).
As I understand the ArrayPartition declares eltype as a type that all udnerlying elements can be promoted to.
This behaviour might be by design, but it has a real practical implication.
Perhaps can be fixed on ForwardDiff side by extra promoting, but this can have other weird edge cases.
At the very least this behaviour can be documented as desired?
Minimal Reproducible Example 👇
julia> v = ArrayPartition([ 0.0 ], [ 1 ])
([0.0], [1])
julia> for e in v
@show e isa eltype(v)
end
e isa eltype(v) = true
e isa eltype(v) = false # would expect `true` here
Environment (please complete the following information):
- Output of
using Pkg; Pkg.status()
(jl_ZYBD4c) pkg> st
Status `/private/var/folders/kf/1t2_wf7n49sgxmzzmmgsb1j40000gn/T/jl_ZYBD4c/Project.toml`
[731186ca] RecursiveArrayTools v3.26.0
- 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: 10 × Apple M2 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 6 virtual cores)
- Lingua principale
- Julia
- Stelle
- 233
- Fork
- 76
- Merge medio
- 5h 33m
- PR unite (30g)
- 11
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SciML/RecursiveArrayTools.jl
-
Docs: usage of j vs i Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
SciML/RecursiveArrayTools.jl#255 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
SciML/RecursiveArrayTools.jl#662 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
SciML/RecursiveArrayTools.jl#661 ·
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red) Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
SciML/RecursiveArrayTools.jl#620 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
SciML/RecursiveArrayTools.jl#619 ·
Tutte le issue di SciML/RecursiveArrayTools.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
interpolate! from a Float32 LatitudeLongitudeGrid fails on Metal: Float64 division in find_λ_range Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
CliMA/Oceananigans.jl#6056 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
JuliaPluto/PlutoPlotly.jl#72 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
epiforecasts/BVDOutbreakSize#811 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
SciML/NonlinearSolve.jl#1310 · 1 commento ·