Skip to content

Commit

Permalink
ADD: EquivalentSwitch to template
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudocubic committed Dec 4, 2024
1 parent 95dfed7 commit 1e7e3dd
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 4 deletions.
148 changes: 147 additions & 1 deletion ravens/cim_tools/cim_conversion_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,152 @@
}
},
"EquivalentBranch": {
"$objectType": "object",
"type": "object",
"$primaryObjectHash": "IdentifiedObject.name",
"$secondaryObjectHash": "IdentifiedObject.mRID",
"$objectId": "EquivalentBranch",
"oneOf": [
{
"$objectType": "object",
"type": "object",
"$primaryObjectHash": "IdentifiedObject.name",
"$secondaryObjectHash": "IdentifiedObject.mRID",
"$objectId": "EquivalentBranch",
"properties": {
"PowerSystemResource.Location": {
"$objectType": "reference",
"type": "string",
"$objectId": "Location",
"$referencePath": "Location"
},
"PowerSystemResource.GenericAction": {
"$objectType": "reference",
"type": "string",
"$objectId": "SwitchingAction",
"$referencePath": "SwitchingAction"
},
"ConductingEquipment.Terminals": {
"type": "array",
"items": {
"$objectId": "Terminal",
"$objectType": "object",
"type": "object",
"$arrayPosition": "ACDCTerminal.sequenceNumber",
"properties": {
"Terminal.ConnectivityNode": {
"$objectId": "ConnectivityNode",
"$objectType": "reference",
"type": "string",
"$referencePath": "ConnectivityNode"
},
"Terminal.SvPowerFlow": {
"type": "array",
"items": {
"$objectId": "SvPowerFlow",
"$objectType": "object",
"type": "object",
"$arrayPosition": null,
"properties": {}
}
}
}
}
},
"ConductingEquipment.BaseVoltage": {
"$objectType": "reference",
"$objectId": "BaseVoltage",
"type": "string",
"$referencePath": "BaseVoltage"
},
"ConductingEquipment.SvStatus": {
"type": "array",
"items": {
"$objectType": "object",
"type": "object",
"$objectId": "SvStatus",
"$arrayPosition": null,
"properties": {}
}
}
}
},
{
"$objectType": "object",
"type": "object",
"$primaryObjectHash": "IdentifiedObject.name",
"$secondaryObjectHash": "IdentifiedObject.mRID",
"$objectId": "EquivalentLine",
"properties": {
"EquivalentLine.EquivalentSwitches": {
"type": "array",
"items": {
"$objectType": "reference",
"$objectId": "EquivalentSwitch",
"type": "string",
"referencePath": "PowerSystemResource/Equipment/ConductingEquipment/EquivalentEquipment/EquivalentSwitch"
}
},
"PowerSystemResource.Location": {
"$objectType": "reference",
"type": "string",
"$objectId": "Location",
"$referencePath": "Location"
},
"PowerSystemResource.GenericAction": {
"$objectType": "reference",
"type": "string",
"$objectId": "SwitchingAction",
"$referencePath": "SwitchingAction"
},
"ConductingEquipment.Terminals": {
"type": "array",
"items": {
"$objectId": "Terminal",
"$objectType": "object",
"type": "object",
"$arrayPosition": "ACDCTerminal.sequenceNumber",
"properties": {
"Terminal.ConnectivityNode": {
"$objectId": "ConnectivityNode",
"$objectType": "reference",
"type": "string",
"$referencePath": "ConnectivityNode"
},
"Terminal.SvPowerFlow": {
"type": "array",
"items": {
"$objectId": "SvPowerFlow",
"$objectType": "object",
"type": "object",
"$arrayPosition": null,
"properties": {}
}
}
}
}
},
"ConductingEquipment.BaseVoltage": {
"$objectType": "reference",
"$objectId": "BaseVoltage",
"type": "string",
"$referencePath": "BaseVoltage"
},
"ConductingEquipment.SvStatus": {
"type": "array",
"items": {
"$objectType": "object",
"type": "object",
"$objectId": "SvStatus",
"$arrayPosition": null,
"properties": {}
}
}
}
}
]
},
"EquivalentShunt": {
"$objectType": "object",
"type": "object",
"$primaryObjectHash": "IdentifiedObject.name",
Expand Down Expand Up @@ -2303,7 +2449,7 @@
}
}
},
"EquivalentShunt": {
"EquivalentSwitch": {
"$objectType": "object",
"type": "object",
"$primaryObjectHash": "IdentifiedObject.name",
Expand Down
6 changes: 3 additions & 3 deletions ravens/schema/decompose_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ def insert_refs(self):

schema["$defs"] = build_definitions(uml_data)

with open("out/schema/test_schema.json", "w") as f:
json.dump(schema, f, indent=2)

a = Schemas(schema, base_id_uri=f"file://{os.getcwd()}/out/schema/separate")

add_cim_copyright_notice_to_decomposed_schemas(a.schemas, uml_data)

with open("out/schema/test_schema.json", "w") as f:
json.dump(schema, f, indent=2)

for k, v in a.schemas.items():
filename = k.split("/")[-1].replace(".json", "")
with open(f"out/schema/separate/{filename}.json", "w") as f:
Expand Down

0 comments on commit 1e7e3dd

Please sign in to comment.