-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
deprecate flipdim
to reverse
with a dims
keyword argument
#26369
Conversation
3644f57
to
4074ac0
Compare
Triage accepts. |
Triage approves. Supporting reversing multiple dimensions is left as future work. |
base/abstractarraymath.jl
Outdated
2×2 Array{Int64,2}: | ||
2 1 | ||
4 3 | ||
``` | ||
""" | ||
function flipdim(A::AbstractArray, d::Integer) | ||
function reverse(A::AbstractArray; dims::Integer) |
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.
Doesn't this overwrite the reverse
method for arrays with one with a required keyword argument?
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.
That one is only defined for AbstractVector
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.
Ah, I see, thanks.
base/abstractarraymath.jl
Outdated
2×2 Array{Int64,2}: | ||
2 1 | ||
4 3 | ||
``` | ||
""" | ||
function flipdim(A::AbstractArray, d::Integer) | ||
function reverse(A::AbstractArray; dims::Integer) | ||
nd = ndims(A) | ||
1 ≤ d ≤ nd || throw(ArgumentError("dimension $d is not 1 ≤ $d ≤ $nd")) |
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.
This should be updated to reflect the change from the argument being called d
to being called dims
. (That's what's causing the current CI failures.)
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.
ooops
4074ac0
to
8ced618
Compare
Should the old Otherwise it seems like it may be a problem for generic code calling |
Yes, you're right. |
Ah, actually it happens to work currently due to #9498 --- passing a keyword argument causes us to favor a matching method that accepts them. |
Would be good to at least have a test for |
Would also be good to have an in-place |
8ced618
to
c0e5b84
Compare
* add Project.toml * update test for cache and minor fix * update test for rotation and minor fix * update flipdm to reverse JuliaLang/julia#26369 * update test for crop and minor fix * update test for resize * update test for scale and minor fix * update test for zoom and minor fix * WIP: update test for distortion and minor fix * update test for either and minor fix * fix pipeline test * update summary reference for distortedview * WIP: fix tests for augment and operations * drop julia 0.7 and update CI * use FileIO v1.1.0 JuliaIO/FileIO.jl#245 * add 1.x tests to CI * revert back unnecessary changes * test windows in travis * fix randomly failed test cases for inacuraccy reasons * update to julia 1.1 * maybe_copy doesn't explain its usage * replace Slice by OffsetArrays.IdentityUnitRange JuliaArrays/OffsetArrays.jl#62 * update to julia 1.2 -- part I * WIP: update to julia 1.2 -- part II detect some type instable test cases, only the outmost wrapper is instable here * unify how types are displayed Only meta operations such as Either, Pipeline doesn't have Agumentor prefix * add more test versions * move safe_rand to compat.jl rand is thread-safe in julia 1.3 * don't allow failures for julia 1.3 * fix commit "WIP: update 1.0" * use explicit and intuitive CartesianIndex(1, 1) * add method specialization for tweight * allow FileIO 1.2 * fix type instability for Either * update reference for FixedPointNumbers v0.7 * try: relax equality check for scale * restore test cases in tst_scale.jl * Revert "add method specialization for tweight" This reverts commit a698382. * Augmentor v0.6.0-pre
* add Project.toml * update test for cache and minor fix * update test for rotation and minor fix * update flipdm to reverse JuliaLang/julia#26369 * update test for crop and minor fix * update test for resize * update test for scale and minor fix * update test for zoom and minor fix * WIP: update test for distortion and minor fix * update test for either and minor fix * fix pipeline test * update summary reference for distortedview * WIP: fix tests for augment and operations * drop julia 0.7 and update CI * use FileIO v1.1.0 JuliaIO/FileIO.jl#245 * add 1.x tests to CI * revert back unnecessary changes * test windows in travis * fix randomly failed test cases for inacuraccy reasons * update to julia 1.1 * maybe_copy doesn't explain its usage * replace Slice by OffsetArrays.IdentityUnitRange JuliaArrays/OffsetArrays.jl#62 * update to julia 1.2 -- part I * WIP: update to julia 1.2 -- part II detect some type instable test cases, only the outmost wrapper is instable here * unify how types are displayed Only meta operations such as Either, Pipeline doesn't have Agumentor prefix * add more test versions * move safe_rand to compat.jl rand is thread-safe in julia 1.3 * don't allow failures for julia 1.3 * fix commit "WIP: update 1.0" * use explicit and intuitive CartesianIndex(1, 1) * add method specialization for tweight * allow FileIO 1.2 * fix type instability for Either * update reference for FixedPointNumbers v0.7 * try: relax equality check for scale * restore test cases in tst_scale.jl * Revert "add method specialization for tweight" This reverts commit a698382. * Augmentor v0.6.0-pre
flipdim was deprecated: JuliaLang/julia#26369
I think this is another case that fits well with the
dims
keyword argument change. The docstring forflipdim
describes the operation as "reverse", often a telltale sign.