-
Notifications
You must be signed in to change notification settings - Fork 41
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
cat
is not type-inferrable
#500
Comments
Yeah, it doesnt yet know the order or if the lookup is ordered at all. You can (fully) specify the |
Yes its fine if you specify using DimensionalData.LookupArrays
bar(x, y) = cat(x, y; dims=Dim{:foo}(Categorical([:c, :d]; order=ForwardOrdered())))
julia> @inferred bar(da, da)
3×2 DimArray{Float64,2} with dimensions:
Dim{:a},
Dim{:foo} Categorical{Symbol} Symbol[:c, :d] ForwardOrdered
:c :d
1.6825 1.6825
0.216932 0.216932
-0.66003 -0.66003
|
@rafaqz it seems on v0.25 even specifying the lookup does not cause julia> using DimensionalData, Test
julia> using DimensionalData.LookupArrays
julia> bar(x, y) = cat(x, y; dims=Dim{:foo}(Categorical([:c, :d]; order=ForwardOrdered())))
bar (generic function with 1 method)
julia> da = DimArray(randn(3), Dim{:a})
3-element DimArray{Float64,1} with dimensions: Dim{:a}
1 -0.214735
2 0.395572
3 -0.388922
julia> @inferred bar(da, da)
ERROR: return type DimArray{Float64, 2, Tuple{Dim{:a, NoLookup{Base.OneTo{Int64}}}, Dim{:foo, Categorical{Symbol, Vector{Symbol}, ForwardOrdered, NoMetadata}}}, Tuple{}, Matrix{Float64}, DimensionalData.NoName, NoMetadata} does not match inferred return type Any |
Making Maybe we need to separate out method dispatch for this specific case so its not mixed into a method with multiple return types. A PR would help, I've spent too much time working on |
It seems that when using
cat
, Julia cannot infer the types of the resulting dimensions:The text was updated successfully, but these errors were encountered: