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

Constructor of Array with DenseAxisArray #2644

Closed
blegat opened this issue Jul 9, 2021 · 2 comments · Fixed by #2689
Closed

Constructor of Array with DenseAxisArray #2644

blegat opened this issue Jul 9, 2021 · 2 comments · Fixed by #2689
Labels
Category: Containers Related to the Containers submodule

Comments

@blegat
Copy link
Member

blegat commented Jul 9, 2021

This was discussed in the JuliaLab meeting today. The current behavior of JuMP.DenseAxisArray is consistent with OffsetArray in the sense that similar converts it onto an Array but Array gives an error.
Making convert work would be too much as convert is called implicitly when in setindex! or when setting fields of structs.
However, @stevengj suggested that the Array constructor should be allowed to coercing the JuMP.DenseAxisArray into dropping its dimensions would be reasonable.
We might want to follow the development on OffsetArray and follow what's decided there.

@odow odow added the Category: Containers Related to the Containers submodule label Jul 9, 2021
@odow
Copy link
Member

odow commented Jul 9, 2021

To clarify, you're proposing the following?

Base.Array(x::DenseAxisArray) = x.data

Or something else?

@blegat
Copy link
Member Author

blegat commented Jul 10, 2021

Yes exactly, also one for Array{N}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Containers Related to the Containers submodule
Development

Successfully merging a pull request may close this issue.

2 participants