Skip to content

create labelled subsets#60

Open
bgctw wants to merge 9 commits into
SciML:masterfrom
bgctw:master
Open

create labelled subsets#60
bgctw wants to merge 9 commits into
SciML:masterfrom
bgctw:master

Conversation

@bgctw

@bgctw bgctw commented Apr 30, 2019

Copy link
Copy Markdown
Contributor

deals with #59

@bgctw

bgctw commented Apr 30, 2019

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

Has conflicts after #61

@bgctw

bgctw commented May 6, 2019

Copy link
Copy Markdown
Contributor Author

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

bgctw commented May 6, 2019

Copy link
Copy Markdown
Contributor Author

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

bgctw commented May 6, 2019

Copy link
Copy Markdown
Contributor Author

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