Skip to content

[BUG] SwtControl parsing fails: missing Base.parse method for SwitchState type #491

Description

@petepritch

Describe the bug
Parsing any DSS file containing SwtControl objects fails with a MethodError because no Base.parse method is defined for the SwitchState type. I believe the error (no method matching parse(::Type{SwitchState}, ::String) returns because rawdss2dss is not transforming the string value to SwitchState enum. I'm new to Julia so this is just a best guess.

Minimum Viable Example

using PowerModelsDistribution
parse_dss("network.dss")  # any DSS file containing SwtControl objects

With a .dss file containing:

New SwtControl.sc_s1 SwitchedObj=Line.s1 SwitchedTerm=1 Action=Close State=Closed Lock=No

Expected behavior
I would expect the switch state of the ENG model to be configured by the DssSwtcontrol object.

Screenshots
NA

System Information (please complete the following information):

  • OS: windows
  • PowerModelsDistribution v0.16.0
  • Julia v1.12.5

Additional context
I am wondering if this can be fixed by simply adding a new Base.parse() method to the parse.jl module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions