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

bug with permuteddimsview, but not permutedims #466

Closed
bjarthur opened this issue Mar 22, 2018 · 4 comments
Closed

bug with permuteddimsview, but not permutedims #466

bjarthur opened this issue Mar 22, 2018 · 4 comments

Comments

@bjarthur
Copy link
Member

here's what should be added to the tests:

using Base.Test, Images, HDF5
data = rand(UInt16,2,3);

pdv_data = permuteddimsview(data,(2,1));
h5write("temp.h5", "/pdv_data", pdv_data)
pdv_data_readback = h5read("temp.h5", "/pdv_data");
@test pdv_data==pdv_data_readback               ### currently evaluates to FALSE :(

pd_data = permutedims(data,(2,1));
h5write("temp.h5", "/pd_data", pd_data)
pd_data_readback = h5read("temp.h5", "/pd_data");
@test pd_data==pd_data_readback    ### works!

@test pdv_data==pd_data    ### evaluates as true, so it's not Images fault
@bjarthur
Copy link
Member Author

this error is a direct consequence of changing Array to AbstractArray in #463. supporting the myriad types of AbstactArrays might be more trouble than it's worth. we could consider reverting back.

@musm
Copy link
Member

musm commented Mar 22, 2018

Good catch... Yeah seems like we should be safe and revert the generic dispatch to AbstractArray. Perhaps we could add an alias to supported Array types that are defined in base (e.g. Union{Array,SharedArray,...})

@bjarthur
Copy link
Member Author

collect(A::AbstractArray) yields an Array in all cases i've tested so far. so we could just define a method which does that conversion and then proceed as normal. will work on a PR.

@bjarthur
Copy link
Member Author

bjarthur commented Apr 3, 2018

closed by #469

@bjarthur bjarthur closed this as completed Apr 3, 2018
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

2 participants