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

create labelled subsets #60

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

create labelled subsets #60

wants to merge 9 commits into from

Conversation

bgctw
Copy link
Contributor

@bgctw bgctw commented Apr 30, 2019

deals with #59

@bgctw
Copy link
Contributor Author

bgctw commented Apr 30, 2019

@ChrisRackauckas left a note at the the code of slicing [ ] with vectors that it could return a LabelledArray instead of an Array.
Here, I suggest that the slicing should always to return an Array in order to not surprise users. Rather I suggest to provide an own function (subset).
Alternatively, one could implement a constructor with a LabelledArray varargs symbols. But this can become confusing with the copy-modify-kvararg-constructor.

@ChrisRackauckas
Copy link
Member

Has conflicts after #61

@bgctw
Copy link
Contributor Author

bgctw commented May 6, 2019

Subset now additionally accepts specifying indices as both symbols or integers in the form of SVector or SLVector.

Not yet working is only specifying indices as a tuple of integer indices, because the Tuple method is already assuming symbols. Could you help me on dispatching based on a Tuple of Symbols versus a Tuple of Integers?

@bgctw
Copy link
Contributor Author

bgctw commented May 6, 2019

I implemented the integer tuples with a conditional on the type of the first item of a Val(Tuple). A am happy to learn a more elegant way.

@bgctw
Copy link
Contributor Author

bgctw commented May 6, 2019

I am not familiar with the effects of Val() on type stability. In my testing so far the only way to return a type-stable result is to invoke the subset with Val(Tuple_of_symbols) at the top level call to subset. Any function in the call-stack in between that inserts the Val() returns a result of type Any.

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.

3 participants