Skip to content

Commit

Permalink
refactor!: remove un and substation_mrid from converter query
Browse files Browse the repository at this point in the history
Both available in bus
  • Loading branch information
leifwar committed Sep 26, 2024
1 parent 1fa4660 commit 4c23734
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions cimsparql/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class PhaseTapChangerSchema(JsonSchemaOut):

class ConvertersSchema(NamedResourceSchema):
alias: Series[str] = pa.Field(nullable=True)
substation_mrid: Series[str] = pa.Field()
status: Series[bool] = pa.Field()
node: Series[str] = pa.Field()
p: Series[float] = pa.Field()
Expand All @@ -173,7 +172,6 @@ class ConvertersSchema(NamedResourceSchema):
loss1: Series[float] = pa.Field()
loss2: Series[float] = pa.Field()
vdcn: Series[float] = pa.Field()
un: Series[float] = pa.Field()


ConvertersDataFrame = DataFrame[ConvertersSchema]
Expand Down
7 changes: 2 additions & 5 deletions cimsparql/sparql/converters.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PREFIX cim:<${cim}>
PREFIX xsd:<${xsd}>
PREFIX SN:<${SN}>
PREFIX ALG:<${ALG}>
select ?mrid ?name ?alias ?p ?q ?substation_mrid ?status ?node ?connectivity_node ?controller ?controller_factor ?pole_loss ?loss0 ?loss1 ?loss2 ?vdcn ?un
select ?mrid ?name ?alias ?p ?q ?status ?node ?connectivity_node ?controller ?controller_factor ?pole_loss ?loss0 ?loss1 ?loss2 ?vdcn
where {
{
select * where {
Expand All @@ -30,10 +30,7 @@ where {
cim:Terminal.sequenceNumber|cim:ACDCTerminal.sequenceNumber 1 .
?con_node cim:IdentifiedObject.mRID ?connectivity_node;
cim:ConnectivityNode.ConnectivityNodeContainer ?con_node_container.
?con_node_container cim:VoltageLevel.Substation ?substation;
cim:VoltageLevel.BaseVoltage/cim:BaseVoltage.nominalVoltage ?un.
?substation cim:IdentifiedObject.mRID ?substation_mrid;
cim:Substation.Region/cim:SubGeographicalRegion.Region/cim:IdentifiedObject.name ?area .
?con_node_container cim:VoltageLevel.Substation/cim:Substation.Region/cim:SubGeographicalRegion.Region/cim:IdentifiedObject.name ?area .
optional {?converter SN:Equipment.networkAnalysisEnable ?_analysis_enabled .}
optional {
?converter ALG:VoltageSourceConverter.loss0 ?_loss0;
Expand Down

0 comments on commit 4c23734

Please sign in to comment.