Open AbrahamAlvarezB opened 3 years ago
You can access the matrix using PTDF_matrix.data
, see https://github.com/NREL-SIIP/PowerSystems.jl/blob/master/src/utils/network_calculations/ptdf_calculations.jl#L6
I agree that if we use the struct call as below we get the data,
julia> b = PTDF_matrix.data[:,[2,4]]
5×2 Array{Float64,2}:
-0.625 -0.5
-0.375 -0.5
0.25 1.38778e-17
0.125 -0.5
-0.125 -0.5
but we loose the parent format. I would expect something like this, which may be useful:
b = PTDF_matrix[:,[2,4]]
PowerNetworkMatrix
Dimension 1, ["Line1", "Line2", "Line3", "Line4", "Line5"]
Dimension 2, [2, 4]
And data, a (5, 2):
-0.625 -0.5
-0.375 -0.5
0.25 1.38778e-17
0.125 -0.5
-0.125 -0.5
@AbrahamAlvarezB we don't have a great way to do slicing at the moment. Since we implemented the code to optimize a single value or single column fetching we never implemented additional methods to do the slicing.
Error when selecting specific columns of the PTDF matrix I would expect that the following commands work:
However for a system
sys
the PTDF matrixIs this an issue or can it be improved?