def test_more_than_one_impedance_returns_error(self): per_length_sequence_impedance = PerLengthSequenceImpedance() per_length_phase_impedance = PerLengthPhaseImpedance() with pytest.raises(ValueError): ac_line_segment = ACLineSegment( PhaseImpedance=per_length_phase_impedance, SequenceImpedance=per_length_sequence_impedance)
def test_sets_per_length_impedance_given_sequence_via_generic(self): per_length_sequence_impedance = PerLengthSequenceImpedance() ac_line_segment = ACLineSegment( PerLengthImpedance=per_length_sequence_impedance) assert ac_line_segment.PerLengthImpedance == per_length_sequence_impedance assert ac_line_segment.SequenceImpedance == per_length_sequence_impedance assert ac_line_segment.PhaseImpedance is None
def testInstantiation(self): """Test element instantiation. """ ThermalGeneratingUnit(oMCost=6.0, variableCost=10.0) GenUnitOpCostCurve(name="curve1", isNetGrossP=True) GenUnitOpSchedule(timeStep=1.0) StartupModel(name="model1", startupCost=20.0) ConformLoad(aggregate=True, pfixed=30.0) clg = ConformLoadGroup(aliasName="group1") LoadArea(name="area1") cls = ConformLoadSchedule(ConformLoadGroup=clg) self.assertEqual(cls.ConformLoadGroup, clg) AnalogLimit(value=100.0) AnalogValue(value=6.0) Analog(maxValue=100.0) ProtectionEquipment(normallyInService=True) CurrentRelay(inverseTimeFlag=True) tn = TopologicalNode(name="tn1") cn = ConnectivityNode(TopologicalNode=tn) self.assertTrue(cn.TopologicalNode, tn) Terminal(connected=True) Breaker(ratedCurrent=20.0) SynchronousMachine(coolantType="water") BusbarSection(normallyInService=True) ACLineSegment(r=0.1, length=10.0) ReactiveCapabilityCurve(coolantTemperature=20.0) te = PowerTransformerEnd(x0=0.1) pt = PowerTransformer(PowerTransformerEnd=[te]) self.assertTrue(te in pt.PowerTransformerEnd)
def test_ac_line_segment_phases_sets_attributes(self): ac_line_segment = ACLineSegment() ac_line_segment_phase = ACLineSegmentPhase('A', ac_line_segment) assert ac_line_segment_phase.phase == 'A' assert ac_line_segment_phase.ACLineSegment == ac_line_segment