Commit 4a9503e8 authored by Richard Marston's avatar Richard Marston
Browse files

Merge branch '23-use-python-files-generated-by-new-version-of-cimgen' into 'master'

Resolve "Use python files generated by new version of cimgen"

Closes #23

See merge request !16
parents c5d9bee8 712df574
Pipeline #335282 passed with stages
in 3 minutes and 4 seconds
......@@ -28,6 +28,8 @@ RUN pip3 install pytest
RUN pip3 install pytest-check
# ADD . /cimpy
ADD . /cimpy
# WORKDIR /cimpy
\ No newline at end of file
WORKDIR /cimpy
RUN python3 setup.py install
from cimpy.cgmes_v2_4_15.ConductingEquipment import ConductingEquipment
from .ConductingEquipment import ConductingEquipment
class ACDCConverter(ConductingEquipment):
......@@ -12,23 +12,23 @@ class ACDCConverter(ConductingEquipment):
:numberOfValves: Number of valves in the converter. Used in loss calculations. Default: 0
:ratedUdc: Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: 0.0
:resistiveLoss: Converter configuration data used in power flow. Refer to poleLossP. Default: 0.0
:switchingLoss: Switching losses, relative to the base apparent power 'baseS'. Refer to poleLossP. Default: 0.0
:switchingLoss: Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: 0.0
:valveU0: Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: 0.0
:DCTerminals: Default: "list"
:PccTerminal: All converters' DC sides linked to this point of common coupling terminal. Default: None
:idc: Converter DC current, also called Id. Converter state variable, result from power flow. Default: 0.0
:poleLossP: The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: 0.0
:uc: Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: 0.0
:udc: Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: 0.0
:PccTerminal: All converters` DC sides linked to this point of common coupling terminal. Default: None
:p: Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: 0.0
:q: Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: 0.0
:targetPpcc: Real power injection target in AC grid, at point of common coupling. Default: 0.0
:targetUdc: Target value for DC voltage magnitude. Default: 0.0
:idc: Converter DC current, also called Id. Converter state variable, result from power flow. Default: 0.0
:poleLossP: The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: 0.0
:uc: Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: 0.0
:udc: Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: 0.0
'''
cgmesProfile = ConductingEquipment.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, ],
possibleProfileList = {'class': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, ],
'baseS': [cgmesProfile.EQ.value, ],
'idleLoss': [cgmesProfile.EQ.value, ],
'maxUdc': [cgmesProfile.EQ.value, ],
......@@ -40,21 +40,21 @@ class ACDCConverter(ConductingEquipment):
'valveU0': [cgmesProfile.EQ.value, ],
'DCTerminals': [cgmesProfile.EQ.value, ],
'PccTerminal': [cgmesProfile.EQ.value, ],
'idc': [cgmesProfile.SV.value, ],
'poleLossP': [cgmesProfile.SV.value, ],
'uc': [cgmesProfile.SV.value, ],
'udc': [cgmesProfile.SV.value, ],
'p': [cgmesProfile.SSH.value, ],
'q': [cgmesProfile.SSH.value, ],
'targetPpcc': [cgmesProfile.SSH.value, ],
'targetUdc': [cgmesProfile.SSH.value, ],
'idc': [cgmesProfile.SV.value, ],
'poleLossP': [cgmesProfile.SV.value, ],
'uc': [cgmesProfile.SV.value, ],
'udc': [cgmesProfile.SV.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class ConductingEquipment: \n' + ConductingEquipment.__doc__
def __init__(self, baseS = 0.0, idleLoss = 0.0, maxUdc = 0.0, minUdc = 0.0, numberOfValves = 0, ratedUdc = 0.0, resistiveLoss = 0.0, switchingLoss = 0.0, valveU0 = 0.0, DCTerminals = "list", PccTerminal = None, idc = 0.0, poleLossP = 0.0, uc = 0.0, udc = 0.0, p = 0.0, q = 0.0, targetPpcc = 0.0, targetUdc = 0.0, *args, **kw_args):
def __init__(self, baseS = 0.0, idleLoss = 0.0, maxUdc = 0.0, minUdc = 0.0, numberOfValves = 0, ratedUdc = 0.0, resistiveLoss = 0.0, switchingLoss = 0.0, valveU0 = 0.0, DCTerminals = "list", PccTerminal = None, p = 0.0, q = 0.0, targetPpcc = 0.0, targetUdc = 0.0, idc = 0.0, poleLossP = 0.0, uc = 0.0, udc = 0.0, *args, **kw_args):
super().__init__(*args, **kw_args)
self.baseS = baseS
......@@ -68,14 +68,14 @@ class ACDCConverter(ConductingEquipment):
self.valveU0 = valveU0
self.DCTerminals = DCTerminals
self.PccTerminal = PccTerminal
self.idc = idc
self.poleLossP = poleLossP
self.uc = uc
self.udc = udc
self.p = p
self.q = q
self.targetPpcc = targetPpcc
self.targetUdc = targetUdc
self.idc = idc
self.poleLossP = poleLossP
self.uc = uc
self.udc = udc
def __str__(self):
str = 'class=ACDCConverter\n'
......
from cimpy.cgmes_v2_4_15.DCBaseTerminal import DCBaseTerminal
from .DCBaseTerminal import DCBaseTerminal
class ACDCConverterDCTerminal(DCBaseTerminal):
......
from cimpy.cgmes_v2_4_15.IdentifiedObject import IdentifiedObject
from .IdentifiedObject import IdentifiedObject
class ACDCTerminal(IdentifiedObject):
......@@ -6,17 +6,19 @@ class ACDCTerminal(IdentifiedObject):
An electrical connection point (AC or DC) to a piece of conducting equipment. Terminals are connected at physical connection points called connectivity nodes.
:BusNameMarker: The bus name marker used to name the bus (topological node). Default: None
:sequenceNumber: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the "starting point" for a two terminal branch. Default: 0
:sequenceNumber: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the `starting point` for a two terminal branch. Default: 0
:OperationalLimitSet: Default: "list"
:Measurements: Measurements associated with this terminal defining where the measurement is placed in the network topology. It may be used, for instance, to capture the sensor position, such as a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. Default: "list"
:connected: The connected status is related to a bus-branch model and the topological node to terminal relation. True implies the terminal is connected to the related topological node and false implies it is not. In a bus-branch model, the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the topological node to terminal relation. A valid case is that conducting equipment can be connected in one end and open in the other. In particular for an AC line segment, where the reactive line charging can be significant, this is a relevant case. Default: False
'''
cgmesProfile = IdentifiedObject.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.DY.value, cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, cgmesProfile.TP.value, ],
possibleProfileList = {'class': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, cgmesProfile.DY.value, cgmesProfile.TP.value, ],
'BusNameMarker': [cgmesProfile.EQ.value, ],
'sequenceNumber': [cgmesProfile.EQ.value, ],
'OperationalLimitSet': [cgmesProfile.EQ.value, ],
'Measurements': [cgmesProfile.EQ.value, ],
'connected': [cgmesProfile.SSH.value, ],
}
......@@ -24,12 +26,13 @@ class ACDCTerminal(IdentifiedObject):
__doc__ += '\n Documentation of parent class IdentifiedObject: \n' + IdentifiedObject.__doc__
def __init__(self, BusNameMarker = None, sequenceNumber = 0, OperationalLimitSet = "list", connected = False, *args, **kw_args):
def __init__(self, BusNameMarker = None, sequenceNumber = 0, OperationalLimitSet = "list", Measurements = "list", connected = False, *args, **kw_args):
super().__init__(*args, **kw_args)
self.BusNameMarker = BusNameMarker
self.sequenceNumber = sequenceNumber
self.OperationalLimitSet = OperationalLimitSet
self.Measurements = Measurements
self.connected = connected
def __str__(self):
......
from cimpy.cgmes_v2_4_15.Conductor import Conductor
from .Conductor import Conductor
class ACLineSegment(Conductor):
......
from .Measurement import Measurement
class Accumulator(Measurement):
'''
Accumulator represents an accumulated (counted) Measurement, e.g. an energy value.
:LimitSets: The Measurements using the LimitSet. Default: "list"
:AccumulatorValues: Measurement to which this value is connected. Default: "list"
'''
cgmesProfile = Measurement.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'LimitSets': [cgmesProfile.EQ.value, ],
'AccumulatorValues': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Measurement: \n' + Measurement.__doc__
def __init__(self, LimitSets = "list", AccumulatorValues = "list", *args, **kw_args):
super().__init__(*args, **kw_args)
self.LimitSets = LimitSets
self.AccumulatorValues = AccumulatorValues
def __str__(self):
str = 'class=Accumulator\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .Limit import Limit
class AccumulatorLimit(Limit):
'''
Limit values for Accumulator measurements.
:value: The value to supervise against. The value is positive. Default: 0
:LimitSet: The limit values used for supervision of Measurements. Default: None
'''
cgmesProfile = Limit.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'value': [cgmesProfile.EQ.value, ],
'LimitSet': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Limit: \n' + Limit.__doc__
def __init__(self, value = 0, LimitSet = None, *args, **kw_args):
super().__init__(*args, **kw_args)
self.value = value
self.LimitSet = LimitSet
def __str__(self):
str = 'class=AccumulatorLimit\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .LimitSet import LimitSet
class AccumulatorLimitSet(LimitSet):
'''
An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement.
:Measurements: A measurement may have zero or more limit ranges defined for it. Default: "list"
:Limits: The set of limits. Default: "list"
'''
cgmesProfile = LimitSet.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'Measurements': [cgmesProfile.EQ.value, ],
'Limits': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class LimitSet: \n' + LimitSet.__doc__
def __init__(self, Measurements = "list", Limits = "list", *args, **kw_args):
super().__init__(*args, **kw_args)
self.Measurements = Measurements
self.Limits = Limits
def __str__(self):
str = 'class=AccumulatorLimitSet\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .Control import Control
class AccumulatorReset(Control):
'''
This command reset the counter value to zero.
:AccumulatorValue: The accumulator value that is reset by the command. Default: None
'''
cgmesProfile = Control.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'AccumulatorValue': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Control: \n' + Control.__doc__
def __init__(self, AccumulatorValue = None, *args, **kw_args):
super().__init__(*args, **kw_args)
self.AccumulatorValue = AccumulatorValue
def __str__(self):
str = 'class=AccumulatorReset\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .MeasurementValue import MeasurementValue
class AccumulatorValue(MeasurementValue):
'''
AccumulatorValue represents an accumulated (counted) MeasurementValue.
:Accumulator: The values connected to this measurement. Default: None
:AccumulatorReset: The command that reset the accumulator value. Default: None
:value: The value to supervise. The value is positive. Default: 0
'''
cgmesProfile = MeasurementValue.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'Accumulator': [cgmesProfile.EQ.value, ],
'AccumulatorReset': [cgmesProfile.EQ.value, ],
'value': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class MeasurementValue: \n' + MeasurementValue.__doc__
def __init__(self, Accumulator = None, AccumulatorReset = None, value = 0, *args, **kw_args):
super().__init__(*args, **kw_args)
self.Accumulator = Accumulator
self.AccumulatorReset = AccumulatorReset
self.value = value
def __str__(self):
str = 'class=AccumulatorValue\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from cimpy.cgmes_v2_4_15.Base import Base
from .Base import Base
class ActivePower(Base):
......@@ -12,10 +12,10 @@ class ActivePower(Base):
cgmesProfile = Base.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.DY.value, cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, ],
'value': [cgmesProfile.DY.value, cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, ],
'unit': [cgmesProfile.DY.value, cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, ],
'multiplier': [cgmesProfile.DY.value, cgmesProfile.EQ.value, cgmesProfile.SV.value, cgmesProfile.SSH.value, ],
possibleProfileList = {'class': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, cgmesProfile.DY.value, ],
'value': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, cgmesProfile.DY.value, ],
'unit': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, cgmesProfile.DY.value, ],
'multiplier': [cgmesProfile.EQ.value, cgmesProfile.SSH.value, cgmesProfile.SV.value, cgmesProfile.DY.value, ],
}
serializationProfile = {}
......
from .OperationalLimit import OperationalLimit
class ActivePowerLimit(OperationalLimit):
'''
Limit on active power flow.
:value: Value of active power limit. Default: 0.0
'''
cgmesProfile = OperationalLimit.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'value': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class OperationalLimit: \n' + OperationalLimit.__doc__
def __init__(self, value = 0.0, *args, **kw_args):
super().__init__(*args, **kw_args)
self.value = value
def __str__(self):
str = 'class=ActivePowerLimit\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from cimpy.cgmes_v2_4_15.Base import Base
from .Base import Base
class ActivePowerPerCurrentFlow(Base):
......
from cimpy.cgmes_v2_4_15.Base import Base
from .Base import Base
class ActivePowerPerFrequency(Base):
......
from .Measurement import Measurement
class Analog(Measurement):
'''
Analog represents an analog Measurement.
:positiveFlowIn: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. Default: False
:AnalogValues: Measurement to which this value is connected. Default: "list"
:LimitSets: The Measurements using the LimitSet. Default: "list"
'''
cgmesProfile = Measurement.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'positiveFlowIn': [cgmesProfile.EQ.value, ],
'AnalogValues': [cgmesProfile.EQ.value, ],
'LimitSets': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Measurement: \n' + Measurement.__doc__
def __init__(self, positiveFlowIn = False, AnalogValues = "list", LimitSets = "list", *args, **kw_args):
super().__init__(*args, **kw_args)
self.positiveFlowIn = positiveFlowIn
self.AnalogValues = AnalogValues
self.LimitSets = LimitSets
def __str__(self):
str = 'class=Analog\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .Control import Control
class AnalogControl(Control):
'''
An analog control used for supervisory control.
:maxValue: Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: 0.0
:minValue: Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: 0.0
:AnalogValue: The Control variable associated with the MeasurementValue. Default: None
'''
cgmesProfile = Control.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'maxValue': [cgmesProfile.EQ.value, ],
'minValue': [cgmesProfile.EQ.value, ],
'AnalogValue': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Control: \n' + Control.__doc__
def __init__(self, maxValue = 0.0, minValue = 0.0, AnalogValue = None, *args, **kw_args):
super().__init__(*args, **kw_args)
self.maxValue = maxValue
self.minValue = minValue
self.AnalogValue = AnalogValue
def __str__(self):
str = 'class=AnalogControl\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .Limit import Limit
class AnalogLimit(Limit):
'''
Limit values for Analog measurements.
:value: The value to supervise against. Default: 0.0
:LimitSet: The limit values used for supervision of Measurements. Default: None
'''
cgmesProfile = Limit.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'value': [cgmesProfile.EQ.value, ],
'LimitSet': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class Limit: \n' + Limit.__doc__
def __init__(self, value = 0.0, LimitSet = None, *args, **kw_args):
super().__init__(*args, **kw_args)
self.value = value
self.LimitSet = LimitSet
def __str__(self):
str = 'class=AnalogLimit\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .LimitSet import LimitSet
class AnalogLimitSet(LimitSet):
'''
An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement.
:Measurements: A measurement may have zero or more limit ranges defined for it. Default: "list"
:Limits: The set of limits. Default: "list"
'''
cgmesProfile = LimitSet.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'Measurements': [cgmesProfile.EQ.value, ],
'Limits': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class LimitSet: \n' + LimitSet.__doc__
def __init__(self, Measurements = "list", Limits = "list", *args, **kw_args):
super().__init__(*args, **kw_args)
self.Measurements = Measurements
self.Limits = Limits
def __str__(self):
str = 'class=AnalogLimitSet\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from .MeasurementValue import MeasurementValue
class AnalogValue(MeasurementValue):
'''
AnalogValue represents an analog MeasurementValue.
:Analog: The values connected to this measurement. Default: None
:AnalogControl: The MeasurementValue that is controlled. Default: None
:value: The value to supervise. Default: 0.0
'''
cgmesProfile = MeasurementValue.cgmesProfile
possibleProfileList = {'class': [cgmesProfile.EQ.value, ],
'Analog': [cgmesProfile.EQ.value, ],
'AnalogControl': [cgmesProfile.EQ.value, ],
'value': [cgmesProfile.EQ.value, ],
}
serializationProfile = {}
__doc__ += '\n Documentation of parent class MeasurementValue: \n' + MeasurementValue.__doc__
def __init__(self, Analog = None, AnalogControl = None, value = 0.0, *args, **kw_args):
super().__init__(*args, **kw_args)
self.Analog = Analog
self.AnalogControl = AnalogControl
self.value = value
def __str__(self):
str = 'class=AnalogValue\n'
attributes = self.__dict__
for key in attributes.keys():
str = str + key + '={}\n'.format(attributes[key])
return str
from cimpy.cgmes_v2_4_15.Base import Base
from .Base import Base
class AngleDegrees(Base):
......@@ -12,10 +12,10 @@ class AngleDegrees(Base):
cgmesProfile = Base.cgmesProfile