PTDF matrix does not use lookup dictionary when retrieving a row of the matrix
@jd-lara is already working on this.
Since Sep 21, 2024.
Assessment
This issue has not been assessed yet.
Description
I found that the PTDF matrix does not recognize the lookup dictionary when trying to access the vector of line data corresponding to a given bus. For example, in the code below, I get an error on the last line because the number for the bus "Cobb" (321) is greater than that dimension of the matrix (73). This is using Julia 1.9 with PSY v3.3.0, PNM v0.10.0, and PSCB v1.2.5.
using PowerNetworkMatrices, PowerSystems, PowerSystemCaseBuilder
rts_sys = build_system(PSITestSystems, "test_RTS_GMLC_sys")
ptdf = PTDF(rts_sys)
bus = get_component(Bus, rts_sys, "Cobb")
vector = ptdf[:, get_number(bus)]
This error came up because I was using the code from PowerSimulations.jl here to compute the LMPs of a Sienna simulation. This was fairly easy to work around (just mapping the values in ptdf.axes[1] to the order they appear) but wasn't sure if this was expected behavior. Wondering if it would make sense to have ptdf.axes[1] be the bus names instead of the bus numbers to avoid this issue. For example, if I instead call ptdf["A1", :], I do get the expected behavior where it gives me the column corresponding to Line "A1".
Also, as a related note, it was a little confusing to me that the PTDF matrix expects the indexes to be passed as column then row, rather than row then column (e.g., ptdf["A1", 101] rather than ptdf[101, "A1"]) since the dimensions in ptdf.axes are listed with the bus number as dimension 1 and line names as dimension 2. Just an observation as a first time user. Overall though, thank you for making and supporting the Sienna suite. It has been very helpful.
- Dominant language
- Julia
- Stars
- 31
- Forks
- 22
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Sienna-Platform/PowerNetworkMatrices.jl
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
-
Performance
Sienna-Platform/PowerNetworkMatrices.jl#358 · 1 assignee ·
-
invalid
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Sienna-Platform/PowerNetworkMatrices.jl#332 · 2 comments ·
All issues in Sienna-Platform/PowerNetworkMatrices.jl
Similar issues
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Sienna-Platform/PowerSystems.jl#1800 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100