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

Unexpected behavior of KeepIndex with partitioned axis #134

Open
bgctw opened this issue Jun 1, 2022 · 0 comments · May be fixed by #135
Open

Unexpected behavior of KeepIndex with partitioned axis #134

bgctw opened this issue Jun 1, 2022 · 0 comments · May be fixed by #135

Comments

@bgctw
Copy link

bgctw commented Jun 1, 2022

Currently getpropery and getindex using KeepIndex return different values.

Using the example of #41, I expected the result using KeepIndex to return ComponentVector(boids = <LazyArray>) rather than only the first entry.

    boid = ComponentArray(pos=zeros(2), vel=zeros(2))   
    u0 = ComponentArray(boids=repeat([boid], 2))    
    u0.boids
#2-element LazyArray{ComponentVector{Float64, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{Axis{(pos = 1:2, vel = 3:4)}}}}:
# ComponentVector{Float64,SubArray...}(pos = [0.0, 0.0], vel = [0.0, 0.0])
# ComponentVector{Float64,SubArray...}(pos = [0.0, 0.0], vel = [0.0, 0.0])

    u0[KeepIndex(:boids)]
# ComponentVector{Float64}(boids = (pos = [0.0, 0.0], vel = [0.0, 0.0]))
bgctw added a commit to bgctw/ComponentArrays.jl that referenced this issue Jun 1, 2022
@bgctw bgctw linked a pull request Jun 1, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant