You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compatibility for JuliaLang/julia#14082. Since the new version in
Julia 0.5 calls similar() internally, it is not enough to wrap it
into a compatibility function to backport the fix. This is required
to deprecate rep() from DataArrays.jl, which provides similar
functionality for two custom array types.
Copy file name to clipboardExpand all lines: README.md
+2
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,8 @@ Currently, the `@compat` macro supports the following syntaxes:
217
217
Compat provides an unexported `Compat.AsyncCondition` type that is aliased to
218
218
`Base.SingleAsyncWork` on Julia 0.3 and 0.4 and `Base.AsyncCondition` on Julia 0.5.
219
219
220
+
*`repeat` now accepts any `AbstractArray`[#14082](https://github.com/JuliaLang/julia/pull/14082): `Compat.repeat` supports this new API on Julia 0.3 and 0.4, and calls `Base.repeat` on 0.5.
221
+
220
222
## New types
221
223
222
224
*[`Nullable` types](http://julia.readthedocs.org/en/latest/manual/types/?highlight=nullable#nullable-types-representing-missing-values) and their associated operations.
Copy file name to clipboardExpand all lines: src/Compat.jl
+45
Original file line number
Diff line number
Diff line change
@@ -1157,4 +1157,49 @@ if !isdefined(Base, @compat Symbol("@static"))
1157
1157
export@static
1158
1158
end
1159
1159
1160
+
# JuliaLang/julia#14082
1161
+
ifVERSION<v"0.5.0-dev+4295"
1162
+
functionrepeat(A::AbstractArray;
1163
+
inner=ntuple(x->1, ndims(A)),
1164
+
outer=ntuple(x->1, ndims(A)))
1165
+
ndims_in =ndims(A)
1166
+
length_inner =length(inner)
1167
+
length_outer =length(outer)
1168
+
1169
+
length_inner >= ndims_in ||throw(ArgumentError("number of inner repetitions ($(length(inner))) cannot be less than number of dimensions of input ($(ndims(A)))"))
1170
+
length_outer >= ndims_in ||throw(ArgumentError("number of outer repetitions ($(length(outer))) cannot be less than number of dimensions of input ($(ndims(A)))"))
0 commit comments