Closed b-r-hamilton closed 1 year ago
It works if you declare dimensions using what I think of as the "function syntax"
julia> m2 = UnitfulDimMatrix(rand(5,5), fill(K, 5), fill(K, 5), dims = (X(1:5), X(1:5)))
Is this the preferred syntax?
Statements like this return a NamedTuple in Julia.
julia> typeof((y = 1, x = 2))
NamedTuple{(:y, :x), Tuple{Int64, Int64}}
NamedTuples can't have duplicated names.
As for the intended behavior, I have been making Dimensions and then it is ok to repeat them.
julia> @dim Years "years"
julia> E = UnitfulDimMatrix(randn(5,5),fill(K,5),fill(K,5),dims=(Years(years),Years(years)))
5×5 UnitfulDimMatrix{Float64,2} with dimensions:
Years Sampled{Int64} 1:5 ForwardOrdered Regular Points,
Years Sampled{Int64} 1:5 ForwardOrdered Regular Points
1 2 3 4 5
1 -1.18243 -1.15145 -0.983284 0.384822 0.991283
⋮ ⋮
4 -1.67197 -0.559185 0.061846 -0.556178 0.522961
5 1.57964 -0.524349 -0.619997 0.988597 -2.17795
Got it - happy to close this one then!
ULA.jl (at pull request 57) won't create a UnitfulDimMatrix if you declare two identical dimensions, returns the following error
But, you can create a matrix with two identical dimensions through multiplication
Is this the intended behavior?