Skip to content

Bug with "/" in device names #1647

@m-bossart

Description

@m-bossart

This is a bug in reading simulation results due to a component name with "/" which is incompatible with the hdf5 specification. We can either restrict components to not have names with "/" when parsing or do some checks before simulation.

MWE:

using PowerSystemCaseBuilder
using HiGHS
using PowerSimulations
using PowerSystems

c_sys5_uc = build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true)
interface = TransmissionInterface(;
    name = "E/W",   # Fails due to "/" in the name 
    available = true,
    active_power_flow_limits = (min = 0.0, max = 400.0),
)
interface_lines = [
    get_component(Line, c_sys5_uc, "1"),
    get_component(Line, c_sys5_uc, "2"),
    get_component(Line, c_sys5_uc, "6"),
]
add_service!(c_sys5_uc, interface, interface_lines)

template = ProblemTemplate(PTDFPowerModel)
set_device_model!(template, ThermalStandard, ThermalBasicDispatch)
set_device_model!(template, PowerLoad, StaticPowerLoad)
set_device_model!(template, MonitoredLine, StaticBranchBounds)
set_device_model!(template, Line, StaticBranch)
set_device_model!(template, Transformer2W, StaticBranch)
set_device_model!(template, TapTransformer, StaticBranch)
set_device_model!(template, TwoTerminalGenericHVDCLine, HVDCTwoTerminalLossless)
set_service_model!(
    template,
    ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true),
)
solver = optimizer_with_attributes(
    HiGHS.Optimizer,
)
models = SimulationModels(;
    decision_models = [
        DecisionModel(
            template,
            c_sys5_uc;
            optimizer = solver,
            name = "UC",
            optimizer_solve_log_print = true,
        ),
    ],
)
DA_sequence = SimulationSequence(;
    models = models,
    ini_cond_chronology = InterProblemChronology(),
)
dir_name = mktempdir(cleanup = true)
sim = Simulation(;
    name = "ti-key-test",
    steps = 2,
    models = models,
    sequence = DA_sequence,
    simulation_folder = dir_name,
)
build!(sim)
execute!(sim; in_memory = false, enable_progress_bar = true)

res = SimulationResults(dir_name)   #Deserializing the results from hdf5 fails 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions