Skip to content

Support for OpenDSS default values in altdss-schema #7

@AadilLatif

Description

@AadilLatif

We are currently using the opendssdirect.py's Circuit.ToJSON() method to serialize the distribution model. We then use altdss_models to deserialize the model. We use this representation to convert the model into another format (also Pydantic models). The Issue we face is that in the serialized model, many of the fields are None.

Example:

Vsource_MVAsc3MVAsc1x1r1x0r0(
  Name='source', Like=None, 
  Bus1=BusConnection(root='sourcebus'),
 BasekV=115.0,  pu=1.0001, Angle=30.0, Frequency=None, Phases=3, ScanType=None, Sequence=None, Bus2=None, Yearly=None, Daily=None, Duty=None, Model=None, puZIdeal=None, Spectrum=None, BaseFreq=None, Enabled=None, 
MVASC3=20000.0, MVASC1=21000.0, 
X1R1=None, X0R0=None)

In the example above, X1R1 and X0R0 are None, as they are not defined in the master.dss file. Model conversion requires knowledge of these variables to allow us to convert to a different schema.

Observed Issue:

>>> odd.Text.Command("new circuit.test")
>>> odd.Vsource.First()
>>> odd.Vsources.First()
1
>>> odd.Text.Command("? vsource.source.r1")
>>> odd.Text.Result()
'1.60376682055275'

JSON Output:

 "Vsource" : [
    {
      "Name" : "source",
      "MVASC3" : 2.0000000000000000E+003,
      "MVASC1" : 2.1000000000000000E+003,
      "BasekV" : 1.1500000000000000E+002,
      "Bus1" : "sourcebus"
    }

Desired Outcome:

The values in the JSON object are whatever OpenDSS would use to solve the circuit (even if is uses default values)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions