-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add compatibility for view
#238
Conversation
@@ -1276,6 +1276,12 @@ else | |||
end | |||
end | |||
|
|||
if isdefined(Base, :view) | |||
nothing |
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.
You should reverse the branch condition and delete this....
|
||
# Add test for Base.view | ||
let a = rand(10,10) | ||
@test view(a, 1, :) == slice(a, 1, :) |
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.
Won't this trigger a depwarn
on 0.5? Maybe construct a view
and compare it with getindex
and check that mutating the view aliases the original one.
|
||
# Add test for Base.view | ||
let a = rand(10,10) | ||
@test Array(view(a, :, 1)) == a[:,1] |
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.
The Array
shouldn't be necessary.
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.
You are right, it seems to work without that.
@@ -194,6 +194,8 @@ Currently, the `@compat` macro supports the following syntaxes: | |||
|
|||
* `write(::IO, ::Ptr, len)` is now `unsafe_write` [#14766](https://github.com/JuliaLang/julia/pull/14766). | |||
|
|||
* `slice` is now `view`: do `import Compat.view` and then use `view` normally without the `@compat` macro. |
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.
reference the julia PR - I think it was by @simonbyrne
if that helps find it faster
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.
Yeah, this: JuliaLang/julia#16972
LGTM (need squash or squash on merge) |
@tkelman or someone, can we merge, and tag a new release please? |
@TotalVerb can you tag a new release please? There are packages that are dependent on this. Thanks! |
I will once CI passes. Thanks for the contribution! |
@tkelman I can't figure out how to tag a release. Could you handle this one? |
Test added, README modified. Fixes #235 .