Skip to content
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

CompatHelper: bump compat for DynamicQuantities to 0.10 #264

Merged
8 changes: 6 additions & 2 deletions src/MLJInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ end
function unwrap_units_single(A::AbstractMatrix, ::Type{D}) where {D}
return A, [D() for _ in eachrow(A)]
end
function unwrap_units_single(A::AbstractMatrix{T}, ::Type{D}) where {D,T<:UnionAbstractQuantity}
function unwrap_units_single(
A::AbstractMatrix{T}, ::Type{D}
) where {D,T<:UnionAbstractQuantity}
for (i, row) in enumerate(eachrow(A))
allequal(Base.Fix2(dimension_fallback, D).(row)) ||
error("Inconsistent units in feature $i of matrix.")
Expand All @@ -321,7 +323,9 @@ end
function unwrap_units_single(v::AbstractVector, ::Type{D}) where {D}
return v, D()
end
function unwrap_units_single(v::AbstractVector{T}, ::Type{D}) where {D,T<:UnionAbstractQuantity}
function unwrap_units_single(
v::AbstractVector{T}, ::Type{D}
) where {D,T<:UnionAbstractQuantity}
MilesCranmer marked this conversation as resolved.
Show resolved Hide resolved
allequal(Base.Fix2(dimension_fallback, D).(v)) || error("Inconsistent units in vector.")
dims = dimension_fallback(first(v), D)
v = ustrip.(v)
Expand Down
Loading