-
Notifications
You must be signed in to change notification settings - Fork 42
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
Propagate AxisArray copy / view down to taking copies / views of its axes as well #148
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to just-plain-Val
would be to create a CopyStyle
trait. However, since this is an internal interface I think it's fine to use just-plain-Val
.
Didn't notice how long ago this came. It's been hard for folks to find time to review PRs here. Sorry for the delay. |
Ended up adding a |
Shall we merge this? |
Uh hey, yeah, this would be really nice to have. I assume this is the reason that function testalloc(x,interval)
@view x[interval];
nothing
end causes allocation when |
I'll create a separate issue for this and then link to this PR. |
This is my attempt at addressing #147
All the tests appear to pass. I'm new to Julia and wasn't quite sure on the best way implement this, but doing it via Value types seemed efficient and easy. The only issue was that, in order to resolve the following method ambiguity:
I had to duplicate
_new_axes
on line 95 with thecopy
parameter as bothVal{true}
andVal{false}
(whereas I originally just had the argument ascopy::Val
). I couldn't work out another way to get it to compile, but no doubt someone will be able to suggest a better way to avoid this ambiguity without duplicating code.