Skip to content

Commit

Permalink
Remove unused field allocationmax
Browse files Browse the repository at this point in the history
  • Loading branch information
simenjohnsrud authored and davidkleiven committed Nov 27, 2023
1 parent 3e71b93 commit b13c080
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion cimsparql/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class WindGeneratingUnitsSchema(NamedMarketResourceSchema):


class SynchronousMachinesSchema(NamedMarketResourceSchema):
allocationmax: Series[float] = pa.Field(nullable=True)
node: Series[str] = pa.Field()
status: Series[bool] = pa.Field()
station_group: Series[str] = pa.Field(nullable=True)
Expand Down
14 changes: 6 additions & 8 deletions cimsparql/sparql/synchronous_machines.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PREFIX cim: <${cim}>
PREFIX SN: <${SN}>
PREFIX xsd: <${xsd}>
select distinct ?mrid ?name ?market_code ?allocationmax ?node ?status ?station_group ?station_group_name ?substation_mrid ?maxP ?minP ?MO ?bidzone ?sn ?p ?q
select distinct ?mrid ?name ?market_code ?node ?status ?station_group ?station_group_name ?substation_mrid ?maxP ?minP ?MO ?bidzone ?sn ?p ?q
where {
# Extract properties for synchronous machines.
?machine a cim:SynchronousMachine;
Expand Down Expand Up @@ -33,13 +33,12 @@ where {

# Opionally extract non-CIM standard properties generating units
optional {
select ?gen_unit ?market_code ?MO ?apctmax ?station_group ?station_group_name
select ?gen_unit ?market_code ?MO ?station_group ?station_group_name
where
{
?gen_unit SN:GeneratingUnit.marketCode ?market_code;
SN:GeneratingUnit.groupAllocationWeight ?MO;
SN:GeneratingUnit.ScheduleResource ?ScheduleResource;
SN:GeneratingUnit.groupAllocationMax ?apctmax .
SN:GeneratingUnit.ScheduleResource ?ScheduleResource .
?ScheduleResource SN:ScheduleResource.marketCode ?station_group;
cim:IdentifiedObject.name ?station_group_name .
}
Expand All @@ -51,10 +50,10 @@ where {
optional {?terminal cim:Terminal.TopologyNode/cim:IdentifiedObject.mRID ?term_top_node_mrid}
} .

# Optionally extract the mRID of the toplogical node associated with the connectivity node for each sync machine
# Optionally extract the mRID of the topological node associated with the connectivity node for each sync machine
optional { service <${repo}> {?con_node cim:ConnectivityNode.TopologicalNode/cim:IdentifiedObject.mRID ?con_top_node_mrid .}}

# Optinoally extract in_service flag for each macchine, as well as active and reactive power
# Optionally extract in_service flag for each machine, as well as active and reactive power
service <${repo}> {
optional {?machine ^cim:SvStatus.ConductingEquipment/cim:SvStatus.inService ?in_service} .
optional {?machine cim:RotatingMachine.p ?p;cim:RotatingMachine.q ?q .}
Expand All @@ -65,12 +64,11 @@ where {
# Assign a node mRID for each sync machine. It is set as the first existing of
# 1) mRID of the topological node associated with the connectivity node for the terminal associated
# with the sync machine
# 2) mRID of the toplogical node associated with the terminal for the sync machine
# 2) mRID of the topological node associated with the terminal for the sync machine
bind(coalesce(?con_top_node_mrid, ?term_top_node_mrid, ?t_mrid) as ?node)
bind(coalesce(?_network_analysis, True) as ?network_analysis)

# Assign a status flag. If exists, the in_service flag for the sync machine is used. Otherwise,
# the connected flag of the terminal associated with the sync machine is used
bind(coalesce(?in_service, ?connected) as ?status)
bind(xsd:double(str(?apctmax)) * xsd:double(str(?maxP)) / 100.0 as ?allocationmax)
}

0 comments on commit b13c080

Please sign in to comment.