Skip to content

add PermutedDimsArray method that returns PermutedDiskArray #249

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rafaqz
Copy link
Collaborator

@rafaqz rafaqz commented Apr 1, 2025

Closes #240

@rafaqz
Copy link
Collaborator Author

rafaqz commented Apr 2, 2025

Ok so to remove the recursive PermuteDimsArray I moved type parameters perm and iperm from PermutedDimsArray to PermutedDiskArray. But then I had to add a ConstructionBase dependency so we can use Flatten.jl/Accessors.jl etc on it (so Rasters and other things don't break). ConstructionBase.jl is tiny and will nearly always be loaded anyway.

Then there were some issues with parent access after changes to PermutedDiskArray, so I went ahead and swapped everything to use parent(a).

@rafaqz rafaqz requested a review from meggart April 3, 2025 10:28
Copy link
Collaborator

@meggart meggart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Would you consider this change to be breaking?

PermutedDiskArray{T,N,perm,iperm,A}(a)

ConstructionBase.constructorof(::Type{<:PermutedDiskArray{<:Any,N,perm,iperm}}) where {N,perm,iperm} =
PermutedDiskArrayConstructor{N,perm,iperm}()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding the ConstructionBase dependecy is a good addition. I think there are several places in DiskArrays where we added unnecessary fields to types that might have lived in the type parameter only, so we could slowly replace these as well.

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 this pull request may close these issues.

Handle PermutedDimsArray
2 participants