lanl-ansi / PowerModelsDistribution.jl

A Julia/JuMP Package for Unbalanced Power Network Optimization
https://lanl-ansi.github.io/PowerModelsDistribution.jl/stable/
Other
146 stars 43 forks source link

[BUG] KeyError: key "rs" not found in European Low Voltage Test Feeder case #441

Closed juanjospina closed 1 year ago

juanjospina commented 1 year ago

Describe the bug I am getting a key error when trying to solve the European Low Voltage Test Feeder (I am attaching the file). This test case was solvable in previous PMD versions, but now, for some reason, there is an error when parsing/instantiating the test case data.

Minimum Viable Example

import PowerModelsDistribution as _PMD
import JuMP
import Ipopt
ipopt = JuMP.optimizer_with_attributes(Ipopt.Optimizer, "acceptable_tol"=>1.0e-8, "print_level"=>5, "sb"=>"yes", "print_info_string"=>"yes")
pmd_file = "./lvtestcase_pmd_138kv.dss"
eng1 = _PMD.parse_file(pmd_file)
result1 = _PMD.solve_mc_opf(eng1, _PMD.ACPUPowerModel, ipopt)

Expected behavior Test case should work fine. In previous PMD versions, this error did not exist. The error seems to be related to the kron_reduction, so maybe something was added to the new versions that require the rs key?

Screenshots If applicable, add screenshots to help explain your problem.

pmd_error

System Information (please complete the following information):

Additional context Attached zip file with IEEE LV test case. lvtestcase_pmd_138kv.zip

pseudocubic commented 1 year ago

The issue seems to be that the Linecodes have . characters in their names, which was not expected, and breaks the regex that parses lines. I will have to consider how to address that. In the meantime, you can search/replace those linecode names and it will work again (I confirmed).

juanjospina commented 1 year ago

Great! Thank you @pseudocubic. I was looking for the bug but wasn't able to find. I will modify my testcases to avoid this edge-case error.