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

[Speculative] Recursively look for names inside wrapper types #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oxinabox
Copy link
Member

idk if this is a good idea,

Goal would be for better handling of things like LowerTriangular{<:NamedDimsArray}

# things that are not wrapper arrays are there own parents,
# so at that point we can give up looking for names
# also we have no way to deal with inner arrays of different dimensions, even if they do have names
# so give up then too
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe helpful to add an example (cos it's a bit of a weird case)? e.g.

also parent arrays can have a different number of dimensions, e.g. parent of a Diagonal is a Vector
we have no way to deal with the names in this case so give up then too

end
end
names(x::Array{T,N}) where {T,N} = default_names(x) # shortcut of the above
default_names(x::AbstractArray{T, N}) where {T,N} = ntuple(_->:_, N)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these really the names of an un-named thing?

Aren't these the names of something which has names, they're just unknown/wildcards

The names of an unnamed thing is nothing or maybe ntuple(i -> nothing, N)?

@nickrobinson251
Copy link
Contributor

I like this as an idea, although I disagree with assigning names (even wildcards) to non-named things. We should only gain wildcards if we cannot know the appropriate new name(s) for a previously named thing

@AlexRobson AlexRobson mentioned this pull request Oct 20, 2021
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.

None yet

2 participants