From 33c3dd364d75bccc532647f9adff985296e96874 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Tue, 1 Mar 2022 17:46:52 -0300 Subject: [PATCH 1/9] tests: Updates for DSS C-API 0.12, except the changes related to miles Ref: https://sourceforge.net/p/electricdss/code/3218/ --- opendssdirect/LoadShape.py | 4 +- opendssdirect/YMatrix.py | 2 +- tests/test_opendssdirect.py | 142 ++++++++++++++++++------------------ 3 files changed, 73 insertions(+), 75 deletions(-) diff --git a/opendssdirect/LoadShape.py b/opendssdirect/LoadShape.py index 8d578f3..8ae1e2b 100644 --- a/opendssdirect/LoadShape.py +++ b/opendssdirect/LoadShape.py @@ -160,11 +160,11 @@ def UseActual(*args): def SInterval(*args): # Getter if len(args) == 0: - return CheckForError(lib.LoadShapes_Get_sInterval()) + return CheckForError(lib.LoadShapes_Get_SInterval()) # Setter Value, = args - CheckForError(lib.LoadShapes_Set_Sinterval(Value)) + CheckForError(lib.LoadShapes_Set_SInterval(Value)) def Idx(*args): diff --git a/opendssdirect/YMatrix.py b/opendssdirect/YMatrix.py index a7d00d8..0f62d46 100644 --- a/opendssdirect/YMatrix.py +++ b/opendssdirect/YMatrix.py @@ -24,7 +24,7 @@ def getYsparse(factor=True): # return as (data, indices, indptr) that can fed into scipy.sparse.csc_matrix res = ( np.frombuffer( - ffi.buffer(cValsPtr[0], nNz[0] * 16), dtype=np.complex + ffi.buffer(cValsPtr[0], nNz[0] * 16), dtype=complex ).copy(), np.frombuffer(ffi.buffer(RowIdxPtr[0], nNz[0] * 4), dtype=np.int32).copy(), np.frombuffer( diff --git a/tests/test_opendssdirect.py b/tests/test_opendssdirect.py index 412c154..d226a55 100644 --- a/tests/test_opendssdirect.py +++ b/tests/test_opendssdirect.py @@ -243,7 +243,6 @@ def test_13Node_Basic(dss): assert dss.Basic.AllowForms() is False dss_classes = [ - u"Solution", u"LineCode", u"LoadShape", u"TShape", @@ -255,8 +254,8 @@ def test_13Node_Basic(dss): u"WireData", u"CNData", u"TSData", - u"LineGeometry", u"LineSpacing", + u"LineGeometry", u"XfmrCode", u"Line", u"Vsource", @@ -905,7 +904,7 @@ def test_13Node_Circuit(dss): with pt.raises(dss.DSSException): dss.Circuit.SetActiveClass("") - assert dss.Circuit.SetActiveClass("Load") == 20 + assert dss.Circuit.SetActiveClass("Load") == 19 assert dss.Circuit.SetActiveElement("") == -1 assert dss.Circuit.SubstationLosses() == [0.0, 0.0] @@ -1618,11 +1617,11 @@ def test_13Node_Executive(dss): == u"Create a new object within the DSS. Object becomes the active object\nExample: New Line.line1 ..." ) assert ( - dss.Executive.NumCommands() == 118 - ) # adjusted to the latest version on 2020-12-28 + dss.Executive.NumCommands() == 125 + ) # adjusted to the latest version on 2022-03-22 assert ( - dss.Executive.NumOptions() == 115 - ) # adjusted to the latest version on 2020-07-28 + dss.Executive.NumOptions() == 124 + ) # adjusted to the latest version on 2022-02-28 assert dss.Executive.Option(1) == u"type" assert ( dss.Executive.OptionHelp(1) @@ -1728,7 +1727,7 @@ def test_13Node_Lines(dss): assert dss.Lines.Spacing() == u"" assert dss.Lines.Units() == 5 assert dss.Lines.Xg() == 0.155081 - assert dss.Lines.Yprim() == [ + np.testing.assert_array_almost_equal(dss.Lines.Yprim(), [ 3.4335554553543783, -9.8965831153747, -1.4568043853617796, @@ -1801,7 +1800,7 @@ def test_13Node_Lines(dss): 2.0889991803940724, 2.658753201413196, -8.847115639537611, - ] + ]) with pt.raises(dss.DSSException): # This is not allowed at the moment (the value is/was ignored before) # so an exception was added in case someone was trying to use it @@ -1886,7 +1885,7 @@ def test_13Node_Loads(dss): assert dss.Loads.XfkVA() == 0.0 assert dss.Loads.Xneut() == 0.0 assert dss.Loads.Yearly() == u"" - assert dss.Loads.ZipV() == [] + assert dss.Loads.ZipV() == [0, 0, 0, 0, 0, 0, 0] assert dss.Loads.kV() == 0.277 assert dss.Loads.kVABase() == 194.164878389476 assert dss.Loads.kW() == 160.0 @@ -2337,14 +2336,14 @@ def test_13Node_Transformers(dss): assert dss.Transformers.Next() == 2 assert dss.Transformers.NumTaps() == 32 assert dss.Transformers.NumWindings() == 2 - assert dss.Transformers.R() == 5e-05 + assert dss.Transformers.R() == 5e-03 assert dss.Transformers.Rneut() == -1.0 assert dss.Transformers.Tap() == 1.05625 assert dss.Transformers.Wdg() == 2 assert dss.Transformers.XfmrCode() == u"" - assert dss.Transformers.Xhl() == 0.0001 - assert dss.Transformers.Xht() == 0.35 - assert dss.Transformers.Xlt() == 0.3 + assert dss.Transformers.Xhl() == 0.01 + assert dss.Transformers.Xht() == 35 + assert dss.Transformers.Xlt() == 30 assert dss.Transformers.Xneut() == 0.0 assert dss.Transformers.kV() == 2.4 assert dss.Transformers.kVA() == 1666.0 @@ -4185,21 +4184,21 @@ def test_loads_to_dataframe(dss): "692": "", }, "ZipV": { - "611": [], - "634a": [], - "634b": [], - "634c": [], - "645": [], - "646": [], - "652": [], - "670a": [], - "670b": [], - "670c": [], - "671": [], - "675a": [], - "675b": [], - "675c": [], - "692": [], + "611": [0, 0, 0, 0, 0, 0, 0], + "634a": [0, 0, 0, 0, 0, 0, 0], + "634b": [0, 0, 0, 0, 0, 0, 0], + "634c": [0, 0, 0, 0, 0, 0, 0], + "645": [0, 0, 0, 0, 0, 0, 0], + "646": [0, 0, 0, 0, 0, 0, 0], + "652": [0, 0, 0, 0, 0, 0, 0], + "670a": [0, 0, 0, 0, 0, 0, 0], + "670b": [0, 0, 0, 0, 0, 0, 0], + "670c": [0, 0, 0, 0, 0, 0, 0], + "671": [0, 0, 0, 0, 0, 0, 0], + "675a": [0, 0, 0, 0, 0, 0, 0], + "675b": [0, 0, 0, 0, 0, 0, 0], + "675c": [0, 0, 0, 0, 0, 0, 0], + "692": [0, 0, 0, 0, 0, 0, 0], }, "kV": { "611": 2.4, @@ -4498,11 +4497,11 @@ def test_transformers_to_dataframe(dss): "NumTaps": {"reg1": 32, "reg2": 32, "reg3": 32, "sub": 32, "xfm1": 32}, "NumWindings": {"reg1": 2, "reg2": 2, "reg3": 2, "sub": 2, "xfm1": 2}, "R": { - "reg1": 5e-05, - "reg2": 5e-05, - "reg3": 5e-05, - "sub": 5e-06, - "xfm1": 0.0055000000000000005, + "reg1": 5e-03, + "reg2": 5e-03, + "reg3": 5e-03, + "sub": 5e-04, + "xfm1": 0.55000000000000005, }, "Rneut": { "reg1": -1.0, @@ -4521,20 +4520,20 @@ def test_transformers_to_dataframe(dss): "Wdg": {"reg1": 2, "reg2": 2, "reg3": 2, "sub": 2, "xfm1": 2}, "XfmrCode": {"reg1": "", "reg2": "", "reg3": "", "sub": "", "xfm1": ""}, "Xhl": { - "reg1": 0.0001, - "reg2": 0.0001, - "reg3": 0.0001, - "sub": 8e-05, - "xfm1": 0.02, + "reg1": 0.01, + "reg2": 0.01, + "reg3": 0.01, + "sub": 8e-03, + "xfm1": 2, }, "Xht": { - "reg1": 0.35, - "reg2": 0.35, - "reg3": 0.35, - "sub": 0.04, - "xfm1": 0.01, + "reg1": 35, + "reg2": 35, + "reg3": 35, + "sub": 4, + "xfm1": 1, }, - "Xlt": {"reg1": 0.3, "reg2": 0.3, "reg3": 0.3, "sub": 0.04, "xfm1": 0.01}, + "Xlt": {"reg1": 30, "reg2": 30, "reg3": 30, "sub": 4, "xfm1": 1}, "Xneut": {"reg1": 0.0, "reg2": 0.0, "reg3": 0.0, "sub": 0.0, "xfm1": 0.0}, "kV": {"reg1": 2.4, "reg2": 2.4, "reg3": 2.4, "sub": 4.16, "xfm1": 0.48}, "kVA": { @@ -4757,13 +4756,13 @@ def test_storage_to_dataframe(dss): "Balanced": {"Storage.631": "No"}, "ChargeTrigger": {"Storage.631": "0"}, "DischargeTrigger": {"Storage.631": "0"}, - "DispMode": {"Storage.631": "default"}, + "DispMode": {"Storage.631": "Default"}, "DynaDLL": {"Storage.631": ""}, - "DynaData": {"Storage.631": ()}, + "DynaData": {"Storage.631": ""}, "LimitCurrent": {"Storage.631": "No"}, - "State": {"Storage.631": "IDLING"}, + "State": {"Storage.631": "Idling"}, "TimeChargeTrig": {"Storage.631": "2"}, - "UserData": {"Storage.631": ()}, + "UserData": {"Storage.631": ""}, "UserModel": {"Storage.631": ""}, "Vmaxpu": {"Storage.631": "1.1"}, "Vminpu": {"Storage.631": "0.9"}, @@ -4772,9 +4771,9 @@ def test_storage_to_dataframe(dss): "class": {"Storage.631": "1"}, "conn": {"Storage.631": "wye"}, "daily": {"Storage.631": ""}, - "debugtrace": {"Storage.631": "NO"}, + "debugtrace": {"Storage.631": "No"}, "duty": {"Storage.631": ""}, - "enabled": {"Storage.631": True}, + "enabled": {"Storage.631": "Yes"}, "kVA": {"Storage.631": "25"}, "kW": {"Storage.631": "0"}, "kWhrated": {"Storage.631": "50"}, @@ -4812,7 +4811,6 @@ def test_storage_to_dataframe(dss): "%EffCharge": {"Storage.631": "90"}, "%EffDischarge": {"Storage.631": "90"}, "%IdlingkW": {"Storage.631": "1"}, - "%Idlingkvar": {"Storage.631": ""}, "%R": {"Storage.631": "0"}, "%X": {"Storage.631": "50"}, "%reserve": {"Storage.631": "20"}, @@ -4820,13 +4818,13 @@ def test_storage_to_dataframe(dss): "Balanced": {"Storage.631": "No"}, "ChargeTrigger": {"Storage.631": "0"}, "DischargeTrigger": {"Storage.631": "0"}, - "DispMode": {"Storage.631": "default"}, + "DispMode": {"Storage.631": "Default"}, "DynaDLL": {"Storage.631": ""}, - "DynaData": {"Storage.631": ()}, + "DynaData": {"Storage.631": ""}, "LimitCurrent": {"Storage.631": "No"}, - "State": {"Storage.631": "IDLING"}, + "State": {"Storage.631": "Idling"}, "TimeChargeTrig": {"Storage.631": "2"}, - "UserData": {"Storage.631": ()}, + "UserData": {"Storage.631": ""}, "UserModel": {"Storage.631": ""}, "Vmaxpu": {"Storage.631": "1.1"}, "Vminpu": {"Storage.631": "0.9"}, @@ -4835,11 +4833,11 @@ def test_storage_to_dataframe(dss): "class": {"Storage.631": "1"}, "conn": {"Storage.631": "wye"}, "daily": {"Storage.631": ""}, - "debugtrace": {"Storage.631": "NO"}, + "debugtrace": {"Storage.631": "No"}, "duty": {"Storage.631": ""}, - "enabled": {"Storage.631": True}, + "enabled": {"Storage.631": "Yes"}, "kVA": {"Storage.631": "25"}, - "kW": {"Storage.631": "0"}, + "kW": {"Storage.631": "-0.25"}, "kWhrated": {"Storage.631": "50"}, "kWhstored": {"Storage.631": "50"}, "kWrated": {"Storage.631": "25"}, @@ -4857,9 +4855,9 @@ def test_storage_to_dataframe(dss): "%PminkvarMax": {"Storage.631": "-1"}, "%kWrated": {"Storage.631": "100"}, "EffCurve": {"Storage.631": ""}, - "PFPriority": {"Storage.631": "NO"}, + "PFPriority": {"Storage.631": "No"}, "VarFollowInverter": {"Storage.631": "No"}, - "WattPriority": {"Storage.631": "NO"}, + "WattPriority": {"Storage.631": "No"}, "kvarMax": {"Storage.631": "25"}, "kvarMaxAbs": {"Storage.631": "25"}, } @@ -4903,23 +4901,23 @@ def test_linegeometry_class_to_dataframe(): "linegeometry.hc2_336_1neut_0mess": { "Seasons": "1", "Ratings": ["0"], - "LineType": "ug", + "LineType": "oh", "nconds": "4", "nphases": "3", "cond": "4", - "wire": "ACSR1/0", + "wire": "acsr1/0", "x": [-1.2909, -0.1530096, 0.5737, 0.0], "h": [13.716, 4.1806368, 13.716, 14.648], "units": ["m", "ft", "m", "m"], - "normamps": "0", - "emergamps": "0", - "reduce": "", + "normamps": "530", + "emergamps": "795", + "reduce": "No", "spacing": "", - "wires": ["acsr336 acsr336 acsr336 ACSR1/0"], - "cncable": "ACSR1/0", - "tscable": "ACSR1/0", - "cncables": ["acsr336 acsr336 acsr336 ACSR1/0"], - "tscables": ["acsr336 acsr336 acsr336 ACSR1/0"], + "wires": ["acsr336", "acsr336", "acsr336", "acsr1/0"], + "cncable": "acsr1/0", + "tscable": "acsr1/0", + "cncables": ["acsr336", "acsr336", "acsr336", "acsr1/0"], + "tscables": ["acsr336", "acsr336", "acsr336", "acsr1/0"], "like": "", } } @@ -5744,7 +5742,7 @@ def test_wiredata_class_to_dataframe(): "GMRac": "0.00446", "GMRunits": "ft", "Rac": "1.12", - "Rdc": "1.09804", + "Rdc": "1.09803921568627", "Runits": "mi", "diam": "0.398", "emergamps": "345", From 600c0bc10560b61ed3c3c7fbc25204db3a14a3c4 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Tue, 1 Mar 2022 18:29:17 -0300 Subject: [PATCH 2/9] tests: remove "no_ext_errors" version of the tests. Probably enough time has passed since the extended error handling was introduced. --- tests/test_opendssdirect_no_ext_errors.py | 6015 --------------------- 1 file changed, 6015 deletions(-) delete mode 100644 tests/test_opendssdirect_no_ext_errors.py diff --git a/tests/test_opendssdirect_no_ext_errors.py b/tests/test_opendssdirect_no_ext_errors.py deleted file mode 100644 index 0ae8e18..0000000 --- a/tests/test_opendssdirect_no_ext_errors.py +++ /dev/null @@ -1,6015 +0,0 @@ -# -*- coding: utf-8 -*- -import pytest as pt -import os -import pandas as pd -from pandas.util.testing import assert_dict_equal -import numpy as np - -current_directory = os.path.dirname(os.path.realpath(__file__)) -PATH_TO_DSS = os.path.abspath( - os.path.join(current_directory, "./data/13Bus/IEEE13Nodeckt.dss") -) - - -@pt.fixture() -def dss(): - import opendssdirect as dss - - dss.Error.ExtendedErrors(False) - - assert ( - dss.utils.run_command("Redirect {}".format(PATH_TO_DSS)) == "" - ), "Unable to find test data" - - return dss - - -def test_extended_errors(dss): - assert not dss.Error.ExtendedErrors() - - -def test_package_import(): - - import opendssdirect - - assert getattr(opendssdirect, "__version__") is not None - - -def test_module_import(): - - import inspect - - from opendssdirect import ActiveClass as m - - assert inspect.ismodule(m) - - from opendssdirect import Basic as m - - assert inspect.ismodule(m) - - from opendssdirect import Bus as m - - assert inspect.ismodule(m) - - from opendssdirect import Capacitors as m - - assert inspect.ismodule(m) - - from opendssdirect import CapControls as m - - assert inspect.ismodule(m) - - from opendssdirect import Circuit as m - - assert inspect.ismodule(m) - - from opendssdirect import CktElement as m - - assert inspect.ismodule(m) - - from opendssdirect import Element as m - - assert inspect.ismodule(m) - - from opendssdirect import Executive as m - - assert inspect.ismodule(m) - - from opendssdirect import Fuses as m - - assert inspect.ismodule(m) - - from opendssdirect import Generators as m - - assert inspect.ismodule(m) - - from opendssdirect import Isource as m - - assert inspect.ismodule(m) - - from opendssdirect import Lines as m - - assert inspect.ismodule(m) - - from opendssdirect import Loads as m - - assert inspect.ismodule(m) - - from opendssdirect import LoadShape as m - - assert inspect.ismodule(m) - - from opendssdirect import Meters as m - - assert inspect.ismodule(m) - - from opendssdirect import Monitors as m - - assert inspect.ismodule(m) - - from opendssdirect import Parser as m - - assert inspect.ismodule(m) - - from opendssdirect import PDElements as m - - assert inspect.ismodule(m) - - from opendssdirect import Properties as m - - assert inspect.ismodule(m) - - from opendssdirect import PVsystems as m - - assert inspect.ismodule(m) - - from opendssdirect import Reclosers as m - - assert inspect.ismodule(m) - - from opendssdirect import RegControls as m - - assert inspect.ismodule(m) - - from opendssdirect import Relays as m - - assert inspect.ismodule(m) - - from opendssdirect import Sensors as m - - assert inspect.ismodule(m) - - from opendssdirect import Settings as m - - assert inspect.ismodule(m) - - from opendssdirect import Solution as m - - assert inspect.ismodule(m) - - from opendssdirect import SwtControls as m - - assert inspect.ismodule(m) - - from opendssdirect import Topology as m - - assert inspect.ismodule(m) - - from opendssdirect import Transformers as m - - assert inspect.ismodule(m) - - from opendssdirect import Vsources as m - - assert inspect.ismodule(m) - - from opendssdirect import XYCurves as m - - assert inspect.ismodule(m) - - from opendssdirect import dss_lib as m - - assert inspect.ismodule(m) - - -def test_ActiveClass(dss): - - assert dss.ActiveClass.ActiveClassName() == u"Line" - assert dss.ActiveClass.AllNames() == [ - u"650632", - u"632670", - u"670671", - u"671680", - u"632633", - u"632645", - u"645646", - u"692675", - u"671684", - u"684611", - u"684652", - u"671692", - ] - assert dss.ActiveClass.Count() == 12 - assert dss.ActiveClass.First() == 1 - assert dss.ActiveClass.Name() == u"650632" - assert dss.ActiveClass.Next() == 2 - assert dss.ActiveClass.Next() == 3 - assert dss.ActiveClass.Name(u"650632") is None - assert dss.ActiveClass.Name() == u"650632" - assert dss.ActiveClass.NumElements() == 12 - - -def test_configuration(): - - import opendssdirect as dss - - # Test toggling the console output using AllowForms. - # Note COM's AllowForms can only be disabled and it ignores - # the user's command to reallow forms if they were previously - # disabled. - assert dss.Basic.AllowForms() is False, "Allow forms should be disabled by default" - - dss.Basic.AllowForms(True) - assert dss.Basic.AllowForms() is True - - dss.Basic.AllowForms(False) - assert dss.Basic.AllowForms() is False - - -def test_13Node(dss): - - assert dss.ActiveClass.ActiveClassName() == u"Line" - assert dss.ActiveClass.AllNames() == [ - u"650632", - u"632670", - u"670671", - u"671680", - u"632633", - u"632645", - u"645646", - u"692675", - u"671684", - u"684611", - u"684652", - u"671692", - ] - assert dss.ActiveClass.Count() == 12 - assert dss.ActiveClass.First() == 1 - assert dss.ActiveClass.Name() == u"650632" - assert dss.ActiveClass.Next() == 2 - assert dss.ActiveClass.NumElements() == 12 - - -def test_13Node_Basic(dss): - - assert dss.Basic.AllowForms() is False - dss_classes = [ - u"Solution", - u"LineCode", - u"LoadShape", - u"TShape", - u"PriceShape", - u"XYcurve", - u"GrowthShape", - u"TCC_Curve", - u"Spectrum", - u"WireData", - u"CNData", - u"TSData", - u"LineGeometry", - u"LineSpacing", - u"XfmrCode", - u"Line", - u"Vsource", - u"Isource", - u"VCCS", - u"Load", - u"Transformer", - u"RegControl", - u"Capacitor", - u"Reactor", - u"CapControl", - u"Fault", - u"Generator", - u"GenDispatcher", - u"Storage", - u"StorageController", - u"Relay", - u"Recloser", - u"Fuse", - u"SwtControl", - u"PVSystem", - u"UPFC", - u"UPFCControl", - u"ESPVLControl", - u"IndMach012", - u"GICsource", - u"AutoTrans", - u"InvControl", - u"ExpControl", - u"GICLine", - u"GICTransformer", - u"VSConverter", - u"Monitor", - u"EnergyMeter", - u"Sensor", - ] - assert dss.Basic.Classes() == dss_classes - assert dss.Basic.NumClasses() == len(dss_classes) - assert dss.Basic.ShowPanel() == 0 - assert dss.Basic.ClearAll() is None - assert os.path.abspath(dss.Basic.DataPath()) == os.path.abspath("." + os.sep) - # assert dss.Basic.DefaultEditor() == u'open -t' - assert dss.Basic.NewCircuit("Circuit") == u"New Circuit" - assert dss.Basic.NumCircuits() == 1 - assert dss.Basic.NumUserClasses() == 0 - assert dss.Basic.Reset() is None - assert dss.Basic.Start(1) == 1 - assert dss.Basic.UserClasses() == [] - from six import string_types - - # u'Version xxxx (64-bit build); License Status: Open ' - assert isinstance(dss.Basic.Version(), string_types) - - -def test_13Node_Bus(dss): - - assert dss.Bus.Coorddefined() == 1 - np.testing.assert_array_almost_equal( - dss.Bus.CplxSeqVoltages(), - [ - 7.275957614183426e-12, - 4.31951048085466e-06, - 57503.46213437529, - 33187.98898326319, - -0.7758574371237046, - 1.4866859858011594, - ], - decimal=4, - ) - assert dss.Bus.Cust_Duration() == 0.0 - assert dss.Bus.Cust_Interrupts() == 0.0 - assert dss.Bus.Distance() == 0.0 - assert dss.Bus.Int_Duration() == 0.0 - assert dss.Bus.Isc() == [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - assert dss.Bus.Lambda() == 0.0 - assert dss.Bus.N_Customers() == 0 - assert dss.Bus.N_interrupts() == 0.0 - assert dss.Bus.Name() == u"sourcebus" - assert dss.Bus.Nodes() == [1, 2, 3] - assert dss.Bus.NumNodes() == 3 - np.testing.assert_array_almost_equal( - dss.Bus.PuVoltage(), - [ - 0.866065862637831, - 0.4998770273321037, - -0.0001655104421677343, - -0.9999937910431469, - -0.8659003521956633, - 0.5001167639062155, - ], - decimal=4, - ) - assert dss.Bus.SectionID() == 0 - np.testing.assert_array_almost_equal( - dss.Bus.SeqVoltages(), - [4.3195104808607886e-06, 66393.45427218509, 1.6769585514012348], - decimal=4, - ) - assert dss.Bus.TotalMiles() == 0.0 - np.testing.assert_array_almost_equal( - dss.Bus.VLL(), - [ - 57513.675065203715, - 99584.34445786041, - 57480.70844478478, - -99600.26210451458, - -114994.38350998849, - 15.917646654175769, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.Bus.VMagAngle(), - [ - 66393.52536507105, - 29.99273887874033, - 66394.86975917802, - -90.00948289764032, - 66391.9679007487, - 149.99062319535992, - ], - decimal=4, - ) - assert dss.Bus.Voc() == [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - np.testing.assert_array_almost_equal( - dss.Bus.Voltages(), - [ - 57502.68619173074, - 33189.47560805491, - -10.988873472977797, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - ], - decimal=4, - ) - assert dss.Bus.X() == 200.0 - assert dss.Bus.Y() == 400.0 - assert dss.Bus.YscMatrix() == [0.0] - assert dss.Bus.Zsc0() == [0.0, 0.0] - assert dss.Bus.Zsc1() == [0.0, 0.0] - assert dss.Bus.ZscMatrix() == [0.0] - assert dss.Bus.ZscRefresh() == 1 - assert dss.Bus.kVBase() == 66.39528095680697 - np.testing.assert_array_almost_equal( - dss.Bus.puVLL(), - [ - 1.693378168100472e-11, - -4.667955969702419e-11, - -1.395316990173399e-06, - -5.577283842337346e-06, - 1.3953000563917182e-06, - 5.577330521897042e-06, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.Bus.puVmagAngle(), - [ - 5.239275814449394e-07, - -79.42845561076332, - 5.238427215809797e-07, - -79.4299867740603, - 9.484135993651139e-06, - 74.63582918382964, - ], - decimal=4, - ) - - assert dss.Bus.GetUniqueNodeNumber(6) == 6 - - # TODO: this should not be sorted, we should define the order of the results - assert sorted(dss.YMatrix.getV()[2:]) == sorted(dss.Circuit.AllBusVolts()) - - -def test_13Node_Circuit(dss): - - np.testing.assert_array_almost_equal( - dss.Circuit.AllBusDistances(), - [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.Circuit.AllBusMagPu(), - [ - 0.9999735600909612, - 0.9999938047400851, - 0.9999500974911693, - 0.9999107734075059, - 0.9999708382014062, - 0.9999310912254219, - 1.0560331208541838, - 1.0373856699381676, - 1.0560496734277571, - 1.011300431272264, - 1.0270174666164649, - 1.0015359172418576, - 0.9871584562161683, - 1.0084198145936507, - 0.9824418963411172, - 0.9827959271001375, - 1.0402765227909403, - 0.964869605360475, - 1.019729240260045, - 1.0022697678941448, - 1.0180132408663718, - 1.0002355078501333, - 0.9648695979124887, - 0.9827959177333715, - 1.040276521652259, - 0.9762713001854915, - 1.0426333240830927, - 0.9629347471054315, - 0.9608229488014672, - 0.9753328230988354, - 1.004024331469046, - 1.0318708269152446, - 0.9897380852516064, - 1.0143428459400463, - 1.0289449404033275, - 1.0041840427671582, - 0.9827959396392048, - 1.0402765376331038, - 0.9648696191496499, - 0.9808725592235161, - 0.9628392247223574, - ], - decimal=4, - ) - assert dss.Circuit.AllBusNames() == [ - u"sourcebus", - u"650", - u"rg60", - u"633", - u"634", - u"671", - u"645", - u"646", - u"692", - u"675", - u"611", - u"652", - u"670", - u"632", - u"680", - u"684", - ] - np.testing.assert_array_almost_equal( - dss.Circuit.AllBusVMag(), - [ - 66393.52536507105, - 66394.86975917802, - 66391.9679007487, - 2401.56281769503, - 2401.707078013379, - 2401.6116303002195, - 2536.356183513064, - 2491.569166053624, - 2536.395967032524, - 2428.9134443983507, - 2466.669542796113, - 2405.4712494206583, - 273.5686493536834, - 279.4618365839277, - 272.26306145992913, - 2360.449250025611, - 2498.5161614343156, - 2317.4104122074677, - 2449.1648383047186, - 2407.2335133239008, - 2445.0433932636856, - 2402.3476732030695, - 2317.410394319708, - 2360.4492275280204, - 2498.516158699491, - 2344.7779217733746, - 2504.1765204055864, - 2312.764169940423, - 2307.6916126474052, - 2342.5245548237963, - 2411.437109142391, - 2478.3265992504193, - 2377.1366272706323, - 2436.220997579146, - 2471.298754509891, - 2411.831213881805, - 2360.449280141501, - 2498.516197081946, - 2317.410445326153, - 2355.829723676905, - 2312.5340794532, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.Circuit.AllBusVolts(), - [ - 57502.68619173074, - 33189.47560805491, - -10.988873472977797, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493821, - -2079.717511753303, - -1200.3116004255198, - 2080.1419385890968, - 2536.35611735117, - -0.5793274158644572, - -1246.2598761513093, - -2157.487712670567, - -1267.587768293624, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562823, - -1300.0193437263497, - -2096.284412787372, - -1120.4211783202531, - 2128.6024323393126, - 273.12043190753747, - -15.65361248526227, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - -1295.6861264459185, - -2078.366153237622, - -1122.3854662972226, - 2129.5595912569565, - -1296.2432698471687, - -2073.159564606236, - -1121.7870803503154, - 2124.35121609006, - -1015.4001096022041, - 2083.111507606075, - 2350.0726913632457, - -221.08573234457813, - -1338.4057922959519, - -2109.7992630653525, - 2333.4937833387567, - -229.76132301856717, - -1347.983697350853, - -2110.4122812917276, - -1013.9611656277061, - 2078.643995579598, - -1002.1192290632007, - 2078.749054076744, - 2332.4226357124753, - -217.315297134126, - 2407.0510353037284, - -145.37621811101252, - -1312.3022035419074, - -2102.3714370042235, - -1082.9954874709558, - 2116.1047513838116, - 2433.8469441691063, - -107.52581738463108, - -1300.7631166862307, - -2101.2693421622225, - -1123.561604742316, - 2134.13662275953, - 2350.07274187478, - -221.085757156994, - -1338.405811708883, - -2109.799296204432, - -1015.4001197194411, - 2083.111559417907, - 2345.3836609834, - -221.6058883507038, - -1009.5621391710984, - 2080.528335732233, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.Circuit.AllElementLosses(), - [ - -3567.2130572232213, - -1736.5876246039768, - 0.032287911406718196, - 0.26246956013666933, - 0.12209431781549938, - 0.12385874599497766, - 0.0, - 0.0, - 0.06534584204095882, - 0.06707780466409168, - 0.0, - 0.0, - 0.13508999156020582, - 0.13685448115179316, - 0.0, - 0.0, - 5.552672495756633, - 10.09627127053823, - 1155.0138985144563, - 660.0382388082895, - 160.00037793084016, - 110.00734287426086, - 119.99921548166647, - 89.99779375162575, - 120.00422637632467, - 90.00659856144686, - 169.99904036264297, - 124.99723388403005, - 234.56736460810578, - 134.62641475903627, - 166.67363250258813, - 148.05286127890344, - 485.00362643749804, - 190.02832412730436, - 67.99940565100636, - 59.998096116691535, - 290.0145551032838, - 212.02259924297505, - 163.45924282632623, - 76.92782718009413, - 121.9362083812026, - 81.93411617144581, - 16.999947149386877, - 10.00069897109282, - 65.99949886980545, - 37.99886583778652, - 117.00423409948664, - 68.00542640529191, - 0.0, - -593.4874833653861, - 0.0, - -92.45556560908302, - 60.737637029950974, - 196.01567705773493, - 12.990632827557624, - 41.49451007814577, - 22.728759388257167, - 72.3341461004547, - 1.3970495798327352e-11, - -0.004169230139508104, - 0.8244872480827762, - 1.0561418762530956, - 2.7673617080022814, - 2.4007733405815963, - 0.5274850329600449, - 0.4197458963507816, - 4.162956819155021, - 2.419341544324343, - 0.5794873845105758, - 0.47068039939882145, - 0.3824044325920986, - 0.3873491768157692, - 0.7998259198180458, - 0.23087894134466477, - 9.054620692040771e-06, - 2.9103830456733704e-14, - ], - decimal=4, - ) - assert dss.Circuit.AllElementNames() == [ - u"Vsource.source", - u"Transformer.sub", - u"Transformer.reg1", - u"RegControl.reg1", - u"Transformer.reg2", - u"RegControl.reg2", - u"Transformer.reg3", - u"RegControl.reg3", - u"Transformer.xfm1", - u"Load.671", - u"Load.634a", - u"Load.634b", - u"Load.634c", - u"Load.645", - u"Load.646", - u"Load.692", - u"Load.675a", - u"Load.675b", - u"Load.675c", - u"Load.611", - u"Load.652", - u"Load.670a", - u"Load.670b", - u"Load.670c", - u"Capacitor.cap1", - u"Capacitor.cap2", - u"Line.650632", - u"Line.632670", - u"Line.670671", - u"Line.671680", - u"Line.632633", - u"Line.632645", - u"Line.645646", - u"Line.692675", - u"Line.671684", - u"Line.684611", - u"Line.684652", - u"Line.671692", - ] - assert dss.Circuit.AllNodeDistances() == [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ] - assert dss.Circuit.AllNodeNames() == [ - u"sourcebus.1", - u"sourcebus.2", - u"sourcebus.3", - u"650.1", - u"650.2", - u"650.3", - u"rg60.1", - u"rg60.2", - u"rg60.3", - u"633.1", - u"633.2", - u"633.3", - u"634.1", - u"634.2", - u"634.3", - u"671.1", - u"671.2", - u"671.3", - u"645.2", - u"645.3", - u"646.2", - u"646.3", - u"692.3", - u"692.1", - u"692.2", - u"675.1", - u"675.2", - u"675.3", - u"611.3", - u"652.1", - u"670.1", - u"670.2", - u"670.3", - u"632.1", - u"632.2", - u"632.3", - u"680.1", - u"680.2", - u"680.3", - u"684.1", - u"684.3", - ] - # assert dss.Circuit.Capacity() == 0.0 ---- NEEDS PARAMS - assert dss.Circuit.Disable("632") is None - assert dss.Circuit.Enable("632") is None - assert dss.Circuit.EndOfTimeStepUpdate() is None - assert dss.Circuit.FirstElement() == 1 - assert dss.Circuit.FirstPCElement() == 1 - assert dss.Circuit.FirstPDElement() == 1 - np.testing.assert_array_almost_equal( - dss.Circuit.LineLosses(), [106.50104684552127, 317.225075181265], decimal=4 - ) - np.testing.assert_array_almost_equal( - dss.Circuit.Losses(), [112408.53740410128, 327911.6070437507], decimal=4 - ) - assert dss.Circuit.Name() == u"ieee13nodeckt" - assert dss.Circuit.NextElement() == 2 - assert dss.Circuit.NextPCElement() == 2 - assert dss.Circuit.NextPDElement() == 0 - assert dss.Circuit.NumBuses() == 16 - assert dss.Circuit.NumCktElements() == 38 - assert dss.Circuit.NumNodes() == 41 - assert dss.Circuit.ParentPDElement() == 0 - assert dss.Circuit.Sample() is None - assert dss.Circuit.SaveSample() is None - assert dss.Circuit.SetActiveBus("") == -1 # returns integer - - assert dss.Circuit.SetActiveBus("650") == 1 - assert dss.Bus.Name() == "650" - - assert dss.Circuit.SetActiveBusi(0) == 0 - assert dss.Bus.Name() == "sourcebus" - - with pt.raises(dss.DSSException): - dss.Circuit.SetActiveClass("") - - assert dss.Circuit.SetActiveClass("Load") == 20 - - assert dss.Circuit.SetActiveElement("") == -1 - assert dss.Circuit.SubstationLosses() == [0.0, 0.0] - np.testing.assert_array_almost_equal( - dss.Circuit.TotalPower(), [-3567.2130572232213, -1736.5876246039768], decimal=4 - ) - assert dss.Circuit.UpdateStorage() is None - np.testing.assert_array_almost_equal( - dss.Circuit.YCurrents(), - [ - 69802.42815021456, - -72191.08720767737, - -97420.52952591189, - -24355.132407117453, - 27618.101397342507, - 96546.21962200984, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -13.83538249862238, - 10.728150694675776, - -8.968242194252298, - -3.4169800644837665, - -3.1253287196529556, - -18.472388556181272, - -2.6675923553346195, - 3.8325352754590796, - -0.46712567880906164, - -1.9482821746922383, - 3.134718034143681, - -1.8842531007668413, - -3.314394017111624, - -1.3212070720717186, - 0.0, - -7.105427357601002e-15, - 0.0, - 7.105427357601002e-15, - 0.25873731736910166, - -1.0386532600475462, - -0.25873731736910166, - 1.0386532600475462, - -9.01254899930052, - 4.595887907960673, - -3.08889789345001, - -0.8862753821772227, - -1.9605308838638678, - -10.932799880696848, - 0.028157771758488992, - -3.0160456514314262, - 0.0, - 0.0, - 0.06462474225171988, - -0.04346468945275905, - -1.799018346197947, - -0.9604487876225267, - -0.05797062518124818, - -1.0832442019763846, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ], - decimal=4, - ) - assert dss.Circuit.YNodeOrder() == [ - u"SOURCEBUS.1", - u"SOURCEBUS.2", - u"SOURCEBUS.3", - u"650.1", - u"650.2", - u"650.3", - u"RG60.1", - u"RG60.2", - u"RG60.3", - u"633.1", - u"633.2", - u"633.3", - u"634.1", - u"634.2", - u"634.3", - u"671.1", - u"671.2", - u"671.3", - u"645.2", - u"646.2", - u"646.3", - u"692.3", - u"692.1", - u"675.1", - u"675.2", - u"675.3", - u"611.3", - u"652.1", - u"670.1", - u"670.2", - u"670.3", - u"632.1", - u"632.2", - u"632.3", - u"680.1", - u"680.2", - u"680.3", - u"645.3", - u"692.2", - u"684.1", - u"684.3", - ] - np.testing.assert_array_almost_equal( - dss.Circuit.YNodeVArray(), - [ - 57502.68619173074, - 33189.47560805491, - -10.988873472977797, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493821, - -2079.717511753303, - -1200.3116004255198, - 2080.1419385890968, - 2536.35611735117, - -0.5793274158644572, - -1246.2598761513093, - -2157.487712670567, - -1267.587768293624, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562823, - -1300.0193437263497, - -2096.284412787372, - -1120.4211783202531, - 2128.6024323393126, - 273.12043190753747, - -15.65361248526227, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - -1295.6861264459185, - -2078.366153237622, - -1296.2432698471687, - -2073.159564606236, - -1121.7870803503154, - 2124.35121609006, - -1015.4001096022041, - 2083.111507606075, - 2350.0726913632457, - -221.08573234457813, - 2333.4937833387567, - -229.76132301856717, - -1347.983697350853, - -2110.4122812917276, - -1013.9611656277061, - 2078.643995579598, - -1002.1192290632007, - 2078.749054076744, - 2332.4226357124753, - -217.315297134126, - 2407.0510353037284, - -145.37621811101252, - -1312.3022035419074, - -2102.3714370042235, - -1082.9954874709558, - 2116.1047513838116, - 2433.8469441691063, - -107.52581738463108, - -1300.7631166862307, - -2101.2693421622225, - -1123.561604742316, - 2134.13662275953, - 2350.07274187478, - -221.085757156994, - -1338.405811708883, - -2109.799296204432, - -1015.4001197194411, - 2083.111559417907, - -1122.3854662972226, - 2129.5595912569565, - -1338.4057922959519, - -2109.7992630653525, - 2345.3836609834, - -221.6058883507038, - -1009.5621391710984, - 2080.528335732233, - ], - decimal=4, - ) - - -def test_13Node_CktElement(dss): - - assert dss.CktElement.AllPropertyNames() == [ - u"bus1", - u"bus2", - u"linecode", - u"length", - u"phases", - u"r1", - u"x1", - u"r0", - u"x0", - u"C1", - u"C0", - u"rmatrix", - u"xmatrix", - u"cmatrix", - u"Switch", - u"Rg", - u"Xg", - u"rho", - u"geometry", - u"units", - u"spacing", - u"wires", - u"EarthModel", - u"cncables", - u"tscables", - u"B1", - u"B0", - u"Seasons", - u"Ratings", - u"LineType", - u"normamps", - u"emergamps", - u"faultrate", - u"pctperm", - u"repair", - u"basefreq", - u"enabled", - u"like", - ] - assert dss.CktElement.AllVariableNames() == [] - assert dss.CktElement.AllVariableValues() == [0.0] - assert dss.CktElement.BusNames() == [u"671", u"692"] - assert dss.CktElement.Open(1, 0) is None - assert dss.CktElement.IsOpen(1, 0) - assert dss.CktElement.Close(1, 0) is None - assert not dss.CktElement.IsOpen(1, 0) - np.testing.assert_array_almost_equal( - dss.CktElement.CplxSeqCurrents(), - [ - 66.53192583719891, - 13.672570546468101, - 141.96269129938753, - -15.550054378231998, - 10.605415669810057, - -71.1403384338611, - -66.53192583719891, - -13.672570546468101, - -141.96269129938753, - 15.550054378231998, - -10.605415669810057, - 71.1403384338611, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.CplxSeqVoltages(), - [ - -1.2443968584439062, - -82.59116123402828, - 2386.047643797686, - -162.49099543761832, - -34.73053366599282, - 23.996417025286178, - -1.244403511636449, - -82.59116260128519, - 2386.0476296014167, - -162.49099388261294, - -34.730534726534245, - 23.99642413931997, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.Currents(), - [ - 219.10003280639648, - -73.017822265625, - 38.39047050476074, - -56.740970611572266, - -57.89472579956055, - 170.77650451660156, - -219.10003280639648, - 73.017822265625, - -38.39047050476074, - 56.740970611572266, - 57.89472579956055, - -170.77650451660156, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.CurrentsMagAng(), - [ - 230.9468050096784, - -18.431295569374065, - 68.50814529324387, - -55.91804381551418, - 180.32308163492308, - 108.72710746089945, - 230.9468050096784, - 161.56870442095442, - 68.50814529324387, - 124.08195617481427, - 180.32308163492308, - -71.27289252942901, - ], - decimal=4, - ) - assert dss.CktElement.DisplayName() == u"Line_671692" - assert dss.CktElement.EmergAmps() == 600.0 - assert dss.CktElement.Enabled() == 1 - assert dss.CktElement.EnergyMeter() == u"" - from six import string_types - - assert isinstance(dss.CktElement.GUID(), string_types) - assert dss.CktElement.HasSwitchControl() == 0 - assert dss.CktElement.HasVoltControl() == 0 - np.testing.assert_almost_equal( - dss.CktElement.Losses(), - [0.00905452249571681, -1.4551915228366852e-11], - decimal=4, - ) - assert dss.CktElement.Name() == u"Line.671692" - assert dss.CktElement.NodeOrder() == [1, 2, 3, 1, 2, 3] - assert dss.CktElement.NormalAmps() == 400.0 - assert dss.CktElement.NumConductors() == 3 - assert dss.CktElement.NumControls() == 0 - assert dss.CktElement.NumPhases() == 3 - assert dss.CktElement.NumProperties() == 38 - assert dss.CktElement.NumTerminals() == 2 - assert dss.CktElement.OCPDevIndex() == 0 - assert dss.CktElement.OCPDevType() == 0 - np.testing.assert_array_almost_equal( - dss.CktElement.PhaseLosses(), - [ - 5.3332970710471275e-06, - 1.4551915228366852e-14, - 4.693326191045344e-07, - 0.0, - 3.2518928055651486e-06, - -2.9103830456733704e-14, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.Powers(), - [ - 531.0442078185483, - 123.15729887953721, - 68.33003035870593, - -156.93863010669907, - 414.5328159611783, - 52.80531186087565, - -531.0442024849057, - -123.15729887953721, - -68.33002988936931, - 156.93863010669907, - -414.53281270953687, - -52.80531186087562, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.Residuals(), - [203.766844870779, 11.612830692170245, 203.766844870779, -168.38716929815823], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.SeqCurrents(), - [ - 67.92228162359304, - 142.8117989247778, - 71.92650828459385, - 67.92228162359304, - 142.8117989247778, - 71.92650828459385, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.SeqPowers(), - [ - -3.6360767939550196, - -16.43380473058689, - 1023.7694666913296, - 42.10653475759665, - -6.226334923023335, - -6.648749825544208, - 3.6360781779859073, - 16.43380473058686, - -1023.7694605727667, - -42.10653475759662, - 6.226336475050096, - 6.648749825544179, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.SeqVoltages(), - [ - 82.60053533438243, - 2391.57410131294, - 42.214191911916366, - 82.60053680171639, - 2391.5740870438235, - 42.21419682837919, - ], - decimal=4, - ) - - with pt.raises(dss.DSSException): - dss.CktElement.Variablei(1) - - with pt.raises(dss.DSSException): - dss.CktElement.Variablei(1, 10) - - with pt.raises(dss.DSSException): - dss.CktElement.Variable("some invalid name") - - with pt.raises(dss.DSSException): - dss.CktElement.Variable("some invalid name", 10) - - np.testing.assert_array_almost_equal( - dss.CktElement.Voltages(), - [ - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - 2350.0726913632457, - -221.08573234457813, - -1338.4057922959519, - -2109.7992630653525, - -1015.4001096022041, - 2083.111507606075, - ], - decimal=4, - ) - np.testing.assert_array_almost_equal( - dss.CktElement.VoltagesMagAng(), - [ - 2360.449250025611, - -5.3743473971090765, - 2498.5161614343156, - -122.39005677200043, - 2317.4104122074677, - 115.9866388766925, - 2360.4492275280204, - -5.3743472704625, - 2498.516158699491, - -122.39005691604211, - 2317.410394319708, - 115.98663893302955, - ], - decimal=4, - ) - - np.testing.assert_array_almost_equal( - dss.CktElement.YPrim(), - [ - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - ], - decimal=4, - ) - - # Create an element with "variables" available to test - dss.run_command("New PVSystem.631") - dss.Circuit.SetActiveElement("PVSystem.631") - assert dss.CktElement.AllVariableNames() == [ - u"Irradiance", - u"PanelkW", - u"P_TFactor", - u"Efficiency", - u"Vreg", - u"Vavg (DRC)", - u"volt-var", - u"volt-watt", - u"DRC", - u"VV_DRC", - u"watt-pf", - u"watt-var", - u"kW_out_desired", - ] - assert dss.CktElement.AllVariableValues() == [ - 1.0, - 500.0, - 1.0, - 1.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 9999.0, - 500.0, - ] - assert dss.CktElement.Variablei(2) == 500.0 - assert dss.CktElement.Variable(u"PanelkW") == 500.0 - - -def test_13Node_Capacitors(dss): - assert dss.Capacitors.AddStep() == 0 - assert dss.Capacitors.AllNames() == [u"cap1", u"cap2"] - assert dss.Capacitors.AvailableSteps() == 0 - assert dss.Capacitors.Close() is None - assert dss.Capacitors.Count() == 2 - assert dss.Capacitors.First() == 1 - assert dss.Capacitors.IsDelta() == 0 - assert dss.Capacitors.Name() == u"cap1" - assert dss.Capacitors.Next() == 2 - assert dss.Capacitors.NumSteps() == 1 - assert dss.Capacitors.Open() is None - assert dss.Capacitors.States() == [0] - assert dss.Capacitors.SubtractStep() == 0 - assert dss.Capacitors.kV() == 2.4 - assert dss.Capacitors.kvar() == 100.0 - - -def test_13Node_CapControls(dss): - assert dss.CapControls.AllNames() == [] - assert dss.CapControls.CTRatio() == 0.0 - assert dss.CapControls.Capacitor() == u"" - assert dss.CapControls.Count() == 0 - assert dss.CapControls.Delay() == 0.0 - assert dss.CapControls.DelayOff() == 0.0 - assert dss.CapControls.First() == 0 - assert dss.CapControls.Mode() == 1 - assert dss.CapControls.MonitoredObj() == u"" - assert dss.CapControls.MonitoredTerm() == 0 - assert dss.CapControls.Name() == u"" - assert dss.CapControls.Next() == 0 - assert dss.CapControls.OFFSetting() == 0.0 - assert dss.CapControls.ONSetting() == 0.0 - assert dss.CapControls.PTRatio() == 0.0 - assert dss.CapControls.UseVoltOverride() == 0 - assert dss.CapControls.Vmax() == 0.0 - assert dss.CapControls.Vmin() == 0.0 - - -def test_13Node_Element(dss): - assert dss.Element.AllPropertyNames() == [ - u"bus1", - u"bus2", - u"linecode", - u"length", - u"phases", - u"r1", - u"x1", - u"r0", - u"x0", - u"C1", - u"C0", - u"rmatrix", - u"xmatrix", - u"cmatrix", - u"Switch", - u"Rg", - u"Xg", - u"rho", - u"geometry", - u"units", - u"spacing", - u"wires", - u"EarthModel", - u"cncables", - u"tscables", - u"B1", - u"B0", - u"Seasons", - u"Ratings", - u"LineType", - u"normamps", - u"emergamps", - u"faultrate", - u"pctperm", - u"repair", - u"basefreq", - u"enabled", - u"like", - ] - assert dss.Element.Name() == u"Line.671692" - assert dss.Element.NumProperties() == 38 - - -def test_13Node_Executive(dss): - assert dss.Executive.Command(1) == u"New" - assert ( - dss.Executive.CommandHelp(1).replace(os.linesep, "\n") - == u"Create a new object within the DSS. Object becomes the active object\nExample: New Line.line1 ..." - ) - assert ( - dss.Executive.NumCommands() == 118 - ) # adjusted to the latest version on 2020-12-28 - assert ( - dss.Executive.NumOptions() == 115 - ) # adjusted to the latest version on 2020-07-28 - assert dss.Executive.Option(1) == u"type" - assert ( - dss.Executive.OptionHelp(1) - == u"Sets the active DSS class type. Same as Class=..." - ) - assert dss.Executive.OptionValue(1) == u"Line" - - -def test_13Node_Fuses(dss): - assert dss.Fuses.AllNames() == [] - assert dss.Fuses.Close() is None - assert dss.Fuses.Count() == 0 - assert dss.Fuses.First() == 0 - assert dss.Fuses.Idx() == 0 - assert dss.Fuses.IsBlown() == 0 - assert dss.Fuses.MonitoredObj() == u"" - assert dss.Fuses.MonitoredTerm() == 0 - assert dss.Fuses.Name() == u"" - assert dss.Fuses.Next() == 0 - assert dss.Fuses.NumPhases() == 0 - assert dss.Fuses.Open() is None - assert dss.Fuses.RatedCurrent() == -1.0 - assert dss.Fuses.SwitchedObj() == u"" - assert dss.Fuses.TCCCurve() == u"No Fuse Active!" - - -def test_13Node_Generators(dss): - - assert dss.Generators.AllNames() == [] - assert dss.Generators.Count() == 0 - assert dss.Generators.First() == 0 - assert dss.Generators.ForcedON() == 0 - assert dss.Generators.Idx() == 0 - assert dss.Generators.Model() == -1 - assert dss.Generators.Name() == u"" - assert dss.Generators.Next() == 0 - assert dss.Generators.PF() == 0.0 - assert dss.Generators.Phases() == 0 - assert dss.Generators.RegisterNames() == [ - u"kWh", - u"kvarh", - u"Max kW", - u"Max kVA", - u"Hours", - u"$", - ] - assert dss.Generators.RegisterValues() == [0.0] - assert dss.Generators.Vmaxpu() == -1.0 - assert dss.Generators.Vminpu() == -1.0 - assert dss.Generators.kV() == -1.0 - assert dss.Generators.kVARated() == -1.0 - assert dss.Generators.kW() == 0.0 - assert dss.Generators.kvar() == 0.0 - - -def test_13Node_Isource(dss): - - assert dss.Isource.AllNames() == [] - assert dss.Isource.Amps() == 0.0 - assert dss.Isource.AngleDeg() == 0.0 - assert dss.Isource.Count() == 0 - assert dss.Isource.First() == 0 - assert dss.Isource.Frequency() == 0.0 - - # Update in DSS C-API 0.10.6 -- before, the value listed - # wasn't really an Isource, it was the name of the latest - # active circuit element - assert dss.Isource.Name() == u"" - - assert dss.Isource.Next() == 0 - - -def test_13Node_Lines(dss): - - assert dss.Lines.AllNames() == [ - u"650632", - u"632670", - u"670671", - u"671680", - u"632633", - u"632645", - u"645646", - u"692675", - u"671684", - u"684611", - u"684652", - u"671692", - ] - assert dss.Lines.Bus1() == u"671" - assert dss.Lines.Bus2() == u"692" - assert dss.Lines.C0() == 0.0 - assert dss.Lines.C1() == 0.0 - assert dss.Lines.CMatrix() == [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - assert dss.Lines.Count() == 12 - assert dss.Lines.EmergAmps() == 600.0 - assert dss.Lines.First() == 1 - assert dss.Lines.Geometry() == u"" - assert dss.Lines.Length() == 2000.0 - assert dss.Lines.LineCode() == u"mtx601" - assert dss.Lines.Name() == u"650632" - assert dss.Lines.Next() == 2 - assert dss.Lines.NormAmps() == 400.0 - assert dss.Lines.NumCust() == 0 - assert dss.Lines.Parent() == 0 - assert dss.Lines.Phases() == 3 - assert dss.Lines.Rg() == 0.01805 - assert dss.Lines.Rho() == 100.0 - assert dss.Lines.Spacing() == u"" - assert dss.Lines.Units() == 5 - assert dss.Lines.Xg() == 0.155081 - assert dss.Lines.Yprim() == [ - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - ] - with pt.raises(dss.DSSException): - # This is not allowed at the moment (the value is/was ignored before) - # so an exception was added in case someone was trying to use it - dss.Lines.Yprim(dss.Lines.Yprim()) - - assert dss.Lines.R0() == 3.378880258497484e-05 - assert dss.Lines.X0() == 7.664982290436836e-05 - assert dss.Lines.RMatrix() == [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ] - assert dss.Lines.XMatrix() == [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ] - - assert dss.Lines.R1() == 1.0985148822469399e-05 - assert dss.Lines.X1() == 2.2841533586031195e-05 - - -def test_13Node_Loads(dss): - - assert dss.Loads.AllNames() == [ - u"671", - u"634a", - u"634b", - u"634c", - u"645", - u"646", - u"692", - u"675a", - u"675b", - u"675c", - u"611", - u"652", - u"670a", - u"670b", - u"670c", - ] - assert dss.Loads.AllocationFactor() == 0.5 - assert dss.Loads.CFactor() == 4.0 - assert dss.Loads.CVRCurve() == u"" - assert dss.Loads.CVRvars() == 2.0 - assert dss.Loads.CVRwatts() == 1.0 - assert dss.Loads.Class() == 1 - assert dss.Loads.Count() == 15 - assert dss.Loads.Daily() == u"" - assert dss.Loads.Duty() == u"" - assert dss.Loads.First() == 1 - assert dss.Loads.Growth() == u"" - assert dss.Loads.Idx() == 1 - assert dss.Loads.IsDelta() == 1 - assert dss.Loads.Model() == 1 - assert dss.Loads.Name() == u"671" - assert dss.Loads.Next() == 2 - assert dss.Loads.NumCust() == 1 - assert dss.Loads.PF() == 0.8240419241993675 - assert dss.Loads.PctMean() == 50.0 - assert dss.Loads.PctStdDev() == 10.0 - assert dss.Loads.RelWeighting() == 1.0 - assert dss.Loads.Rneut() == -1.0 - assert dss.Loads.Spectrum() == u"defaultload" - assert dss.Loads.Status() == 0 - assert dss.Loads.Vmaxpu() == 1.05 - assert dss.Loads.VminEmerg() == 0.0 - assert dss.Loads.VminNorm() == 0.0 - assert dss.Loads.Vminpu() == 0.95 - assert dss.Loads.XfkVA() == 0.0 - assert dss.Loads.Xneut() == 0.0 - assert dss.Loads.Yearly() == u"" - assert dss.Loads.ZipV() == [] - assert dss.Loads.kV() == 0.277 - assert dss.Loads.kVABase() == 194.164878389476 - assert dss.Loads.kW() == 160.0 - assert dss.Loads.kWh() == 0.0 - assert dss.Loads.kWhDays() == 30.0 - assert dss.Loads.kvar() == 110.0 - assert dss.Loads.puSeriesRL() == 50.0 - - -def test_13Node_LoadShape(dss): - assert dss.LoadShape.AllNames() == [u"default"] - assert dss.LoadShape.Count() == 1 - assert dss.LoadShape.First() == 1 - assert dss.LoadShape.HrInterval() == 1.0 - assert dss.LoadShape.MinInterval() == 60.0 - assert dss.LoadShape.Name() == u"default" - assert dss.LoadShape.Next() == 0 - assert dss.LoadShape.Normalize() is None - assert dss.LoadShape.Npts() == 24 - assert dss.LoadShape.PBase() == 0.0 - assert dss.LoadShape.PMult() == [ - 0.677, - 0.6256, - 0.6087, - 0.5833, - 0.58028, - 0.6025, - 0.657, - 0.7477, - 0.832, - 0.88, - 0.94, - 0.989, - 0.985, - 0.98, - 0.9898, - 0.999, - 1.0, - 0.958, - 0.936, - 0.913, - 0.876, - 0.876, - 0.828, - 0.756, - ] - assert dss.LoadShape.QBase() == 0.0 - assert dss.LoadShape.QMult() == [0.0] - assert dss.LoadShape.SInterval() == 3600.0 - assert dss.LoadShape.TimeArray() == [0.0] - assert dss.LoadShape.UseActual() == 0 - - -def test_13Node_Meters(dss): - assert dss.Meters.AllBranchesInZone() == [] - assert dss.Meters.AllEndElements() == [] - assert dss.Meters.AllNames() == [] - assert dss.Meters.AllocFactors() == [0.0] - assert dss.Meters.AvgRepairTime() == 0.0 - assert dss.Meters.CalcCurrent() == [0.0] - assert dss.Meters.CloseAllDIFiles() is None - assert dss.Meters.Count() == 0 - assert dss.Meters.CountBranches() == 0 - assert dss.Meters.CountEndElements() == 0 - assert dss.Meters.CustInterrupts() == 0.0 - assert dss.Meters.DIFilesAreOpen() == 0 - assert dss.Meters.FaultRateXRepairHrs() == 0.0 - assert dss.Meters.First() == 0 - assert dss.Meters.MeteredElement() == u"" - assert dss.Meters.MeteredTerminal() == 0 - assert dss.Meters.Name() == u"" - assert dss.Meters.Next() == 0 - assert dss.Meters.NumSectionBranches() == 0 - assert dss.Meters.NumSectionCustomers() == 0 - assert dss.Meters.NumSections() == 0 - assert dss.Meters.OCPDeviceType() == 0 - assert dss.Meters.OpenAllDIFiles() is None - assert dss.Meters.PeakCurrent() == [0.0] - assert dss.Meters.RegisterNames() == [] - assert dss.Meters.RegisterValues() == [0.0] - assert dss.Meters.Reset() is None - assert dss.Meters.ResetAll() is None - assert dss.Meters.SAIDI() == 0.0 - assert dss.Meters.SAIFI() == 0.0 - assert dss.Meters.SAIFIkW() == 0.0 - assert dss.Meters.Sample() is None - assert dss.Meters.SampleAll() is None - assert dss.Meters.Save() is None - assert dss.Meters.SaveAll() is None - assert dss.Meters.SectSeqidx() == 0 - assert dss.Meters.SectTotalCust() == 0 - assert dss.Meters.SeqListSize() == 0 - assert dss.Meters.SequenceList() == 0 - assert dss.Meters.SetActiveSection(0) is None - assert dss.Meters.SumBranchFltRates() == 0.0 - assert dss.Meters.TotalCustomers() == 0 - assert dss.Meters.Totals() == [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ] - - -def test_13Node_Monitors(dss): - assert dss.Monitors.AllNames() == [] - assert dss.Monitors.ByteStream() == [] - assert dss.Monitors.Count() == 0 - assert dss.Monitors.Element() == u"0" - assert dss.Monitors.FileName() == u"" - assert isinstance(dss.Monitors.FileVersion(), int) - assert dss.Monitors.First() == 0 - assert dss.Monitors.Mode() == 0 - assert dss.Monitors.Name() == u"" - assert dss.Monitors.Next() == 0 - assert dss.Monitors.Process() is None - assert dss.Monitors.ProcessAll() is None - assert dss.Monitors.Reset() is None - assert dss.Monitors.ResetAll() is None - assert dss.Monitors.Sample() is None - assert dss.Monitors.SampleAll() is None - assert dss.Monitors.Save() is None - assert dss.Monitors.SaveAll() is None - assert dss.Monitors.Show() is None - assert dss.Monitors.Terminal() == 0 - - -def test_13Node_PDElements(dss): - - assert dss.PDElements.AccumulatedL() == 0.0 - assert dss.PDElements.Count() == 19 - assert dss.PDElements.FaultRate() == 0.1 - assert dss.PDElements.First() == 1 - assert dss.PDElements.FromTerminal() == 1 - assert dss.PDElements.IsShunt() == 0 - assert dss.PDElements.Lambda() == 0.0 - assert dss.PDElements.Name() == u"Transformer.sub" - assert dss.PDElements.Next() == 1 - assert dss.PDElements.NumCustomers() == 0 - assert dss.PDElements.ParentPDElement() == 0 - assert dss.PDElements.PctPermanent() == 0.0 - assert dss.PDElements.RepairTime() == 0.0 - assert dss.PDElements.SectionID() == 0 - assert dss.PDElements.TotalCustomers() == 0 - assert dss.PDElements.TotalMiles() == 0.0 - - -def test_13Node_Properties(dss): # TODO!! rework DSSProperty - dss.dss_lib.DSSProperty_Set_Index(0) # TODO? - assert ( - dss.Properties.Description().replace(os.linesep, "\n") - == u"Name of bus to which first terminal is connected.\nExample:\nbus1=busname (assumes all terminals connected in normal phase order)\nbus1=busname.3.1.2.0 (specify terminal to node connections explicitly)" - ) - assert dss.Properties.Name() == u"bus1" - - dss.dss_lib.DSSProperty_Set_Index(0) # TODO? - assert dss.Properties.Name() == u"bus1" - assert dss.Properties.Value() == u"671" - - -def test_13Node_PVsystems(dss): - assert dss.PVsystems.Count() == 0 - assert dss.PVsystems.First() == 0 - assert dss.PVsystems.Idx() == 0 - assert dss.PVsystems.Irradiance() == -1.0 - assert dss.PVsystems.Next() == 0 - assert dss.PVsystems.kVARated() == -1.0 - assert dss.PVsystems.kW() == 0.0 - assert dss.PVsystems.kvar() == 0.0 - assert dss.PVsystems.pf() == 0.0 - - -def test_13Node_Reclosers(dss): - assert dss.Reclosers.AllNames() == [] - assert dss.Reclosers.Close() is None - assert dss.Reclosers.Count() == 0 - assert dss.Reclosers.First() == 0 - assert dss.Reclosers.GroundInst() == 0.0 - assert dss.Reclosers.GroundTrip() == 0.0 - assert dss.Reclosers.Idx() == 0 - assert dss.Reclosers.MonitoredObj() == u"" - assert dss.Reclosers.MonitoredTerm() == 0 - assert dss.Reclosers.Name() == u"" - assert dss.Reclosers.Next() == 0 - assert dss.Reclosers.NumFast() == 0 - assert dss.Reclosers.Open() is None - assert dss.Reclosers.PhaseInst() == 0.0 - assert dss.Reclosers.PhaseTrip() == 0.0 - assert dss.Reclosers.RecloseIntervals() == [-1.0] - assert dss.Reclosers.Shots() == 0 - assert dss.Reclosers.SwitchedObj() == u"" - assert dss.Reclosers.SwitchedTerm() == 0 - - -def test_13Node_RegControls(dss): - - assert dss.RegControls.AllNames() == [u"reg1", u"reg2", u"reg3"] - assert dss.RegControls.CTPrimary() == 700.0 - assert dss.RegControls.Count() == 3 - assert dss.RegControls.Delay() == 15.0 - assert dss.RegControls.First() == 1 - assert dss.RegControls.ForwardBand() == 2.0 - assert dss.RegControls.ForwardR() == 3.0 - assert dss.RegControls.ForwardVreg() == 122.0 - assert dss.RegControls.ForwardX() == 9.0 - assert dss.RegControls.IsInverseTime() == 0 - assert dss.RegControls.IsReversible() == 0 - assert dss.RegControls.MaxTapChange() == 16 - assert dss.RegControls.MonitoredBus() == u"" - assert dss.RegControls.Name() == u"reg1" - assert dss.RegControls.Next() == 2 - assert dss.RegControls.PTRatio() == 20.0 - assert dss.RegControls.ReverseBand() == 3.0 - assert dss.RegControls.ReverseR() == 0.0 - assert dss.RegControls.ReverseVreg() == 120.0 - assert dss.RegControls.ReverseX() == 0.0 - assert dss.RegControls.TapDelay() == 2.0 - assert dss.RegControls.TapNumber() == 6 - assert dss.RegControls.TapWinding() == 2 - assert dss.RegControls.Transformer() == u"reg2" - assert dss.RegControls.VoltageLimit() == 0.0 - assert dss.RegControls.Winding() == 2 - - -def test_13Node_Relays(dss): - - assert dss.Relays.AllNames() == [] - assert dss.Relays.Count() == 0 - assert dss.Relays.First() == 0 - assert dss.Relays.Idx() == 0 - assert dss.Relays.MonitoredObj() == u"" - assert dss.Relays.MonitoredTerm() == 0 - assert dss.Relays.Name() == u"" - assert dss.Relays.Next() == 0 - assert dss.Relays.SwitchedObj() == u"" - assert dss.Relays.SwitchedTerm() == 0 - - -def test_13Node_Sensors(dss): - assert dss.Sensors.AllNames() == [] - assert dss.Sensors.Count() == 0 - assert dss.Sensors.Currents() == [0.0] - assert dss.Sensors.First() == 0 - assert dss.Sensors.IsDelta() == 0 - assert dss.Sensors.MeteredElement() == u"" - assert dss.Sensors.MeteredTerminal() == 0 - assert dss.Sensors.Name() == u"" - assert dss.Sensors.Next() == 0 - assert dss.Sensors.PctError() == 0.0 - assert dss.Sensors.Reset() is None - assert dss.Sensors.ResetAll() is None - assert dss.Sensors.ReverseDelta() == 0 - assert dss.Sensors.Weight() == 0.0 - assert dss.Sensors.kVBase() == 0.0 - assert dss.Sensors.kW() == [0.0] - assert dss.Sensors.kvar() == [0.0] - - -def test_13Node_Settings(dss): - with pt.raises(dss.DSSException): - dss.Settings.AllocationFactors(0) - - assert dss.Settings.AllocationFactors(1) is None - assert dss.Settings.AllowDuplicates() == 0 - assert dss.Settings.CktModel() == 0 - - # Fixed in DSS C-API 0.10.4, previously it was an uninitialized value - # (COM still had the bug when this comment was written) - assert dss.Settings.AutoBusList() == u"" - - assert dss.Settings.EmergVmaxpu() == 1.08 - assert dss.Settings.EmergVminpu() == 0.9 - assert dss.Settings.LossRegs() == [13] - assert dss.Settings.LossWeight() == 1.0 - assert dss.Settings.NormVmaxpu() == 1.05 - assert dss.Settings.NormVminpu() == 0.95 - assert dss.Settings.PriceCurve() == u"" - assert dss.Settings.PriceSignal() == 25.0 - assert dss.Settings.Trapezoidal() == 0 - assert dss.Settings.UERegs() == [10] - assert dss.Settings.UEWeight() == 1.0 - assert dss.Settings.VoltageBases() == [115.0, 4.16, 0.48] - assert dss.Settings.ZoneLock() == 0 - - -def test_13Node_Solution(dss): - assert dss.Solution.AddType() == 1 - assert dss.Solution.Algorithm() == 0 - assert dss.Solution.Capkvar() == 600.0 - assert dss.Solution.CheckControls() is None - assert dss.Solution.CheckFaultStatus() is None - assert dss.Solution.Cleanup() is None - assert dss.Solution.ControlActionsDone() == 1 - assert dss.Solution.ControlIterations() == 3 - assert dss.Solution.ControlMode() == 0 - assert dss.Solution.Converged() == 1 - assert dss.Solution.Convergence() == 0.0001 - assert dss.Solution.DblHour() == 0.0 - assert dss.Solution.DefaultDaily() == u"default" - assert dss.Solution.DefaultYearly() == u"default" - assert dss.Solution.DoControlActions() is None - assert dss.Solution.EventLog() == [ - u"Hour=0, Sec=0, ControlIter=1, Element=Regulator.reg3, Action= CHANGED 7 TAPS TO 1.04375.", - u"Hour=0, Sec=0, ControlIter=1, Element=Regulator.reg2, Action= CHANGED 5 TAPS TO 1.03125.", - u"Hour=0, Sec=0, ControlIter=1, Element=Regulator.reg1, Action= CHANGED 7 TAPS TO 1.04375.", - u"Hour=0, Sec=0, ControlIter=2, Element=Regulator.reg3, Action= CHANGED 2 TAPS TO 1.05625.", - u"Hour=0, Sec=0, ControlIter=2, Element=Regulator.reg2, Action= CHANGED 1 TAPS TO 1.0375.", - u"Hour=0, Sec=0, ControlIter=2, Element=Regulator.reg1, Action= CHANGED 2 TAPS TO 1.05625.", - ] - assert dss.Solution.FinishTimeStep() is None - assert dss.Solution.Frequency() == 60.0 - assert dss.Solution.GenMult() == 1.0 - assert dss.Solution.GenPF() == 1.0 - assert dss.Solution.GenkW() == 1000.0 - assert dss.Solution.Hour() == 0 - assert dss.Solution.InitSnap() is None - assert dss.Solution.Iterations() == 11 - assert dss.Solution.LDCurve() == u"" - assert dss.Solution.LoadModel() == 1 - assert dss.Solution.LoadMult() == 1.0 - assert dss.Solution.MaxControlIterations() == 10 - assert dss.Solution.MaxIterations() == 15 - assert dss.Solution.Mode() == 0 - assert dss.Solution.ModeID() == u"Snap" - assert dss.Solution.MostIterationsDone() == 0 - assert dss.Solution.Number() == 100 - assert dss.Solution.PctGrowth() == 2.499999999999991 - assert isinstance(dss.Solution.ProcessTime(), float) - assert dss.Solution.Random() == 1 - assert dss.Solution.SampleControlDevices() is None - assert dss.Solution.SampleDoControlActions() is None - assert dss.Solution.Seconds() == 0.001 - assert dss.Solution.Solve() is None - assert dss.Solution.SolveDirect() is None - assert dss.Solution.SolveNoControl() is None - assert dss.Solution.SolvePFlow() is None - assert dss.Solution.SolvePlusControl() is None - assert dss.Solution.StepSize() == 0.001 - assert dss.Solution.SystemYChanged() == 0 - assert isinstance(dss.Solution.TimeTimeStep(), float) - assert dss.Solution.TotalIterations() == 2 - assert isinstance(dss.Solution.TotalTime(), float) - assert dss.Solution.Year() == 0 - - -def test_13Node_SwtControls(dss): - assert dss.SwtControls.Action() == 0 - assert dss.SwtControls.AllNames() == [] - assert dss.SwtControls.Count() == 0 - assert dss.SwtControls.Delay() == 0.0 - assert dss.SwtControls.First() == 0 - assert dss.SwtControls.IsLocked() == 0 - assert dss.SwtControls.Name() == u"" - assert dss.SwtControls.Next() == 0 - assert dss.SwtControls.SwitchedObj() == u"" - assert dss.SwtControls.SwitchedTerm() == 0 - - -def test_13Node_Topology(dss): - assert dss.Topology.ActiveBranch() == 0 - assert dss.Topology.ActiveLevel() == 0 - assert dss.Topology.AllIsolatedBranches() == [] - assert dss.Topology.AllIsolatedLoads() == [] - assert dss.Topology.AllLoopedPairs() == [ - u"Transformer.reg3", - u"Transformer.reg2", - u"Transformer.reg2", - u"Line.650632", - u"Transformer.reg1", - u"Line.650632", - ] - assert dss.Topology.BranchName() == u"" - assert dss.Topology.BusName() == u"" - assert dss.Topology.First() == 1 - assert dss.Topology.FirstLoad() == 0 - assert dss.Topology.ForwardBranch() == 1 - assert dss.Topology.LoopedBranch() == 0 - assert dss.Topology.Next() == 1 - assert dss.Topology.NextLoad() == 0 - assert dss.Topology.NumIsolatedBranches() == 0 - assert dss.Topology.NumIsolatedLoads() == 0 - assert dss.Topology.NumLoops() == 1 - assert dss.Topology.ParallelBranch() == 0 - - -def test_13Node_Transformers(dss): - assert dss.Transformers.AllNames() == [u"sub", u"reg1", u"reg2", u"reg3", u"xfm1"] - assert dss.Transformers.Count() == 5 - assert dss.Transformers.First() == 1 - assert dss.Transformers.IsDelta() == 0 - assert dss.Transformers.MaxTap() == 1.1 - assert dss.Transformers.MinTap() == 0.9 - assert dss.Transformers.Name() == u"sub" - assert dss.Transformers.Next() == 2 - assert dss.Transformers.NumTaps() == 32 - assert dss.Transformers.NumWindings() == 2 - assert dss.Transformers.R() == 5e-05 - assert dss.Transformers.Rneut() == -1.0 - assert dss.Transformers.Tap() == 1.05625 - assert dss.Transformers.Wdg() == 2 - assert dss.Transformers.XfmrCode() == u"" - assert dss.Transformers.Xhl() == 0.0001 - assert dss.Transformers.Xht() == 0.35 - assert dss.Transformers.Xlt() == 0.3 - assert dss.Transformers.Xneut() == 0.0 - assert dss.Transformers.kV() == 2.4 - assert dss.Transformers.kVA() == 1666.0 - - -def test_13Node_Vsources(dss): - assert dss.Vsources.AllNames() == [u"source"] - assert dss.Vsources.AngleDeg() == 30.0 - assert dss.Vsources.BasekV() == 115.0 - assert dss.Vsources.Count() == 1 - assert dss.Vsources.First() == 1 - assert dss.Vsources.Frequency() == 60.0 - assert dss.Vsources.Name() == u"source" - assert dss.Vsources.Next() == 0 - assert dss.Vsources.PU() == 1.0001 - assert dss.Vsources.Phases() == 3 - - -def test_13Node_XYCurves(dss): - assert dss.XYCurves.Count() == 0 - assert dss.XYCurves.First() == 0 - assert dss.XYCurves.Name() == u"" - assert dss.XYCurves.Next() == 0 - with pt.raises(dss.DSSException): - dss.XYCurves.Npts() - - with pt.raises(dss.DSSException): - dss.XYCurves.X() - - with pt.raises(dss.DSSException): - dss.XYCurves.XScale() - - assert dss.XYCurves.XArray() == [0.0] - assert dss.XYCurves.YArray() == [0.0] - - -def test_capacitors_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "AvailableSteps": {"cap1": 0, "cap2": 0}, - "IsDelta": {"cap1": 0, "cap2": 0}, - "Name": {"cap1": "cap1", "cap2": "cap2"}, - "NumSteps": {"cap1": 1, "cap2": 1}, - "States": {"cap1": [1], "cap2": [1]}, - "kV": {"cap1": 4.16, "cap2": 2.4}, - "kvar": {"cap1": 600.0, "cap2": 100.0}, - "Idx": {"cap1": 1, "cap2": 2}, - } - ).to_dict() - - actual_dict = dss.utils.capacitors_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_fuses_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "Delay": {"": -1.0}, - "SwitchedTerm": {"": 0}, - "Idx": {"": 0}, - "IsBlown": {"": 0}, - "MonitoredObj": {"": ""}, - "MonitoredTerm": {"": 0}, - "Name": {"": ""}, - "NumPhases": {"": 0}, - "RatedCurrent": {"": -1.0}, - "SwitchedObj": {"": ""}, - "TCCCurve": {"": "No Fuse Active!"}, - } - ).to_dict() - - actual_dict = dss.utils.fuses_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_generators_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "ForcedON": {"": 0}, - "Idx": {"": 0}, - "Model": {"": -1}, - "Name": {"": ""}, - "PF": {"": 0.0}, - "Phases": {"": 0}, - "RegisterNames": {"": ["kWh", "kvarh", "Max kW", "Max kVA", "Hours", "$"]}, - "RegisterValues": {"": [0.0]}, - "Vmaxpu": {"": -1.0}, - "Vminpu": {"": -1.0}, - "kV": {"": -1.0}, - "kVARated": {"": -1.0}, - "kW": {"": 0.0}, - "kvar": {"": 0.0}, - } - ).to_dict() - - actual_dict = dss.utils.generators_to_dataframe().to_dict() - - assert_dict_equal(actual_dict, expected_dict) - - -def test_isource_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "Amps": {"": 0.0}, - "AngleDeg": {"": 0.0}, - "Frequency": {"": 0.0}, - "Idx": {"": 0}, - "Name": {"": ""}, - } - ).to_dict() - - actual_dict = dss.utils.isource_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - dss.Text.Command("New Isource.sampleIsource Bus1=611.3 Phases=1 Amps=0.1 Angle=30") - - expected_dict = pd.DataFrame( - { - "Amps": {"sampleisource": 0.1}, - "AngleDeg": {"sampleisource": 30.0}, - "Frequency": {"sampleisource": 60.0}, - "Idx": {"sampleisource": 1}, - "Name": {"sampleisource": "sampleisource"}, - } - ).to_dict() - - actual_dict = dss.utils.isource_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_lines_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "TotalCust": { - "650632": 0, - "632670": 0, - "670671": 0, - "671680": 0, - "632633": 0, - "632645": 0, - "645646": 0, - "692675": 0, - "671684": 0, - "684611": 0, - "684652": 0, - "671692": 0, - }, - "Bus1": { - "632633": "632.1.2.3", - "632645": "632.3.2", - "632670": "632.1.2.3", - "645646": "645.3.2", - "650632": "rg60.1.2.3", - "670671": "670.1.2.3", - "671680": "671.1.2.3", - "671684": "671.1.3", - "671692": "671", - "684611": "684.3", - "684652": "684.1", - "692675": "692.1.2.3", - }, - "Bus2": { - "632633": "633.1.2.3", - "632645": "645.3.2", - "632670": "670.1.2.3", - "645646": "646.3.2", - "650632": "632.1.2.3", - "670671": "671.1.2.3", - "671680": "680.1.2.3", - "671684": "684.1.3", - "671692": "692", - "684611": "611.3", - "684652": "652.1", - "692675": "675.1.2.3", - }, - "C0": { - "632633": 0.00030303858820605233, - "632645": 0.00030303858820605233, - "632670": 0.00030303858820605233, - "645646": 0.00030303858820605233, - "650632": 0.00030303858820605233, - "670671": 0.00030303858820605233, - "671680": 0.00030303858820605233, - "671684": 0.00030303858820605233, - "671692": 0.0, - "684611": 0.0006439569999378611, - "684652": 0.0006439569999378611, - "692675": 0.00030303858820605233, - }, - "C1": { - "632633": 0.0006439569999378611, - "632645": 0.0006439569999378611, - "632670": 0.0006439569999378611, - "645646": 0.0006439569999378611, - "650632": 0.0006439569999378611, - "670671": 0.0006439569999378611, - "671680": 0.0006439569999378611, - "671684": 0.0006439569999378611, - "671692": 0.0, - "684611": 0.0006439569999378611, - "684652": 0.0006439569999378611, - "692675": 0.0006439569999378611, - }, - "CMatrix": { - "650632": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "632670": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "670671": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "671680": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "632633": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "632645": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "645646": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "692675": [ - 0.07271941241533586, - 0.0, - 0.0, - 0.0, - 0.07271941241533586, - 0.0, - 0.0, - 0.0, - 0.07271941241533586, - ], - "671684": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "684611": [0.0005303175293605915], - "684652": [0.04469819176039272], - "671692": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - }, - "EmergAmps": { - "632633": 600.0, - "632645": 600.0, - "632670": 600.0, - "645646": 600.0, - "650632": 600.0, - "670671": 600.0, - "671680": 600.0, - "671684": 600.0, - "671692": 600.0, - "684611": 600.0, - "684652": 600.0, - "692675": 600.0, - }, - "Geometry": { - "632633": "", - "632645": "", - "632670": "", - "645646": "", - "650632": "", - "670671": "", - "671680": "", - "671684": "", - "671692": "", - "684611": "", - "684652": "", - "692675": "", - }, - "Length": { - "632633": 500.0, - "632645": 500.0, - "632670": 667.0, - "645646": 300.0, - "650632": 2000.0, - "670671": 1333.0, - "671680": 1000.0, - "671684": 300.0, - "671692": 0.001, - "684611": 300.0, - "684652": 800.0, - "692675": 500.0, - }, - "LineCode": { - "632633": "mtx602", - "632645": "mtx603", - "632670": "mtx601", - "645646": "mtx603", - "650632": "mtx601", - "670671": "mtx601", - "671680": "mtx601", - "671684": "mtx604", - "671692": "", - "684611": "mtx605", - "684652": "mtx607", - "692675": "mtx606", - }, - "Name": { - "632633": "632633", - "632645": "632645", - "632670": "632670", - "645646": "645646", - "650632": "650632", - "670671": "670671", - "671680": "671680", - "671684": "671684", - "671692": "671692", - "684611": "684611", - "684652": "684652", - "692675": "692675", - }, - "NormAmps": { - "632633": 400.0, - "632645": 400.0, - "632670": 400.0, - "645646": 400.0, - "650632": 400.0, - "670671": 400.0, - "671680": 400.0, - "671684": 400.0, - "671692": 400.0, - "684611": 400.0, - "684652": 400.0, - "692675": 400.0, - }, - "NumCust": { - "632633": 0, - "632645": 0, - "632670": 0, - "645646": 0, - "650632": 0, - "670671": 0, - "671680": 0, - "671684": 0, - "671692": 0, - "684611": 0, - "684652": 0, - "692675": 0, - }, - "Parent": { - "632633": 0, - "632645": 0, - "632670": 0, - "645646": 0, - "650632": 0, - "670671": 0, - "671680": 0, - "671684": 0, - "671692": 0, - "684611": 0, - "684652": 0, - "692675": 0, - }, - "Phases": { - "632633": 3, - "632645": 2, - "632670": 3, - "645646": 2, - "650632": 3, - "670671": 3, - "671680": 3, - "671684": 2, - "671692": 3, - "684611": 1, - "684652": 1, - "692675": 3, - }, - "R0": { - "650632": 3.378880258497484e-05, - "632670": 3.378880258497484e-05, - "670671": 3.378880258497484e-05, - "671680": 3.378880258497484e-05, - "632633": 3.378880258497484e-05, - "632645": 3.378880258497484e-05, - "645646": 3.378880258497484e-05, - "692675": 3.378880258497484e-05, - "671684": 3.378880258497484e-05, - "684611": 1.0985148822469399e-05, - "684652": 1.0985148822469399e-05, - "671692": 0.0001, - }, - "R1": { - "650632": 1.0985148822469399e-05, - "632670": 1.0985148822469399e-05, - "670671": 1.0985148822469399e-05, - "671680": 1.0985148822469399e-05, - "632633": 1.0985148822469399e-05, - "632645": 1.0985148822469399e-05, - "645646": 1.0985148822469399e-05, - "692675": 1.0985148822469399e-05, - "671684": 1.0985148822469399e-05, - "684611": 1.0985148822469399e-05, - "684652": 1.0985148822469399e-05, - "671692": 0.0001, - }, - "RMatrix": { - "650632": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "632670": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "670671": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "671680": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "632633": [ - 0.00014254177592742189, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 0.0001415758404275151, - 2.9072764556018148e-05, - 2.9546262350090106e-05, - 2.9072764556018148e-05, - 0.00014083718386876285, - ], - "632645": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, - ], - "645646": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, - ], - "692675": [ - 0.0001499512588081775, - 6.03190733859442e-05, - 5.368517989187846e-05, - 6.03190733859442e-05, - 0.0001480436308954204, - 6.03190733859442e-05, - 5.368517989187846e-05, - 6.03190733859442e-05, - 0.0001499512588081775, - ], - "671684": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, - ], - "684611": [0.000251749307152178], - "684652": [0.0002542683154166408], - "671692": [0.0001, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0001], - }, - "Rg": { - "632633": 0.01805, - "632645": 0.01805, - "632670": 0.01805, - "645646": 0.01805, - "650632": 0.01805, - "670671": 0.01805, - "671680": 0.01805, - "671684": 0.01805, - "671692": 0.01805, - "684611": 0.01805, - "684652": 0.01805, - "692675": 0.01805, - }, - "Rho": { - "632633": 100.0, - "632645": 100.0, - "632670": 100.0, - "645646": 100.0, - "650632": 100.0, - "670671": 100.0, - "671680": 100.0, - "671684": 100.0, - "671692": 100.0, - "684611": 100.0, - "684652": 100.0, - "692675": 100.0, - }, - "Spacing": { - "632633": "", - "632645": "", - "632670": "", - "645646": "", - "650632": "", - "670671": "", - "671680": "", - "671684": "", - "671692": "", - "684611": "", - "684652": "", - "692675": "", - }, - "Units": { - "632633": 5, - "632645": 5, - "632670": 5, - "645646": 5, - "650632": 5, - "670671": 5, - "671680": 5, - "671684": 5, - "671692": 0, - "684611": 5, - "684652": 5, - "692675": 5, - }, - "X0": { - "650632": 7.664982290436836e-05, - "632670": 7.664982290436836e-05, - "670671": 7.664982290436836e-05, - "671680": 7.664982290436836e-05, - "632633": 7.664982290436836e-05, - "632645": 7.664982290436836e-05, - "645646": 7.664982290436836e-05, - "692675": 7.664982290436836e-05, - "671684": 7.664982290436836e-05, - "684611": 2.2841533586031195e-05, - "684652": 2.2841533586031195e-05, - "671692": 0.0, - }, - "X1": { - "650632": 2.2841533586031195e-05, - "632670": 2.2841533586031195e-05, - "670671": 2.2841533586031195e-05, - "671680": 2.2841533586031195e-05, - "632633": 2.2841533586031195e-05, - "632645": 2.2841533586031195e-05, - "645646": 2.2841533586031195e-05, - "692675": 2.2841533586031195e-05, - "671684": 2.2841533586031195e-05, - "684611": 2.2841533586031195e-05, - "684652": 2.2841533586031195e-05, - "671692": 0.0, - }, - "XMatrix": { - "650632": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "632670": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "670671": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "671680": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "632633": [ - 0.00022375611756664392, - 8.022946622755235e-05, - 9.502153731436029e-05, - 8.022946622755235e-05, - 0.00022695696265457032, - 7.289972037531847e-05, - 9.502153731436029e-05, - 7.289972037531847e-05, - 0.00022940021127198165, - ], - "632645": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, - ], - "645646": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, - ], - "692675": [ - 8.302348201081217e-05, - 5.243287292611695e-06, - -3.488807506369229e-06, - 5.243287292611695e-06, - 7.513406176598522e-05, - 5.243287292611695e-06, - -3.488807506369229e-06, - 5.243287292611695e-06, - 8.302348201081217e-05, - ], - "671684": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, - ], - "684611": [0.0002552153110047847], - "684652": [9.704810787298826e-05], - "671692": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - }, - "Xg": { - "632633": 0.155081, - "632645": 0.155081, - "632670": 0.155081, - "645646": 0.155081, - "650632": 0.155081, - "670671": 0.155081, - "671680": 0.155081, - "671684": 0.155081, - "671692": 0.155081, - "684611": 0.155081, - "684652": 0.155081, - "692675": 0.155081, - }, - "Yprim": { - "632633": [ - 5.564470386941076, - -7.133623601000619, - -1.495114717049371, - 1.5058679382212923, - -2.1394214811205607, - 1.6900708859940965, - -5.564470386941076, - 7.1336236509818685, - 1.495114717049371, - -1.50586794893156, - 2.1394214811205607, - -1.6900708967043643, - -1.495114717049371, - 1.5058679382212923, - 4.9084071780443566, - -7.063229336176304, - -1.0879942589622877, - 1.3823589025648546, - 1.495114717049371, - -1.50586794893156, - -4.9084071780443566, - 7.063229386157554, - 1.0879942589622877, - -1.3823589132751224, - -2.1394214811205607, - 1.6900708859940965, - -1.0879942589622877, - 1.3823589025648546, - 5.189061809545032, - -7.0854196238242695, - 2.1394214811205607, - -1.6900708967043643, - 1.0879942589622877, - -1.3823589132751224, - -5.189061809545032, - 7.085419673805519, - -5.564470386941076, - 7.1336236509818685, - 1.495114717049371, - -1.50586794893156, - 2.1394214811205607, - -1.6900708967043643, - 5.564470386941076, - -7.133623601000619, - -1.495114717049371, - 1.5058679382212923, - -2.1394214811205607, - 1.6900708859940965, - 1.495114717049371, - -1.50586794893156, - -4.9084071780443566, - 7.063229386157554, - 1.0879942589622877, - -1.3823589132751224, - -1.495114717049371, - 1.5058679382212923, - 4.9084071780443566, - -7.063229336176304, - -1.0879942589622877, - 1.3823589025648546, - 2.1394214811205607, - -1.6900708967043643, - 1.0879942589622877, - -1.3823589132751224, - -5.189061809545032, - 7.085419673805519, - -2.1394214811205607, - 1.6900708859940965, - -1.0879942589622877, - 1.3823589025648546, - 5.189061809545032, - -7.0854196238242695, - ], - "632645": [ - 4.3049233159489235, - -4.005143807731639, - -1.4446006150659336, - 0.5995892139073424, - -4.3049233159489235, - 4.005143857712889, - 1.4446006150659336, - -0.5995892246176102, - -1.4446006150659336, - 0.5995892139073424, - 4.334844320861555, - -3.9868570103932255, - 1.4446006150659336, - -0.5995892246176102, - -4.334844320861555, - 3.9868570603744753, - -4.3049233159489235, - 4.005143857712889, - 1.4446006150659336, - -0.5995892246176102, - 4.3049233159489235, - -4.005143807731639, - -1.4446006150659336, - 0.5995892139073424, - 1.4446006150659336, - -0.5995892246176102, - -4.334844320861555, - 3.9868570603744753, - -1.4446006150659336, - 0.5995892139073424, - 4.334844320861555, - -3.9868570103932255, - ], - "632670": [ - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - ], - "645646": [ - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - ], - "650632": [ - 1.145090744360685, - -3.300510291288572, - -0.48584426251815294, - 1.2202578674652254, - -0.2660516357083827, - 0.9121918679463129, - -1.145090744360685, - 3.3005104912135703, - 0.48584426251815294, - -1.2202579103062965, - 0.2660516357083827, - -0.912191910787384, - -0.48584426251815294, - 1.2202578674652254, - 1.0026837665363062, - -3.1275594644757296, - -0.12630137793675839, - 0.6966811885852322, - 0.48584426251815294, - -1.2202579103062965, - -1.0026837665363062, - 3.127559664400728, - 0.12630137793675839, - -0.6966812314263033, - -0.2660516357083827, - 0.9121918679463129, - -0.12630137793675839, - 0.6966811885852322, - 0.886694192671301, - -2.950512888096904, - 0.2660516357083827, - -0.912191910787384, - 0.12630137793675839, - -0.6966812314263033, - -0.886694192671301, - 2.950513088021902, - -1.145090744360685, - 3.3005104912135703, - 0.48584426251815294, - -1.2202579103062965, - 0.2660516357083827, - -0.912191910787384, - 1.145090744360685, - -3.300510291288572, - -0.48584426251815294, - 1.2202578674652254, - -0.2660516357083827, - 0.9121918679463129, - 0.48584426251815294, - -1.2202579103062965, - -1.0026837665363062, - 3.127559664400728, - 0.12630137793675839, - -0.6966812314263033, - -0.48584426251815294, - 1.2202578674652254, - 1.0026837665363062, - -3.1275594644757296, - -0.12630137793675839, - 0.6966811885852322, - 0.2660516357083827, - -0.912191910787384, - 0.12630137793675839, - -0.6966812314263033, - -0.886694192671301, - 2.950513088021902, - -0.2660516357083827, - 0.9121918679463129, - -0.12630137793675839, - 0.6966811885852322, - 0.886694192671301, - -2.950512888096904, - ], - "670671": [ - 1.7180656329492654, - -4.952003604504783, - -0.7289486309349635, - 1.8308445480500222, - -0.3991772478745428, - 1.3686299951334238, - -1.7180656329492654, - 4.9520037377547945, - 0.7289486309349635, - -1.8308445766035961, - 0.3991772478745428, - -1.3686300236869977, - -0.7289486309349635, - 1.8308445480500222, - 1.5044017502420202, - -4.69251249150727, - -0.18949944176557929, - 1.045283139377864, - 0.7289486309349635, - -1.8308445766035961, - -1.5044017502420202, - 4.692512624757282, - 0.18949944176557929, - -1.045283167931438, - -0.3991772478745428, - 1.3686299951334238, - -0.18949944176557929, - 1.045283139377864, - 1.3303738824775715, - -4.426876217870621, - 0.3991772478745428, - -1.3686300236869977, - 0.18949944176557929, - -1.045283167931438, - -1.3303738824775715, - 4.426876351120633, - -1.7180656329492654, - 4.9520037377547945, - 0.7289486309349635, - -1.8308445766035961, - 0.3991772478745428, - -1.3686300236869977, - 1.7180656329492654, - -4.952003604504783, - -0.7289486309349635, - 1.8308445480500222, - -0.3991772478745428, - 1.3686299951334238, - 0.7289486309349635, - -1.8308445766035961, - -1.5044017502420202, - 4.692512624757282, - 0.18949944176557929, - -1.045283167931438, - -0.7289486309349635, - 1.8308445480500222, - 1.5044017502420202, - -4.69251249150727, - -0.18949944176557929, - 1.045283139377864, - 0.3991772478745428, - -1.3686300236869977, - 0.18949944176557929, - -1.045283167931438, - -1.3303738824775715, - 4.426876351120633, - -0.3991772478745428, - 1.3686299951334238, - -0.18949944176557929, - 1.045283139377864, - 1.3303738824775715, - -4.426876217870621, - ], - "671680": [ - 2.29018148872137, - -6.601020882464641, - -0.9716885250363059, - 2.4405157991920574, - -0.5321032714167654, - 1.8243838001542325, - -2.29018148872137, - 6.601020982427141, - 0.9716885250363059, - -2.440515820612593, - 0.5321032714167654, - -1.824383821574768, - -0.9716885250363059, - 2.4405157991920574, - 2.0053675330726124, - -6.255119228838956, - -0.25260275587351677, - 1.393362441432071, - 0.9716885250363059, - -2.440515820612593, - -2.0053675330726124, - 6.255119328801456, - 0.25260275587351677, - -1.3933624628526067, - -0.5321032714167654, - 1.8243838001542325, - -0.25260275587351677, - 1.393362441432071, - 1.773388385342602, - -5.901026076081305, - 0.5321032714167654, - -1.824383821574768, - 0.25260275587351677, - -1.3933624628526067, - -1.773388385342602, - 5.901026176043804, - -2.29018148872137, - 6.601020982427141, - 0.9716885250363059, - -2.440515820612593, - 0.5321032714167654, - -1.824383821574768, - 2.29018148872137, - -6.601020882464641, - -0.9716885250363059, - 2.4405157991920574, - -0.5321032714167654, - 1.8243838001542325, - 0.9716885250363059, - -2.440515820612593, - -2.0053675330726124, - 6.255119328801456, - 0.25260275587351677, - -1.3933624628526067, - -0.9716885250363059, - 2.4405157991920574, - 2.0053675330726124, - -6.255119228838956, - -0.25260275587351677, - 1.393362441432071, - 0.5321032714167654, - -1.824383821574768, - 0.25260275587351677, - -1.3933624628526067, - -1.773388385342602, - 5.901026176043804, - -0.5321032714167654, - 1.8243838001542325, - -0.25260275587351677, - 1.393362441432071, - 1.773388385342602, - -5.901026076081305, - ], - "671684": [ - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - ], - "671692": [ - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -10000000.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 10000000.0, - 0.0, - ], - "684611": [ - 6.529823239597013, - -6.6197237251699725, - -6.529823239597013, - 6.619723755158723, - -6.529823239597013, - 6.619723755158723, - 6.529823239597013, - -6.6197237251699725, - ], - "684652": [ - 4.290972612222875, - -1.6377544265266006, - -4.290972612222875, - 1.637761166855122, - -4.290972612222875, - 1.637761166855122, - 4.290972612222875, - -1.6377544265266006, - ], - "692675": [ - 10.412482684253026, - -7.836346738670522, - -2.4285352771370636, - 3.079311097832397, - -1.080921781180488, - 2.49252596573072, - -10.412482684253026, - 7.836353592313676, - 2.4285352771370636, - -3.079311097832397, - 1.080921781180488, - -2.49252596573072, - -2.4285352771370636, - 3.079311097832397, - 11.54642946546697, - -8.19720842103701, - -2.428535277137064, - 3.079311097832396, - 2.4285352771370636, - -3.079311097832397, - -11.54642946546697, - 8.197215274680165, - 2.428535277137064, - -3.079311097832396, - -1.080921781180488, - 2.49252596573072, - -2.428535277137064, - 3.079311097832396, - 10.412482684253028, - -7.83634673867052, - 1.080921781180488, - -2.49252596573072, - 2.428535277137064, - -3.079311097832396, - -10.412482684253028, - 7.8363535923136745, - -10.412482684253026, - 7.836353592313676, - 2.4285352771370636, - -3.079311097832397, - 1.080921781180488, - -2.49252596573072, - 10.412482684253026, - -7.836346738670522, - -2.4285352771370636, - 3.079311097832397, - -1.080921781180488, - 2.49252596573072, - 2.4285352771370636, - -3.079311097832397, - -11.54642946546697, - 8.197215274680165, - 2.428535277137064, - -3.079311097832396, - -2.4285352771370636, - 3.079311097832397, - 11.54642946546697, - -8.19720842103701, - -2.428535277137064, - 3.079311097832396, - 1.080921781180488, - -2.49252596573072, - 2.428535277137064, - -3.079311097832396, - -10.412482684253028, - 7.8363535923136745, - -1.080921781180488, - 2.49252596573072, - -2.428535277137064, - 3.079311097832396, - 10.412482684253028, - -7.83634673867052, - ], - }, - "Idx": { - "650632": 1, - "632670": 2, - "670671": 3, - "671680": 4, - "632633": 5, - "632645": 6, - "645646": 7, - "692675": 8, - "671684": 9, - "684611": 10, - "684652": 11, - "671692": 12, - }, - "IsSwitch": { - "650632": False, - "632670": False, - "670671": False, - "671680": False, - "632633": False, - "632645": False, - "645646": False, - "692675": False, - "671684": False, - "684611": False, - "684652": False, - "671692": True, - }, - # Starting in DSS C-API 0.10.6, returns the NormAmps value, - # mirroring the official code - "SeasonRating": { - "650632": 400.0, - "632670": 400.0, - "670671": 400.0, - "671680": 400.0, - "632633": 400.0, - "632645": 400.0, - "645646": 400.0, - "692675": 400.0, - "671684": 400.0, - "684611": 400.0, - "684652": 400.0, - "671692": 400.0, - }, - } - ).to_dict() - - actual_dict = dss.utils.lines_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_loads_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "AllocationFactor": { - "611": 0.5, - "634a": 0.5, - "634b": 0.5, - "634c": 0.5, - "645": 0.5, - "646": 0.5, - "652": 0.5, - "670a": 0.5, - "670b": 0.5, - "670c": 0.5, - "671": 0.5, - "675a": 0.5, - "675b": 0.5, - "675c": 0.5, - "692": 0.5, - }, - "CFactor": { - "611": 4.0, - "634a": 4.0, - "634b": 4.0, - "634c": 4.0, - "645": 4.0, - "646": 4.0, - "652": 4.0, - "670a": 4.0, - "670b": 4.0, - "670c": 4.0, - "671": 4.0, - "675a": 4.0, - "675b": 4.0, - "675c": 4.0, - "692": 4.0, - }, - "CVRCurve": { - "611": "", - "634a": "", - "634b": "", - "634c": "", - "645": "", - "646": "", - "652": "", - "670a": "", - "670b": "", - "670c": "", - "671": "", - "675a": "", - "675b": "", - "675c": "", - "692": "", - }, - "CVRvars": { - "611": 2.0, - "634a": 2.0, - "634b": 2.0, - "634c": 2.0, - "645": 2.0, - "646": 2.0, - "652": 2.0, - "670a": 2.0, - "670b": 2.0, - "670c": 2.0, - "671": 2.0, - "675a": 2.0, - "675b": 2.0, - "675c": 2.0, - "692": 2.0, - }, - "CVRwatts": { - "611": 1.0, - "634a": 1.0, - "634b": 1.0, - "634c": 1.0, - "645": 1.0, - "646": 1.0, - "652": 1.0, - "670a": 1.0, - "670b": 1.0, - "670c": 1.0, - "671": 1.0, - "675a": 1.0, - "675b": 1.0, - "675c": 1.0, - "692": 1.0, - }, - "Class": { - "611": 1, - "634a": 1, - "634b": 1, - "634c": 1, - "645": 1, - "646": 1, - "652": 1, - "670a": 1, - "670b": 1, - "670c": 1, - "671": 1, - "675a": 1, - "675b": 1, - "675c": 1, - "692": 1, - }, - "Daily": { - "611": "", - "634a": "", - "634b": "", - "634c": "", - "645": "", - "646": "", - "652": "", - "670a": "", - "670b": "", - "670c": "", - "671": "", - "675a": "", - "675b": "", - "675c": "", - "692": "", - }, - "Duty": { - "611": "", - "634a": "", - "634b": "", - "634c": "", - "645": "", - "646": "", - "652": "", - "670a": "", - "670b": "", - "670c": "", - "671": "", - "675a": "", - "675b": "", - "675c": "", - "692": "", - }, - "Growth": { - "611": "", - "634a": "", - "634b": "", - "634c": "", - "645": "", - "646": "", - "652": "", - "670a": "", - "670b": "", - "670c": "", - "671": "", - "675a": "", - "675b": "", - "675c": "", - "692": "", - }, - "Idx": { - "611": 11, - "634a": 2, - "634b": 3, - "634c": 4, - "645": 5, - "646": 6, - "652": 12, - "670a": 13, - "670b": 14, - "670c": 15, - "671": 1, - "675a": 8, - "675b": 9, - "675c": 10, - "692": 7, - }, - "IsDelta": { - "611": 0, - "634a": 0, - "634b": 0, - "634c": 0, - "645": 0, - "646": 1, - "652": 0, - "670a": 0, - "670b": 0, - "670c": 0, - "671": 1, - "675a": 0, - "675b": 0, - "675c": 0, - "692": 1, - }, - "Model": { - "611": 5, - "634a": 1, - "634b": 1, - "634c": 1, - "645": 1, - "646": 2, - "652": 2, - "670a": 1, - "670b": 1, - "670c": 1, - "671": 1, - "675a": 1, - "675b": 1, - "675c": 1, - "692": 5, - }, - "Name": { - "611": "611", - "634a": "634a", - "634b": "634b", - "634c": "634c", - "645": "645", - "646": "646", - "652": "652", - "670a": "670a", - "670b": "670b", - "670c": "670c", - "671": "671", - "675a": "675a", - "675b": "675b", - "675c": "675c", - "692": "692", - }, - "NumCust": { - "611": 1, - "634a": 1, - "634b": 1, - "634c": 1, - "645": 1, - "646": 1, - "652": 1, - "670a": 1, - "670b": 1, - "670c": 1, - "671": 1, - "675a": 1, - "675b": 1, - "675c": 1, - "692": 1, - }, - "PF": { - "611": 0.9048187022009941, - "634a": 0.8240419241993675, - "634b": 0.8, - "634c": 0.8, - "645": 0.8056510126494245, - "646": 0.8673133941933718, - "652": 0.8300495997825932, - "670a": 0.8619342151577695, - "670b": 0.8666224568741688, - "670c": 0.8645818496218686, - "671": 0.8682431421244591, - "675a": 0.9311010850748034, - "675b": 0.7498378553650925, - "675c": 0.8072891017918288, - "692": 0.7476519144858309, - }, - "PctMean": { - "611": 50.0, - "634a": 50.0, - "634b": 50.0, - "634c": 50.0, - "645": 50.0, - "646": 50.0, - "652": 50.0, - "670a": 50.0, - "670b": 50.0, - "670c": 50.0, - "671": 50.0, - "675a": 50.0, - "675b": 50.0, - "675c": 50.0, - "692": 50.0, - }, - "PctStdDev": { - "611": 10.0, - "634a": 10.0, - "634b": 10.0, - "634c": 10.0, - "645": 10.0, - "646": 10.0, - "652": 10.0, - "670a": 10.0, - "670b": 10.0, - "670c": 10.0, - "671": 10.0, - "675a": 10.0, - "675b": 10.0, - "675c": 10.0, - "692": 10.0, - }, - "RelWeighting": { - "611": 1.0, - "634a": 1.0, - "634b": 1.0, - "634c": 1.0, - "645": 1.0, - "646": 1.0, - "652": 1.0, - "670a": 1.0, - "670b": 1.0, - "670c": 1.0, - "671": 1.0, - "675a": 1.0, - "675b": 1.0, - "675c": 1.0, - "692": 1.0, - }, - "Rneut": { - "611": -1.0, - "634a": -1.0, - "634b": -1.0, - "634c": -1.0, - "645": -1.0, - "646": -1.0, - "652": -1.0, - "670a": -1.0, - "670b": -1.0, - "670c": -1.0, - "671": -1.0, - "675a": -1.0, - "675b": -1.0, - "675c": -1.0, - "692": -1.0, - }, - "Spectrum": { - "611": "defaultload", - "634a": "defaultload", - "634b": "defaultload", - "634c": "defaultload", - "645": "defaultload", - "646": "defaultload", - "652": "defaultload", - "670a": "defaultload", - "670b": "defaultload", - "670c": "defaultload", - "671": "defaultload", - "675a": "defaultload", - "675b": "defaultload", - "675c": "defaultload", - "692": "defaultload", - }, - "Status": { - "611": 0, - "634a": 0, - "634b": 0, - "634c": 0, - "645": 0, - "646": 0, - "652": 0, - "670a": 0, - "670b": 0, - "670c": 0, - "671": 0, - "675a": 0, - "675b": 0, - "675c": 0, - "692": 0, - }, - "Vmaxpu": { - "611": 1.05, - "634a": 1.05, - "634b": 1.05, - "634c": 1.05, - "645": 1.05, - "646": 1.05, - "652": 1.05, - "670a": 1.05, - "670b": 1.05, - "670c": 1.05, - "671": 1.05, - "675a": 1.05, - "675b": 1.05, - "675c": 1.05, - "692": 1.05, - }, - "VminEmerg": { - "611": 0.0, - "634a": 0.0, - "634b": 0.0, - "634c": 0.0, - "645": 0.0, - "646": 0.0, - "652": 0.0, - "670a": 0.0, - "670b": 0.0, - "670c": 0.0, - "671": 0.0, - "675a": 0.0, - "675b": 0.0, - "675c": 0.0, - "692": 0.0, - }, - "VminNorm": { - "611": 0.0, - "634a": 0.0, - "634b": 0.0, - "634c": 0.0, - "645": 0.0, - "646": 0.0, - "652": 0.0, - "670a": 0.0, - "670b": 0.0, - "670c": 0.0, - "671": 0.0, - "675a": 0.0, - "675b": 0.0, - "675c": 0.0, - "692": 0.0, - }, - "Vminpu": { - "611": 0.95, - "634a": 0.95, - "634b": 0.95, - "634c": 0.95, - "645": 0.95, - "646": 0.95, - "652": 0.95, - "670a": 0.95, - "670b": 0.95, - "670c": 0.95, - "671": 0.95, - "675a": 0.95, - "675b": 0.95, - "675c": 0.95, - "692": 0.95, - }, - "XfkVA": { - "611": 0.0, - "634a": 0.0, - "634b": 0.0, - "634c": 0.0, - "645": 0.0, - "646": 0.0, - "652": 0.0, - "670a": 0.0, - "670b": 0.0, - "670c": 0.0, - "671": 0.0, - "675a": 0.0, - "675b": 0.0, - "675c": 0.0, - "692": 0.0, - }, - "Xneut": { - "611": 0.0, - "634a": 0.0, - "634b": 0.0, - "634c": 0.0, - "645": 0.0, - "646": 0.0, - "652": 0.0, - "670a": 0.0, - "670b": 0.0, - "670c": 0.0, - "671": 0.0, - "675a": 0.0, - "675b": 0.0, - "675c": 0.0, - "692": 0.0, - }, - "Yearly": { - "611": "", - "634a": "", - "634b": "", - "634c": "", - "645": "", - "646": "", - "652": "", - "670a": "", - "670b": "", - "670c": "", - "671": "", - "675a": "", - "675b": "", - "675c": "", - "692": "", - }, - "ZipV": { - "611": [], - "634a": [], - "634b": [], - "634c": [], - "645": [], - "646": [], - "652": [], - "670a": [], - "670b": [], - "670c": [], - "671": [], - "675a": [], - "675b": [], - "675c": [], - "692": [], - }, - "kV": { - "611": 2.4, - "634a": 0.277, - "634b": 0.277, - "634c": 0.277, - "645": 2.4, - "646": 4.16, - "652": 2.4, - "670a": 2.4, - "670b": 2.4, - "670c": 2.4, - "671": 4.16, - "675a": 2.4, - "675b": 2.4, - "675c": 2.4, - "692": 4.16, - }, - "kVABase": { - "611": 187.88294228055935, - "634a": 194.164878389476, - "634b": 150.0, - "634c": 150.0, - "645": 211.00947846009194, - "646": 265.18672666632466, - "652": 154.20765220960988, - "670a": 19.72308292331602, - "670b": 76.15773105863909, - "670c": 135.32553343696821, - "671": 1330.2725284692608, - "675a": 520.8886637276722, - "675b": 90.68627239003708, - "675c": 359.22694776422327, - "692": 227.37853900489378, - }, - "kW": { - "611": 170.0, - "634a": 160.0, - "634b": 120.0, - "634c": 120.0, - "645": 170.0, - "646": 230.0, - "652": 128.0, - "670a": 17.0, - "670b": 66.0, - "670c": 117.0, - "671": 1155.0, - "675a": 485.0, - "675b": 68.0, - "675c": 290.0, - "692": 170.0, - }, - "kWh": { - "611": 0.0, - "634a": 0.0, - "634b": 0.0, - "634c": 0.0, - "645": 0.0, - "646": 0.0, - "652": 0.0, - "670a": 0.0, - "670b": 0.0, - "670c": 0.0, - "671": 0.0, - "675a": 0.0, - "675b": 0.0, - "675c": 0.0, - "692": 0.0, - }, - "kWhDays": { - "611": 30.0, - "634a": 30.0, - "634b": 30.0, - "634c": 30.0, - "645": 30.0, - "646": 30.0, - "652": 30.0, - "670a": 30.0, - "670b": 30.0, - "670c": 30.0, - "671": 30.0, - "675a": 30.0, - "675b": 30.0, - "675c": 30.0, - "692": 30.0, - }, - "kvar": { - "611": 80.0, - "634a": 110.0, - "634b": 90.0, - "634c": 90.0, - "645": 125.0, - "646": 132.0, - "652": 86.0, - "670a": 10.0, - "670b": 38.0, - "670c": 68.0, - "671": 660.0, - "675a": 190.0, - "675b": 60.0, - "675c": 212.0, - "692": 151.0, - }, - "puSeriesRL": { - "611": 50.0, - "634a": 50.0, - "634b": 50.0, - "634c": 50.0, - "645": 50.0, - "646": 50.0, - "652": 50.0, - "670a": 50.0, - "670b": 50.0, - "670c": 50.0, - "671": 50.0, - "675a": 50.0, - "675b": 50.0, - "675c": 50.0, - "692": 50.0, - }, - "Phases": { - "671": 3, - "634a": 1, - "634b": 1, - "634c": 1, - "645": 1, - "646": 1, - "692": 1, - "675a": 1, - "675b": 1, - "675c": 1, - "611": 1, - "652": 1, - "670a": 1, - "670b": 1, - "670c": 1, - }, - } - ).to_dict() - - actual_dict = dss.utils.loads_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_loadshape_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "HrInterval": {"default": 1.0}, - "Idx": {"default": 1}, - "MinInterval": {"default": 60.0}, - "Name": {"default": "default"}, - "Npts": {"default": 24}, - "PBase": {"default": 0.0}, - "PMult": { - "default": [ - 0.677, - 0.6256, - 0.6087, - 0.5833, - 0.58028, - 0.6025, - 0.657, - 0.7477, - 0.832, - 0.88, - 0.94, - 0.989, - 0.985, - 0.98, - 0.9898, - 0.999, - 1.0, - 0.958, - 0.936, - 0.913, - 0.876, - 0.876, - 0.828, - 0.756, - ] - }, - "QBase": {"default": 0.0}, - "QMult": {"default": [0.0]}, - "SInterval": {"default": 3600.0}, - "TimeArray": {"default": [0.0]}, - "UseActual": {"default": 0}, - } - ).to_dict() - - actual_dict = dss.utils.loadshape_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_meters_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "AllBranchesInZone": {"": []}, - "AllEndElements": {"": []}, - "AllocFactors": {"": [0.0]}, - "AvgRepairTime": {"": 0.0}, - "CalcCurrent": {"": [0.0]}, - "CountBranches": {"": 0}, - "CountEndElements": {"": 0}, - "CustInterrupts": {"": 0.0}, - "FaultRateXRepairHrs": {"": 0.0}, - "MeteredElement": {"": ""}, - "MeteredTerminal": {"": 0}, - "Name": {"": ""}, - "NumSectionBranches": {"": 0}, - "NumSectionCustomers": {"": 0}, - "NumSections": {"": 0}, - "OCPDeviceType": {"": 0}, - "PeakCurrent": {"": [0.0]}, - "RegisterNames": {"": []}, - "RegisterValues": {"": [0.0]}, - "SAIDI": {"": 0.0}, - "SAIFI": {"": 0.0}, - "SAIFIkW": {"": 0.0}, - "SectSeqidx": {"": 0}, - "SectTotalCust": {"": 0}, - "SeqListSize": {"": 0}, - "SequenceList": {"": 0}, - "SumBranchFltRates": {"": 0.0}, - "TotalCustomers": {"": 0}, - "Totals": { - "": [ - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ] - }, - } - ).to_dict() - - actual_dict = dss.utils.meters_to_dataframe().to_dict() - from pprint import pprint - - pprint(actual_dict) - assert_dict_equal(actual_dict, expected_dict) - - -def test_pvsystems_to_dataframe(dss): - dss.run_command("New PVSystem.631") - - expected_dict = pd.DataFrame( - { - "Idx": {"631": 1}, - "Irradiance": {"631": 1.0}, - "IrradianceNow": {"631": 1.0}, - "Name": {"631": "631"}, - "Pmpp": {"631": 500.0}, - "kVARated": {"631": 500.0}, - "kW": {"631": 499.99999999999994}, - "kvar": {"631": 0.0}, - "pf": {"631": 1.0}, - "RegisterNames": { - "631": ["kWh", "kvarh", "Max kW", "Max kVA", "Hours", "Price($)"] - }, - "RegisterValues": {"631": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}, - "Tdaily": {"631": ""}, - "Tduty": {"631": ""}, - "Tyearly": {"631": ""}, - "daily": {"631": ""}, - "duty": {"631": ""}, - "yearly": {"631": ""}, - } - ).to_dict() - - actual_dict = dss.utils.pvsystems_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_reclosers_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "GroundInst": {"": 0.0}, - "GroundTrip": {"": 0.0}, - "Idx": {"": 0}, - "MonitoredObj": {"": ""}, - "MonitoredTerm": {"": 0}, - "Name": {"": ""}, - "NumFast": {"": 0}, - "PhaseInst": {"": 0.0}, - "PhaseTrip": {"": 0.0}, - "RecloseIntervals": {"": [-1.0]}, - "Shots": {"": 0}, - "SwitchedObj": {"": ""}, - "SwitchedTerm": {"": 0}, - } - ).to_dict() - - actual_dict = dss.utils.reclosers_to_dataframe().to_dict() - - assert_dict_equal(actual_dict, expected_dict) - - -def test_regcontrols_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "CTPrimary": {"reg1": 700.0, "reg2": 700.0, "reg3": 700.0}, - "Delay": {"reg1": 15.0, "reg2": 15.0, "reg3": 15.0}, - "ForwardBand": {"reg1": 2.0, "reg2": 2.0, "reg3": 2.0}, - "ForwardR": {"reg1": 3.0, "reg2": 3.0, "reg3": 3.0}, - "ForwardVreg": {"reg1": 122.0, "reg2": 122.0, "reg3": 122.0}, - "ForwardX": {"reg1": 9.0, "reg2": 9.0, "reg3": 9.0}, - "Idx": {"reg1": 1, "reg2": 2, "reg3": 3}, - "IsInverseTime": {"reg1": 0, "reg2": 0, "reg3": 0}, - "IsReversible": {"reg1": 0, "reg2": 0, "reg3": 0}, - "MaxTapChange": {"reg1": 16, "reg2": 16, "reg3": 16}, - "MonitoredBus": {"reg1": "", "reg2": "", "reg3": ""}, - "Name": {"reg1": "reg1", "reg2": "reg2", "reg3": "reg3"}, - "PTRatio": {"reg1": 20.0, "reg2": 20.0, "reg3": 20.0}, - "ReverseBand": {"reg1": 3.0, "reg2": 3.0, "reg3": 3.0}, - "ReverseR": {"reg1": 0.0, "reg2": 0.0, "reg3": 0.0}, - "ReverseVreg": {"reg1": 120.0, "reg2": 120.0, "reg3": 120.0}, - "ReverseX": {"reg1": 0.0, "reg2": 0.0, "reg3": 0.0}, - "TapDelay": {"reg1": 2.0, "reg2": 2.0, "reg3": 2.0}, - "TapNumber": {"reg1": 9, "reg2": 6, "reg3": 9}, - "TapWinding": {"reg1": 2, "reg2": 2, "reg3": 2}, - "Transformer": {"reg1": "reg1", "reg2": "reg2", "reg3": "reg3"}, - "VoltageLimit": {"reg1": 0.0, "reg2": 0.0, "reg3": 0.0}, - "Winding": {"reg1": 2, "reg2": 2, "reg3": 2}, - } - ).to_dict() - - actual_dict = dss.utils.regcontrols_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_relays_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "Idx": {"": 0}, - "MonitoredObj": {"": ""}, - "MonitoredTerm": {"": 0}, - "Name": {"": ""}, - "SwitchedObj": {"": ""}, - "SwitchedTerm": {"": 0}, - } - ).to_dict() - - actual_dict = dss.utils.relays_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_sensors_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "Currents": {"": [0.0]}, - "Idx": {"": 0}, - "IsDelta": {"": 0}, - "MeteredElement": {"": ""}, - "MeteredTerminal": {"": 0}, - "Name": {"": ""}, - "PctError": {"": 0.0}, - "ReverseDelta": {"": 0}, - "Weight": {"": 0.0}, - "kVBase": {"": 0.0}, - "kW": {"": [0.0]}, - "kvar": {"": [0.0]}, - "kVS": {"": [0.0]}, - } - ).to_dict() - - actual_dict = dss.utils.sensors_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_transformers_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "IsDelta": {"reg1": 0, "reg2": 0, "reg3": 0, "sub": 0, "xfm1": 0}, - "MaxTap": {"reg1": 1.1, "reg2": 1.1, "reg3": 1.1, "sub": 1.1, "xfm1": 1.1}, - "MinTap": {"reg1": 0.9, "reg2": 0.9, "reg3": 0.9, "sub": 0.9, "xfm1": 0.9}, - "Name": { - "reg1": "reg1", - "reg2": "reg2", - "reg3": "reg3", - "sub": "sub", - "xfm1": "xfm1", - }, - "NumTaps": {"reg1": 32, "reg2": 32, "reg3": 32, "sub": 32, "xfm1": 32}, - "NumWindings": {"reg1": 2, "reg2": 2, "reg3": 2, "sub": 2, "xfm1": 2}, - "R": { - "reg1": 5e-05, - "reg2": 5e-05, - "reg3": 5e-05, - "sub": 5e-06, - "xfm1": 0.0055000000000000005, - }, - "Rneut": { - "reg1": -1.0, - "reg2": -1.0, - "reg3": -1.0, - "sub": -1.0, - "xfm1": -1.0, - }, - "Tap": { - "reg1": 1.05625, - "reg2": 1.0375, - "reg3": 1.05625, - "sub": 1.0, - "xfm1": 1.0, - }, - "Wdg": {"reg1": 2, "reg2": 2, "reg3": 2, "sub": 2, "xfm1": 2}, - "XfmrCode": {"reg1": "", "reg2": "", "reg3": "", "sub": "", "xfm1": ""}, - "Xhl": { - "reg1": 0.0001, - "reg2": 0.0001, - "reg3": 0.0001, - "sub": 8e-05, - "xfm1": 0.02, - }, - "Xht": { - "reg1": 0.35, - "reg2": 0.35, - "reg3": 0.35, - "sub": 0.04, - "xfm1": 0.01, - }, - "Xlt": {"reg1": 0.3, "reg2": 0.3, "reg3": 0.3, "sub": 0.04, "xfm1": 0.01}, - "Xneut": {"reg1": 0.0, "reg2": 0.0, "reg3": 0.0, "sub": 0.0, "xfm1": 0.0}, - "kV": {"reg1": 2.4, "reg2": 2.4, "reg3": 2.4, "sub": 4.16, "xfm1": 0.48}, - "kVA": { - "reg1": 1666.0, - "reg2": 1666.0, - "reg3": 1666.0, - "sub": 5000.0, - "xfm1": 500.0, - }, - "Idx": {"sub": 1, "reg1": 2, "reg2": 3, "reg3": 4, "xfm1": 5}, - "CoreType": {"sub": 0, "reg1": 0, "reg2": 0, "reg3": 0, "xfm1": 0}, - "RdcOhms": { - "sub": 4.903253333333334e-06, - "reg1": 0.0001469387755102041, - "reg2": 0.0001469387755102041, - "reg3": 0.0001469387755102041, - "xfm1": 0.0007180800000000002, - }, - "WdgCurrents": { - "sub": [ - 10.886841976909636, - -5.959137749538058, - -10.886837793241284, - 5.9591377488395665, - -521.2750911256298, - 285.33021885715425, - 521.2750910583418, - -285.33056578971446, - -7.0864411112852395, - -5.676524012698792, - 7.08643901895266, - 5.6765203900286, - 339.3068900331855, - 271.79902453906834, - -339.30719047319144, - -271.79885100666434, - -0.7712923191138543, - 13.032080353223137, - 0.7712902277708054, - -13.032076729854452, - 36.93081190716475, - -623.9914583135396, - -36.93051140662283, - 623.9916317127645, - ], - "reg1": [ - 521.2750911260955, - -285.3302188576199, - -521.2750911936164, - 285.3298715483397, - -493.5148793202825, - 270.13442282844335, - 493.51487923646346, - -270.13478963123634, - ], - "reg2": [ - -339.3068900331855, - -271.799024539534, - 339.30658926814795, - 271.79919826006517, - 327.04218366835266, - 261.9753110844176, - -327.0424956800416, - -261.9751308527775, - ], - "reg3": [ - -36.93081190693192, - 623.9914583163336, - 36.93111273297109, - -623.9912847299129, - 34.96468480094336, - -590.7607963085175, - -34.96436708443798, - 590.7609796244651, - ], - "xfm1": [ - 64.72170952697047, - -50.183159858127965, - -64.72171111559783, - 50.183124805561874, - -560.921513320438, - 434.92011862689833, - 560.9214963351824, - -434.9204149815341, - -57.872547335262425, - -22.049313062480678, - 57.87251705193739, - 22.049331842808215, - 501.56155806127936, - 191.0943712195276, - -501.5618144501241, - -191.0942093043377, - 10.60458044937559, - 62.68522749032809, - -10.604549699178278, - -62.68521130450972, - -91.90583479822817, - -543.2716959558966, - 91.90609739287902, - 543.2718313057558, - ], - }, - "WdgVoltages": { - "sub": [ - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493826, - -2079.7175117533034, - -1200.31160042552, - 2080.141938589097, - ], - "reg1": [2536.3561173511703, -0.5793274158645817], - "reg2": [-1246.25987615131, -2157.487712670567], - "reg3": [-1267.5877682936239, 2196.935536435069], - "xfm1": [ - 273.12043190753747, - -15.653612485262295, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, - ], - }, - "LossesByType": { - "sub": [ - 32.287911165039986, - 262.46956554229837, - 32.287911165039986, - 262.46956554229837, - 0.0, - 0.0, - ], - "reg1": [ - 122.09431781526655, - 123.85874612047337, - 122.09431781526655, - 123.85874612047337, - 0.0, - 0.0, - ], - "reg2": [ - 65.34584129205905, - 67.07780241721775, - 65.34584129205905, - 67.07780241721775, - 0.0, - 0.0, - ], - "reg3": [ - 135.0899914202746, - 136.85448114364408, - 135.0899914202746, - 136.85448114364408, - 0.0, - 0.0, - ], - "xfm1": [ - 5552.672495756749, - 10096.271270538462, - 5552.672495756749, - 10096.271270538462, - 0.0, - 0.0, - ], - }, - } - ).to_dict() - - actual_dict = dss.utils.transformers_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_vsources_to_dataframe(dss): - expected_dict = pd.DataFrame( - { - "Idx": {"source": 1}, - "AngleDeg": {"source": 30.0}, - "BasekV": {"source": 115.0}, - "Frequency": {"source": 60.0}, - "Name": {"source": "source"}, - "PU": {"source": 1.0001}, - "Phases": {"source": 3}, - } - ).to_dict() - - actual_dict = dss.utils.vsources_to_dataframe().to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_xycurves_to_dataframe(dss): - # XYCurve already set an error before, - # but it wasn't handled. - with pt.raises(dss.DSSException): - dss.utils.xycurves_to_dataframe().to_dict() - - -def test_storage_to_dataframe(dss): - dss.Basic.LegacyModels(True) - assert dss.Basic.LegacyModels() - - assert ( - dss.utils.run_command("Redirect {}".format(PATH_TO_DSS)) == "" - ), "Unable to find test data" - - dss.run_command("New Storage.631") - - # Legacy version - expected_dict = pd.DataFrame( - { - "%Charge": {"Storage.631": "100"}, - "%Discharge": {"Storage.631": "100"}, - "%EffCharge": {"Storage.631": "90"}, - "%EffDischarge": {"Storage.631": "90"}, - "%IdlingkW": {"Storage.631": "1"}, - "%Idlingkvar": {"Storage.631": "0"}, - "%R": {"Storage.631": "0"}, - "%X": {"Storage.631": "50"}, - "%reserve": {"Storage.631": "20"}, - "%stored": {"Storage.631": "100"}, - "Balanced": {"Storage.631": "No"}, - "ChargeTrigger": {"Storage.631": "0"}, - "DischargeTrigger": {"Storage.631": "0"}, - "DispMode": {"Storage.631": "default"}, - "DynaDLL": {"Storage.631": ""}, - "DynaData": {"Storage.631": ()}, - "LimitCurrent": {"Storage.631": "No"}, - "State": {"Storage.631": "IDLING"}, - "TimeChargeTrig": {"Storage.631": "2"}, - "UserData": {"Storage.631": ()}, - "UserModel": {"Storage.631": ""}, - "Vmaxpu": {"Storage.631": "1.1"}, - "Vminpu": {"Storage.631": "0.9"}, - "basefreq": {"Storage.631": "60"}, - "bus1": {"Storage.631": "631_1"}, - "class": {"Storage.631": "1"}, - "conn": {"Storage.631": "wye"}, - "daily": {"Storage.631": ""}, - "debugtrace": {"Storage.631": "NO"}, - "duty": {"Storage.631": ""}, - "enabled": {"Storage.631": True}, - "kVA": {"Storage.631": "25"}, - "kW": {"Storage.631": "0"}, - "kWhrated": {"Storage.631": "50"}, - "kWhstored": {"Storage.631": "50"}, - "kWrated": {"Storage.631": "25"}, - "kv": {"Storage.631": "12.47"}, - "kvar": {"Storage.631": "0"}, - "like": {"Storage.631": ""}, - "model": {"Storage.631": "1"}, - "pf": {"Storage.631": "1"}, - "phases": {"Storage.631": "3"}, - "spectrum": {"Storage.631": ""}, - "yearly": {"Storage.631": ""}, - } - ).to_dict() - - actual_dict = dss.utils.class_to_dataframe("Storage").to_dict() - assert_dict_equal(actual_dict, expected_dict) - - # New version (OpenDSS v9.0+), previsouly Storage2 - dss.Basic.LegacyModels(False) - - assert not dss.Basic.LegacyModels() - - assert ( - dss.utils.run_command("Redirect {}".format(PATH_TO_DSS)) == "" - ), "Unable to find test data" - - dss.run_command("New Storage.631") - - expected_dict = pd.DataFrame( - { - "%Charge": {"Storage.631": "100"}, - "%Discharge": {"Storage.631": "100"}, - "%EffCharge": {"Storage.631": "90"}, - "%EffDischarge": {"Storage.631": "90"}, - "%IdlingkW": {"Storage.631": "1"}, - "%Idlingkvar": {"Storage.631": ""}, - "%R": {"Storage.631": "0"}, - "%X": {"Storage.631": "50"}, - "%reserve": {"Storage.631": "20"}, - "%stored": {"Storage.631": "100"}, - "Balanced": {"Storage.631": "No"}, - "ChargeTrigger": {"Storage.631": "0"}, - "DischargeTrigger": {"Storage.631": "0"}, - "DispMode": {"Storage.631": "default"}, - "DynaDLL": {"Storage.631": ""}, - "DynaData": {"Storage.631": ()}, - "LimitCurrent": {"Storage.631": "No"}, - "State": {"Storage.631": "IDLING"}, - "TimeChargeTrig": {"Storage.631": "2"}, - "UserData": {"Storage.631": ()}, - "UserModel": {"Storage.631": ""}, - "Vmaxpu": {"Storage.631": "1.1"}, - "Vminpu": {"Storage.631": "0.9"}, - "basefreq": {"Storage.631": "60"}, - "bus1": {"Storage.631": "631_1"}, - "class": {"Storage.631": "1"}, - "conn": {"Storage.631": "wye"}, - "daily": {"Storage.631": ""}, - "debugtrace": {"Storage.631": "NO"}, - "duty": {"Storage.631": ""}, - "enabled": {"Storage.631": True}, - "kVA": {"Storage.631": "25"}, - "kW": {"Storage.631": "0"}, - "kWhrated": {"Storage.631": "50"}, - "kWhstored": {"Storage.631": "50"}, - "kWrated": {"Storage.631": "25"}, - "kv": {"Storage.631": "12.47"}, - "kvar": {"Storage.631": "0"}, - "like": {"Storage.631": ""}, - "model": {"Storage.631": "1"}, - "pf": {"Storage.631": "1"}, - "phases": {"Storage.631": "3"}, - "spectrum": {"Storage.631": ""}, - "yearly": {"Storage.631": ""}, - "%Cutin": {"Storage.631": "0"}, - "%Cutout": {"Storage.631": "0"}, - "%PminNoVars": {"Storage.631": "-1"}, - "%PminkvarMax": {"Storage.631": "-1"}, - "%kWrated": {"Storage.631": "100"}, - "EffCurve": {"Storage.631": ""}, - "PFPriority": {"Storage.631": "NO"}, - "VarFollowInverter": {"Storage.631": "No"}, - "WattPriority": {"Storage.631": "NO"}, - "kvarMax": {"Storage.631": "25"}, - "kvarMaxAbs": {"Storage.631": "25"}, - } - ).to_dict() - - actual_dict = dss.utils.class_to_dataframe("Storage").to_dict() - assert_dict_equal(actual_dict, expected_dict) - - -def test_linegeometry_class_to_dataframe(): - string = """Clear - - New Circuit.test_circuit - - New Wiredata.ACSR336 GMR=0.0255000 DIAM=0.7410000 RAC=0.3060000 NormAmps=530.0000 Runits=mi radunits=in gmrunits=ft - New Wiredata.ACSR1/0 GMR=0.0044600 DIAM=0.3980000 RAC=1.120000 NormAmps=230.0000 Runits=mi radunits=in gmrunits=ft - - - New Linegeometry.HC2_336_1neut_0Mess nconds=4 nphases=3 - ~ cond=1 Wire=acsr336 x=-1.2909 h=13.716 units=m - ~ cond=2 Wire=acsr336 x=-0.1530096 h=4.1806368 units=ft - ~ cond=3 Wire=acsr336 x=0.5737 h=13.716 units=m - ~ cond=4 Wire= ACSR1/0 x=0 h=14.648 ! units=m ! neutral - - New Line.Line1 Bus1=bus1.1.2.3 Bus2=bus2.1.2.3 - ~ Geometry= HC2_336_1neut_0Mess - ~ Length=300 units=ft - - Set Voltagebases=[4.8,34.5,115.0] - Calcvoltagebases - Solve""" - - import opendssdirect as dss - - dss.run_command(string).strip() - is_pandas_installed = dss.utils.is_pandas_installed - dss.utils.is_pandas_installed = False - data = dss.utils.class_to_dataframe("linegeometry") - dss.utils.is_pandas_installed = is_pandas_installed - - assert data == { - "linegeometry.hc2_336_1neut_0mess": { - "Seasons": "1", - "Ratings": ["0"], - "LineType": "ug", - "nconds": "4", - "nphases": "3", - "cond": "4", - "wire": "ACSR1/0", - "x": [-1.2909, -0.1530096, 0.5737, 0.0], - "h": [13.716, 4.1806368, 13.716, 14.648], - "units": ["m", "ft", "m", "m"], - "normamps": "0", - "emergamps": "0", - "reduce": "", - "spacing": "", - "wires": ["acsr336 acsr336 acsr336 ACSR1/0"], - "cncable": "ACSR1/0", - "tscable": "ACSR1/0", - "cncables": ["acsr336 acsr336 acsr336 ACSR1/0"], - "tscables": ["acsr336 acsr336 acsr336 ACSR1/0"], - "like": "", - } - } - - -def test_ymatrix(dss): - expected_Y_data = ( - np.array( - [ - (8.178822742754986441e-01 + -4.636999108384913804e00j), - (-1.305502544983652147e-01 + 1.483326906211292595e00j), - (-1.305502544983652424e-01 + 1.483326906211292595e00j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (-1.305502544983652147e-01 + 1.483326906211292595e00j), - (8.178822742754985331e-01 + -4.636999108384913804e00j), - (-1.305502544983652424e-01 + 1.483326906211292595e00j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (-1.305502544983652424e-01 + 1.483326906211292595e00j), - (-1.305502544983652424e-01 + 1.483326906211292595e00j), - (8.178822742754985331e-01 + -4.636999108384912915e00j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (1.890678734891013164e03 + -5.002165990528294060e03j), - (-1.369165023011177027e03 + 1.369165023011177027e03j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (1.890678734891013164e03 + -5.002165990528294060e03j), - (-1.393908969210174291e03 + 1.393908969210174291e03j), - (9.283352668986776024e00 + -7.426682135189420819e01j), - (-9.283352668986776024e00 + 7.426682135189420819e01j), - (1.890678734891013164e03 + -5.002165990528294060e03j), - (-1.369165023011177027e03 + 1.369165023011177027e03j), - (-1.369165023011177027e03 + 1.369165023011177027e03j), - (1.297396000104054792e03 + -1.299551419795600850e03j), - (-4.858442625181529362e-01 + 1.220257867465225354e00j), - (-2.660516357083826944e-01 + 9.121918679463129065e-01j), - (-1.145090744360685031e00 + 3.300510491213570319e00j), - (4.858442625181529362e-01 + -1.220257910306296489e00j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (-1.393908969210174291e03 + 1.393908969210174291e03j), - (-4.858442625181529362e-01 + 1.220257867465225354e00j), - (1.344529401077547845e03 + -1.346654276920105303e03j), - (-1.263013779367583855e-01 + 6.966811885852322028e-01j), - (4.858442625181529362e-01 + -1.220257910306296489e00j), - (-1.002683766536306198e00 + 3.127559664400727968e00j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-1.369165023011177027e03 + 1.369165023011177027e03j), - (-2.660516357083826944e-01 + 9.121918679463129065e-01j), - (-1.263013779367583855e-01 + 6.966811885852322028e-01j), - (1.297137603552365363e03 + -1.299201422392409086e03j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-8.866941926713010069e-01 + 2.950513088021902153e00j), - (6.174482283725819975e00 + -8.242736155055435887e00j), - (-1.495114717049371045e00 + 1.505867938221292279e00j), - (-2.139421481120560742e00 + 1.690070885994096495e00j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (-5.564470386941075652e00 + 7.133623650981868458e00j), - (1.495114717049371045e00 + -1.505867948931560063e00j), - (2.139421481120560742e00 + -1.690070896704364278e00j), - (-1.495114717049371045e00 + 1.505867938221292279e00j), - (5.518419074829100879e00 + -8.172341890231122008e00j), - (-1.087994258962287741e00 + 1.382358902564854608e00j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (1.495114717049371045e00 + -1.505867948931560063e00j), - (-4.908407178044356556e00 + 7.063229386157553691e00j), - (1.087994258962287741e00 + -1.382358913275122392e00j), - (-2.139421481120560742e00 + 1.690070885994096495e00j), - (-1.087994258962287741e00 + 1.382358902564854608e00j), - (5.799073706329775924e00 + -8.194532177879086277e00j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (2.139421481120560742e00 + -1.690070896704364278e00j), - (1.087994258962287741e00 + -1.382358913275122392e00j), - (-5.189061809545031601e00 + 7.085419673805518848e00j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (4.790393247228868745e01 + -8.474029329807029853e01j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (4.738261719384117043e01 + -8.447963565884653292e01j), - (-5.286769772134452872e00 + 9.612308676608098068e00j), - (4.738261719384117043e01 + -8.447963565884653292e01j), - (1.000001122761358321e07 + -1.825368951569347686e01j), - (-1.722884289847009143e00 + 4.284072995171073650e00j), - (-3.361195344943603835e00 + 4.205041811153174436e00j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (-1.718065632949265398e00 + 4.952003737754794521e00j), - (7.289486309349635373e-01 + -1.830844576603596119e00j), - (3.991772478745427843e-01 + -1.368630023686997710e00j), - (-2.290181488721370062e00 + 6.601020982427140638e00j), - (9.716885250363058724e-01 + -2.440515820612592979e00j), - (5.321032714167653888e-01 + -1.824383821574768083e00j), - (-7.174872193248205576e00 + 6.675239762854815240e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-1.722884289847009143e00 + 4.284072995171073650e00j), - (1.000000355426355079e07 + -1.097305701620421559e01j), - (-4.643493315148357059e-01 + 2.451358228738929057e00j), - (7.289486309349635373e-01 + -1.830844576603596119e00j), - (-1.504401750242020164e00 + 4.692512624757282147e00j), - (1.894994417655792851e-01 + -1.045283167931438051e00j), - (9.716885250363058724e-01 + -2.440515820612592979e00j), - (-2.005367533072612396e00 + 6.255119328801455936e00j), - (2.526027558735167711e-01 + -1.393362462852606676e00j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (-3.361195344943603835e00 + 4.205041811153174436e00j), - (-4.643493315148357059e-01 + 2.451358228738929057e00j), - (1.000001037299706973e07 + -1.699808932711195553e01j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (3.991772478745427843e-01 + -1.368630023686997710e00j), - (1.894994417655792851e-01 + -1.045283167931438051e00j), - (-1.330373882477571490e00 + 4.426876351120633046e00j), - (5.321032714167653888e-01 + -1.824383821574768083e00j), - (2.526027558735167711e-01 + -1.393362462852606676e00j), - (-1.773388385342602014e00 + 5.901026176043804305e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-7.224740534769255262e00 + 6.644761767290792598e00j), - (1.158909874451969912e01 + -1.065332013658415633e01j), - (-7.224740534769255262e00 + 6.644761767290792598e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-4.334844320861554579e00 + 3.986857060374475292e00j), - (1.444600615065933624e00 + -5.995892246176102169e-01j), - (-3.852268306842489665e00 + 1.598904581843866080e00j), - (-7.224740534769255262e00 + 6.644761767290792598e00j), - (7.238031030331385729e00 + -6.652389326059439334e00j), - (-2.420958187338686063e00 + 1.006942956693920088e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-2.420958187338686063e00 + 1.006942956693920088e00j), - (7.188162688810336043e00 + -6.682867321623461976e00j), - (-7.174872193248205576e00 + 6.675239762854815240e00j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (1.000001042230609432e07 + -7.845072237930875048e00j), - (-1.090745190943801735e00 + 2.501251464991074869e00j), - (1.080921781180488095e00 + -2.492525965730719939e00j), - (2.428535277137064075e00 + -3.079311097832396094e00j), - (-1.041248268425302825e01 + 7.836353592313674454e00j), - (-2.428535277137064075e00 + 3.079311097832396094e00j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (-1.090745190943801735e00 + 2.501251464991074869e00j), - (1.000001042230609432e07 + -7.845072237930876824e00j), - (-1.041248268425302648e01 + 7.836353592313676231e00j), - (2.428535277137063630e00 + -3.079311097832396982e00j), - (1.080921781180488095e00 + -2.492525965730719939e00j), - (-2.428535277137063630e00 + 3.079311097832396982e00j), - (1.080921781180488095e00 + -2.492525965730719939e00j), - (-1.041248268425302648e01 + 7.836353592313676231e00j), - (1.049668407314191576e01 + -7.834661991793467450e00j), - (-2.428535277137063630e00 + 3.079311097832396982e00j), - (-1.080921781180488095e00 + 2.492525965730719939e00j), - (2.428535277137063630e00 + -3.079311097832396982e00j), - (2.428535277137064075e00 + -3.079311097832396094e00j), - (2.428535277137063630e00 + -3.079311097832396982e00j), - (-2.428535277137063630e00 + 3.079311097832396982e00j), - (1.155823502102252576e01 + -8.172954229715511332e00j), - (-2.428535277137064075e00 + 3.079311097832396094e00j), - (-1.154642946546696969e01 + 8.197215274680164754e00j), - (-1.041248268425302825e01 + 7.836353592313674454e00j), - (1.080921781180488095e00 + -2.492525965730719939e00j), - (-1.080921781180488095e00 + 2.492525965730719939e00j), - (-2.428535277137064075e00 + 3.079311097832396094e00j), - (1.046282990647524969e01 + -7.838481436237909605e00j), - (2.428535277137064075e00 + -3.079311097832396094e00j), - (6.559337128485902113e00 + -6.616251502947750218e00j), - (-6.529823239597012829e00 + 6.619723755158722689e00j), - (4.313194834445097214e00 + -1.652684982082156084e00j), - (-4.290972612222875071e00 + 1.637761166855121964e00j), - (-1.718065632949265398e00 + 4.952003737754794521e00j), - (7.289486309349635373e-01 + -1.830844576603596119e00j), - (3.991772478745427843e-01 + -1.368630023686997710e00j), - (5.154572477192532531e00 + -1.485032283099059214e01j), - (-2.185753016296743123e00 + 5.489788792552021235e00j), - (-1.196933276985134409e00 + 4.103838109143928214e00j), - (-3.433555455354378338e00 + 9.896583182049687011e00j), - (1.456804385361779586e00 + -3.658944258789496473e00j), - (7.977560291105917356e-01 + -2.735208128298001640e00j), - (7.289486309349635373e-01 + -1.830844576603596119e00j), - (-1.504401750242020164e00 + 4.692512624757282147e00j), - (1.894994417655792851e-01 + -1.045283167931438051e00j), - (-2.185753016296743123e00 + 5.489788792552021235e00j), - (4.522408109171475843e00 + -1.407709964525759005e01j), - (-5.682142181876438380e-01 + 3.134282319771936720e00j), - (1.456804385361779586e00 + -3.658944258789496473e00j), - (-3.006548025596122109e00 + 9.377989998203085875e00j), - (3.787147764220645252e-01 + -2.088999194681569804e00j), - (3.991772478745427843e-01 + -1.368630023686997710e00j), - (1.894994417655792851e-01 + -1.045283167931438051e00j), - (-1.330373882477571490e00 + 4.426876351120633046e00j), - (-1.196933276985134409e00 + 4.103838109143928214e00j), - (-5.682142181876438380e-01 + 3.134282319771936720e00j), - (4.009439583890767267e00 + -1.328579741296378813e01j), - (7.977560291105917356e-01 + -2.735208128298001640e00j), - (3.787147764220645252e-01 + -2.088999194681569804e00j), - (-2.658753201413195821e00 + 8.847115706212598241e00j), - (-1.145090744360685031e00 + 3.300510491213570319e00j), - (4.858442625181529362e-01 + -1.220257910306296489e00j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (-5.564470386941075652e00 + 7.133623650981868458e00j), - (1.495114717049371045e00 + -1.505867948931560063e00j), - (2.139421481120560742e00 + -1.690070896704364278e00j), - (-3.433555455354378338e00 + 9.896583182049687011e00j), - (1.456804385361779586e00 + -3.658944258789496473e00j), - (7.977560291105917356e-01 + -2.735208128298001640e00j), - (1.014311658665613791e01 + -2.033071700766388901e01j), - (-3.437763364929303567e00 + 6.385070050188516255e00j), - (-3.203229145939535449e00 + 5.337470867950913522e00j), - (4.858442625181529362e-01 + -1.220257910306296489e00j), - (-1.002683766536306198e00 + 3.127559664400727968e00j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (1.495114717049371045e00 + -1.505867948931560063e00j), - (-4.908407178044356556e00 + 7.063229386157553691e00j), - (1.087994258962287741e00 + -1.382358913275122392e00j), - (-4.334844320861554579e00 + 3.986857060374475292e00j), - (1.456804385361779586e00 + -3.658944258789496473e00j), - (-3.006548025596122109e00 + 9.377989998203085875e00j), - (3.787147764220645252e-01 + -2.088999194681569804e00j), - (-3.437763364929303567e00 + 6.385070050188516255e00j), - (1.325248329103833989e01 + -2.355563574257336157e01j), - (-3.037611028387044332e00 + 4.767628485451501419e00j), - (1.444600615065933624e00 + -5.995892246176102169e-01j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-8.866941926713010069e-01 + 2.950513088021902153e00j), - (2.139421481120560742e00 + -1.690070896704364278e00j), - (1.087994258962287741e00 + -1.382358913275122392e00j), - (-5.189061809545031601e00 + 7.085419673805518848e00j), - (1.444600615065933624e00 + -5.995892246176102169e-01j), - (7.977560291105917356e-01 + -2.735208128298001640e00j), - (3.787147764220645252e-01 + -2.088999194681569804e00j), - (-2.658753201413195821e00 + 8.847115706212598241e00j), - (-3.203229145939535449e00 + 5.337470867950913522e00j), - (-3.037611028387044332e00 + 4.767628485451501419e00j), - (1.303943251957845106e01 + -2.288819195919042215e01j), - (-4.304923315948923523e00 + 4.005143857712888611e00j), - (-2.290181488721370062e00 + 6.601020982427140638e00j), - (9.716885250363058724e-01 + -2.440515820612592979e00j), - (5.321032714167653888e-01 + -1.824383821574768083e00j), - (2.290181488721370062e00 + -6.601020882464641026e00j), - (-9.716885250363058724e-01 + 2.440515799192057411e00j), - (-5.321032714167653888e-01 + 1.824383800154232516e00j), - (9.716885250363058724e-01 + -2.440515820612592979e00j), - (-2.005367533072612396e00 + 6.255119328801455936e00j), - (2.526027558735167711e-01 + -1.393362462852606676e00j), - (-9.716885250363058724e-01 + 2.440515799192057411e00j), - (2.005367533072612396e00 + -6.255119228838956325e00j), - (-2.526027558735167711e-01 + 1.393362441432071108e00j), - (5.321032714167653888e-01 + -1.824383821574768083e00j), - (2.526027558735167711e-01 + -1.393362462852606676e00j), - (-1.773388385342602014e00 + 5.901026176043804305e00j), - (-5.321032714167653888e-01 + 1.824383800154232516e00j), - (-2.526027558735167711e-01 + 1.393362441432071108e00j), - (1.773388385342602014e00 + -5.901026076081304694e00j), - (-3.852268306842489665e00 + 1.598904581843866080e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-7.174872193248205576e00 + 6.675239762854815240e00j), - (1.444600615065933624e00 + -5.995892246176102169e-01j), - (-4.304923315948923523e00 + 4.005143857712888611e00j), - (1.147979550919712821e01 + -1.068038354059770434e01j), - (-1.000000000000000000e07 + 0.000000000000000000e00j), - (-2.428535277137064075e00 + 3.079311097832396094e00j), - (-2.428535277137063630e00 + 3.079311097832396982e00j), - (2.428535277137063630e00 + -3.079311097832396982e00j), - (-1.154642946546696969e01 + 8.197215274680164754e00j), - (2.428535277137064075e00 + -3.079311097832396094e00j), - (1.000001154642946459e07 + -8.197208421037009529e00j), - (-7.174872193248205576e00 + 6.675239762854815240e00j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-4.290972612222875071e00 + 1.637761166855121964e00j), - (1.146584480547108065e01 + -8.312994159392665949e00j), - (-2.407667691776556040e00 + 9.993153679365236464e-01j), - (2.407667691776556040e00 + -9.993153743626843610e-01j), - (-7.224740534769255262e00 + 6.644761767290792598e00j), - (-6.529823239597012829e00 + 6.619723755158722689e00j), - (-2.407667691776556040e00 + 9.993153679365236464e-01j), - (1.375456377436626809e01 + -1.326448546247201499e01j), - ] - ), - np.array( - [ - 0, - 1, - 2, - 3, - 4, - 0, - 1, - 2, - 4, - 5, - 0, - 1, - 2, - 3, - 5, - 0, - 2, - 3, - 6, - 0, - 1, - 4, - 7, - 1, - 2, - 5, - 8, - 3, - 6, - 7, - 8, - 31, - 32, - 33, - 4, - 6, - 7, - 8, - 31, - 32, - 33, - 5, - 6, - 7, - 8, - 31, - 32, - 33, - 9, - 10, - 11, - 12, - 31, - 32, - 33, - 9, - 10, - 11, - 13, - 31, - 32, - 33, - 9, - 10, - 11, - 14, - 31, - 32, - 33, - 9, - 12, - 10, - 13, - 11, - 14, - 15, - 16, - 17, - 22, - 28, - 29, - 30, - 34, - 35, - 36, - 39, - 40, - 15, - 16, - 17, - 28, - 29, - 30, - 34, - 35, - 36, - 38, - 15, - 16, - 17, - 21, - 28, - 29, - 30, - 34, - 35, - 36, - 39, - 40, - 18, - 19, - 20, - 32, - 33, - 37, - 18, - 19, - 20, - 37, - 18, - 19, - 20, - 37, - 17, - 21, - 22, - 23, - 24, - 25, - 38, - 15, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 26, - 40, - 27, - 39, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 6, - 7, - 8, - 9, - 10, - 11, - 28, - 29, - 30, - 31, - 32, - 33, - 6, - 7, - 8, - 9, - 10, - 11, - 18, - 28, - 29, - 30, - 31, - 32, - 33, - 37, - 6, - 7, - 8, - 9, - 10, - 11, - 18, - 28, - 29, - 30, - 31, - 32, - 33, - 37, - 15, - 16, - 17, - 34, - 35, - 36, - 15, - 16, - 17, - 34, - 35, - 36, - 15, - 16, - 17, - 34, - 35, - 36, - 18, - 19, - 20, - 32, - 33, - 37, - 16, - 21, - 22, - 23, - 24, - 25, - 38, - 15, - 17, - 27, - 39, - 40, - 15, - 17, - 26, - 39, - 40, - ] - ), - np.array( - [ - 0, - 5, - 10, - 15, - 19, - 23, - 27, - 34, - 41, - 48, - 55, - 62, - 69, - 71, - 73, - 75, - 87, - 97, - 109, - 115, - 119, - 123, - 130, - 137, - 143, - 149, - 155, - 157, - 159, - 168, - 177, - 186, - 198, - 212, - 226, - 232, - 238, - 244, - 250, - 257, - 262, - 267, - ] - ), - ) - - expected_V = [ - 0.0, - 0.0, - 57502.68619173075, - 33189.47560805494, - -10.988873472980917, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.562772308761, - -0.46690036196087287, - -1201.2376783493826, - -2079.717511753304, - -1200.3116004255196, - 2080.1419385890968, - 2536.35611735117, - -0.579327415864084, - -1246.25987615131, - -2157.4877126705674, - -1267.5877682936236, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562768, - -1300.0193437263497, - -2096.2844127873727, - -1120.421178320253, - 2128.602432339312, - 273.12043190753747, - -15.653612485262233, - -149.221039676289, - -236.28795869614112, - -124.73842715841113, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569054, - -2109.799268739451, - -1015.4001153916763, - 2083.1115246837244, - -1295.686126445919, - -2078.3661532376227, - -1296.2432698471694, - -2073.1595646062365, - -1121.7870803503151, - 2124.3512160900596, - -1015.4001096022037, - 2083.111507606074, - 2350.0726913632457, - -221.08573234457813, - 2333.493783338756, - -229.76132301856697, - -1347.9836973508538, - -2110.4122812917285, - -1013.9611656277061, - 2078.6439955795977, - -1002.1192290632004, - 2078.7490540767426, - 2332.4226357124753, - -217.315297134126, - 2407.051035303729, - -145.3762181110123, - -1312.3022035419076, - -2102.371437004225, - -1082.9954874709554, - 2116.1047513838107, - 2433.846944169107, - -107.52581738463071, - -1300.7631166862307, - -2101.2693421622234, - -1123.5616047423157, - 2134.1366227595295, - 2350.0727418747815, - -221.08575715699388, - -1338.4058117088837, - -2109.7992962044323, - -1015.4001197194408, - 2083.111559417906, - -1122.3854662972221, - 2129.559591256956, - -1338.4057922959526, - -2109.7992630653534, - 2345.3836609834, - -221.6058883507038, - -1009.562139171098, - 2080.528335732232, - ] - - expected_I = [ - 45.06951001842762, - 24.808808468443384, - 69802.42815021457, - -72191.08720767738, - -97420.52952591189, - -24355.132407117453, - 27618.101397342507, - 96546.21962200984, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -13.83538249862238, - 10.728150694675719, - -8.968242194252525, - -3.416980064483795, - -3.1253287196529413, - -18.472388556181386, - -2.6675923553345626, - 3.832535275459094, - -0.4671256788091469, - -1.9482821746922525, - 3.1347180341437095, - -1.8842531007668413, - -3.3143940171116526, - -1.32120707207174, - 7.105427357601002e-15, - 7.105427357601002e-15, - -7.105427357601002e-15, - -7.105427357601002e-15, - 0.2587373173690999, - -1.0386532600475533, - -0.2587373173690999, - 1.0386532600475533, - -9.012548999300577, - 4.595887907960702, - -3.0888978934500315, - -0.8862753821772245, - -1.9605308838638749, - -10.932799880696791, - 0.028157771758481887, - -3.016045651431398, - 0.0, - 0.0, - 0.06462474225171722, - -0.04346468945275728, - -1.7990183461979612, - -0.9604487876225356, - -0.05797062518124507, - -1.0832442019763704, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - ] - - actual_Y_data = dss.YMatrix.getYsparse() - np.testing.assert_array_almost_equal( - expected_Y_data[0], actual_Y_data[0], decimal=4 - ) - np.testing.assert_array_almost_equal( - expected_Y_data[1], actual_Y_data[1], decimal=4 - ) - np.testing.assert_array_almost_equal( - expected_Y_data[2], actual_Y_data[2], decimal=4 - ) - np.testing.assert_array_almost_equal(expected_V, dss.YMatrix.getV(), decimal=4) - np.testing.assert_array_almost_equal(expected_I, dss.YMatrix.getI(), decimal=4) - - -def test_wiredata_class_to_dataframe(): - commands = """Clear - - New Circuit.test_circuit - - New Wiredata.ACSR336 GMR=0.0255000 DIAM=0.7410000 RAC=0.3060000 NormAmps=530.0000 Runits=mi radunits=in gmrunits=ft - New Wiredata.ACSR1/0 GMR=0.0044600 DIAM=0.3980000 RAC=1.120000 NormAmps=230.0000 Runits=mi radunits=in gmrunits=ft - - - New Linegeometry.HC2_336_1neut_0Mess nconds=4 nphases=3 - ~ cond=1 Wire=acsr336 x=-1.2909 h=13.716 units=m - ~ cond=2 Wire=acsr336 x=-0.1530096 h=4.1806368 units=ft - ~ cond=3 Wire=acsr336 x=0.5737 h=13.716 units=m - ~ cond=4 Wire= ACSR1/0 x=0 h=14.648 ! units=m ! neutral - - New Line.Line1 Bus1=bus1.1.2.3 Bus2=bus2.1.2.3 - ~ Geometry= HC2_336_1neut_0Mess - ~ Length=300 units=ft - - Set Voltagebases=[4.8,34.5,115.0] - Calcvoltagebases - Solve""" - - import opendssdirect as dss - - dss.run_command(commands) - is_pandas_installed = dss.utils.is_pandas_installed - dss.utils.is_pandas_installed = False - data = dss.utils.class_to_dataframe("wiredata") - dss.utils.is_pandas_installed = is_pandas_installed - - assert data == { - "wiredata.acsr1/0": { - "Capradius": "0.199", - "Seasons": "1", - "Ratings": ["-1"], - "GMRac": "0.00446", - "GMRunits": "ft", - "Rac": "1.12", - "Rdc": "1.09804", - "Runits": "mi", - "diam": "0.398", - "emergamps": "345", - "like": "", - "normamps": "230", - "radius": "0.199", - "radunits": "in", - }, - "wiredata.acsr336": { - "Capradius": "0.3705", - "Seasons": "1", - "Ratings": ["-1"], - "GMRac": "0.0255", - "GMRunits": "ft", - "Rac": "0.306", - "Rdc": "0.3", - "Runits": "mi", - "diam": "0.741", - "emergamps": "795", - "like": "", - "normamps": "530", - "radius": "0.3705", - "radunits": "in", - }, - } - - -def test_long_path(): - - import opendssdirect as dss - import tempfile, shutil - import warnings - - long_name = "-".join(["40242748-21fd-4a61-8ad9-cefdd3ff6a05"] * 6) - original_working_dir = os.getcwd() - try: - # TODO: use tempfile.TemporaryDirectory when Python 2.7 is dropped - tmp_dir_path = tempfile.mkdtemp() - inner_dir_path = os.path.join(tmp_dir_path, long_name) - os.mkdir(inner_dir_path) - long_file_path = os.path.join(inner_dir_path, long_name + ".dss") - - with open(long_file_path, "w") as f: - f.write("clear\nnew circuit.test\n") - - # Try running with the full path - dss.run_command("redirect '{}'".format(long_file_path)) - - # Then try going to the folder and using only the filename - os.chdir(inner_dir_path) - dss.run_command("redirect '{}'".format(long_name + ".dss")) - except (IOError, OSError): # FileNotFoundError: - warnings.warn( - "Could not create a file with a long path in Python. Skipping test." - ) - finally: - os.chdir(original_working_dir) - if os.path.exists(tmp_dir_path): - shutil.rmtree(tmp_dir_path) From 4d0b0460b93403197fed711cd0cb1fcbbcadb783 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Tue, 1 Mar 2022 18:41:58 -0300 Subject: [PATCH 3/9] tests: Update values resulting from changes in miles to meters precision in OpenDSS. --- tests/test_opendssdirect.py | 4038 ++++++++++++++++------------------- 1 file changed, 1806 insertions(+), 2232 deletions(-) diff --git a/tests/test_opendssdirect.py b/tests/test_opendssdirect.py index d226a55..cb6ecdc 100644 --- a/tests/test_opendssdirect.py +++ b/tests/test_opendssdirect.py @@ -530,217 +530,217 @@ def test_13Node_Circuit(dss): np.testing.assert_array_almost_equal( dss.Circuit.AllBusVMag(), [ - 66393.52536507105, - 66394.86975917802, - 66391.9679007487, - 2401.56281769503, - 2401.707078013379, - 2401.6116303002195, - 2536.356183513064, - 2491.569166053624, - 2536.395967032524, - 2428.9134443983507, - 2466.669542796113, - 2405.4712494206583, - 273.5686493536834, - 279.4618365839277, - 272.26306145992913, - 2360.449250025611, - 2498.5161614343156, - 2317.4104122074677, - 2449.1648383047186, - 2407.2335133239008, - 2445.0433932636856, - 2402.3476732030695, - 2317.410394319708, - 2360.4492275280204, - 2498.516158699491, - 2344.7779217733746, - 2504.1765204055864, - 2312.764169940423, - 2307.6916126474052, - 2342.5245548237963, - 2411.437109142391, - 2478.3265992504193, - 2377.1366272706323, - 2436.220997579146, - 2471.298754509891, - 2411.831213881805, - 2360.449280141501, - 2498.516197081946, - 2317.410445326153, - 2355.829723676905, - 2312.5340794532, + 66393.52539552496, + 66394.86979179642, + 66391.96794809647, + 2401.562819706807, + 2401.7070791741353, + 2401.611632421512, + 2536.356186390269, + 2491.569167533136, + 2536.3959701204935, + 2428.916823657129, + 2466.6701721813, + 2405.475341545256, + 273.56904917876017, + 279.46191055063275, + 272.26354300042595, + 2360.4547243616744, + 2498.5158328915445, + 2317.417277288994, + 2449.1659503353567, + 2407.237532618285, + 2445.0446146882787, + 2402.351820088669, + 2317.4172594012716, + 2360.4547018641397, + 2498.51583015672, + 2344.783889705437, + 2504.1760259677267, + 2312.771190032886, + 2307.6987616644665, + 2342.53046877393, + 2411.4410522318617, + 2478.3268829140106, + 2377.1416224123977, + 2436.2241662817532, + 2471.299259609313, + 2411.835119182976, + 2360.454754475996, + 2498.5158685371925, + 2317.4173104059755, + 2355.8353074279407, + 2312.5410863842267, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.Circuit.AllBusVolts(), [ - 57502.68619173074, - 33189.47560805491, - -10.988873472977797, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493821, - -2079.717511753303, - -1200.3116004255198, - 2080.1419385890968, - 2536.35611735117, - -0.5793274158644572, - -1246.2598761513093, - -2157.487712670567, - -1267.587768293624, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562823, - -1300.0193437263497, - -2096.284412787372, - -1120.4211783202531, - 2128.6024323393126, - 273.12043190753747, - -15.65361248526227, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - -1295.6861264459185, - -2078.366153237622, - -1122.3854662972226, - 2129.5595912569565, - -1296.2432698471687, - -2073.159564606236, - -1121.7870803503154, - 2124.35121609006, - -1015.4001096022041, - 2083.111507606075, - 2350.0726913632457, - -221.08573234457813, - -1338.4057922959519, - -2109.7992630653525, - 2333.4937833387567, - -229.76132301856717, - -1347.983697350853, - -2110.4122812917276, - -1013.9611656277061, - 2078.643995579598, - -1002.1192290632007, - 2078.749054076744, - 2332.4226357124753, - -217.315297134126, - 2407.0510353037284, - -145.37621811101252, - -1312.3022035419074, - -2102.3714370042235, - -1082.9954874709558, - 2116.1047513838116, - 2433.8469441691063, - -107.52581738463108, - -1300.7631166862307, - -2101.2693421622225, - -1123.561604742316, - 2134.13662275953, - 2350.07274187478, - -221.085757156994, - -1338.405811708883, - -2109.799296204432, - -1015.4001197194411, - 2083.111559417907, - 2345.3836609834, - -221.6058883507038, - -1009.5621391710984, - 2080.528335732233, + 57502.68622482564, + 33189.47561163729, + -10.988868660972098, + -66394.86888242468, + -57491.697356164674, + 33205.39328374589, + 2401.562774320432, + -0.46690091155609226, + -1201.2376790663666, + -2079.7175126796437, + -1200.3116016198273, + 2080.1419403490627, + 2536.356120228099, + -0.5793286234950956, + -1246.2598772664523, + -2157.4877137350218, + -1267.5877694598496, + 2196.935539327288, + 2426.426283208282, + -109.96557825373475, + -1300.0178453618112, + -2096.2860825922016, + -1120.4252829545615, + 2128.6048961933866, + 273.1208520924334, + -15.653268696155022, + -149.22087189563985, + -236.28815213487727, + -124.73890495654813, + 242.00752558006548, + 2350.0787848280174, + -221.0796482325268, + -1338.403130602016, + -2109.8005657418075, + -1015.4071554561624, + 2083.115730276635, + -1295.6847720988385, + -2078.36830798424, + -1122.389508981748, + 2129.5620039280097, + -1296.2419078314422, + -2073.161856729391, + -1121.791131783235, + 2124.3537662394715, + -1015.4071496666254, + 2083.115713199053, + 2350.078762918045, + -221.07964093085445, + -1338.4031344410685, + -2109.8005600677157, + 2333.5003985622425, + -229.7550420165232, + -1347.980749354996, + -2110.413577571908, + -1013.968224484203, + 2078.6483630432745, + -1002.1266180672616, + 2078.753428367296, + 2332.4291296649067, + -217.30934684181196, + 2407.055227539434, + -145.37221180195166, + -1312.3003350597062, + -2102.372937700745, + -1083.0006449663492, + 2116.1077231577597, + 2433.850246648693, + -107.5228592594183, + -1300.761594930117, + -2101.270878230695, + -1123.5656240409862, + 2134.1389201731336, + 2350.078813428112, + -221.07966574213293, + -1338.4031538526608, + -2109.8005932052947, + -1015.4071597837608, + 2083.1157650090267, + 2345.3898452775716, + -221.5997955616163, + -1009.5693326805173, + 2080.5326334201427 ], decimal=4, ) np.testing.assert_array_almost_equal( dss.Circuit.AllElementLosses(), [ - -3567.2130572232213, - -1736.5876246039768, - 0.032287911406718196, - 0.26246956013666933, - 0.12209431781549938, - 0.12385874599497766, + -3567.2118131482466, + -1736.5765097263468, + 0.032287805258994925, + 0.26246873644273727, + 0.12209388323919848, + 0.12385831108468119, 0.0, 0.0, - 0.06534584204095882, - 0.06707780466409168, + 0.06534575459547341, + 0.06707771651400253, 0.0, 0.0, - 0.13508999156020582, - 0.13685448115179316, + 0.13508947523473763, + 0.13685396666557062, 0.0, 0.0, - 5.552672495756633, - 10.09627127053823, - 1155.0138985144563, - 660.0382388082895, - 160.00037793084016, - 110.00734287426086, - 119.99921548166647, - 89.99779375162575, - 120.00422637632467, - 90.00659856144686, - 169.99904036264297, - 124.99723388403005, - 234.56736460810578, - 134.62641475903627, - 166.67363250258813, - 148.05286127890344, - 485.00362643749804, - 190.02832412730436, - 67.99940565100636, - 59.998096116691535, - 290.0145551032838, - 212.02259924297505, - 163.45924282632623, - 76.92782718009413, - 121.9362083812026, - 81.93411617144581, - 16.999947149386877, - 10.00069897109282, - 65.99949886980545, - 37.99886583778652, - 117.00423409948664, - 68.00542640529191, - 0.0, - -593.4874833653861, - 0.0, - -92.45556560908302, - 60.737637029950974, - 196.01567705773493, - 12.990632827557624, - 41.49451007814577, - 22.728759388257167, - 72.3341461004547, - 1.3970495798327352e-11, - -0.004169230139508104, - 0.8244872480827762, - 1.0561418762530956, - 2.7673617080022814, - 2.4007733405815963, - 0.5274850329600449, - 0.4197458963507816, - 4.162956819155021, - 2.419341544324343, - 0.5794873845105758, - 0.47068039939882145, - 0.3824044325920986, - 0.3873491768157692, - 0.7998259198180458, - 0.23087894134466477, - 9.054620692040771e-06, - 2.9103830456733704e-14, + 5.552658784485829, + 10.096246342088037, + 1155.0138982861056, + 660.0382376763037, + 160.00037738764146, + 110.00734172751001, + 119.9992158606513, + 89.99779381448772, + 120.00422631732324, + 90.00659913976898, + 169.99904086275643, + 124.99723393693857, + 234.5678795827955, + 134.62671049947627, + 166.67403146247804, + 148.05321488529017, + 485.00362356791345, + 190.0283200695573, + 67.99940602340334, + 59.998096141950576, + 290.01455466662827, + 212.02260131243509, + 163.45974879842822, + 76.92806636588504, + 121.93682536877428, + 81.93452983101116, + 16.999947095957083, + 10.000698861826827, + 65.99949909005798, + 37.99886582656774, + 117.00423402328065, + 68.00542694061349, + 3.637978807091713e-15, + -593.4894936633161, + -7.275957614183426e-15, + -92.45613844770335, + 60.73577186508966, + 196.0096471850517, + 12.99022667714674, + 41.493211844628966, + 22.728048743806546, + 72.33188446746446, + 5.234676238908984e-12, + -0.004169129951053901, + 0.8244626383214345, + 1.0561103481200407, + 2.767287477929902, + 2.4007086567327933, + 0.5274717697917658, + 0.4197353422563319, + 4.162818220041052, + 2.419260565770499, + 0.5794728640665707, + 0.4706685197881088, + 0.3823941052403825, + 0.3873387140735213, + 0.7998080968317226, + 0.23087380865922022, + 9.054574940819293e-06, + 0.0 ], decimal=4, ) @@ -877,11 +877,12 @@ def test_13Node_Circuit(dss): assert dss.Circuit.FirstElement() == 1 assert dss.Circuit.FirstPCElement() == 1 assert dss.Circuit.FirstPDElement() == 1 + np.testing.assert_array_almost_equal( - dss.Circuit.LineLosses(), [106.50104684552127, 317.225075181265], decimal=4 + dss.Circuit.LineLosses(), [106.49777151284596, 317.2152703225946], decimal=4 ) np.testing.assert_array_almost_equal( - dss.Circuit.Losses(), [112408.53740410128, 327911.6070437507], decimal=4 + dss.Circuit.Losses(), [112405.24721566019, 327901.77539538965], decimal=4 ) assert dss.Circuit.Name() == u"ieee13nodeckt" assert dss.Circuit.NextElement() == 2 @@ -908,20 +909,20 @@ def test_13Node_Circuit(dss): assert dss.Circuit.SetActiveElement("") == -1 assert dss.Circuit.SubstationLosses() == [0.0, 0.0] + np.testing.assert_array_almost_equal( - dss.Circuit.TotalPower(), [-3567.2130572232213, -1736.5876246039768], decimal=4 + dss.Circuit.TotalPower(), [-3567.2118131482466, -1736.5765097263468], decimal=4 ) assert dss.Circuit.UpdateStorage() is None np.testing.assert_array_almost_equal( dss.Circuit.YCurrents(), [ - 69802.42815021456, - -72191.08720767737, - -97420.52952591189, - -24355.132407117453, - 27618.101397342507, - 96546.21962200984, - 0.0, + 69802.42815021734, + -72191.08720768025, + -97420.52952591579, + -24355.13240711842, + 27618.10139734361, + 96546.21962201368, 0.0, 0.0, 0.0, @@ -939,44 +940,45 @@ def test_13Node_Circuit(dss): 0.0, 0.0, 0.0, - -13.83538249862238, - 10.728150694675776, - -8.968242194252298, - -3.4169800644837665, - -3.1253287196529556, - -18.472388556181272, - -2.6675923553346195, - 3.8325352754590796, - -0.46712567880906164, - -1.9482821746922383, - 3.134718034143681, - -1.8842531007668413, - -3.314394017111624, - -1.3212070720717186, 0.0, + -13.833771377298945, + 10.726871597152865, + -8.968504770843197, + -3.417089130031627, + -3.12498992294411, + -18.470505046170956, + -2.667048628795584, + 3.832056283537952, + -0.46758569533298555, + -1.9484679417918613, + 3.1346343241285695, + -1.8835883417461048, + -3.31446662403701, + -1.321239610087268, -7.105427357601002e-15, 0.0, 7.105427357601002e-15, - 0.25873731736910166, - -1.0386532600475462, - -0.25873731736910166, - 1.0386532600475462, - -9.01254899930052, - 4.595887907960673, - -3.08889789345001, - -0.8862753821772227, - -1.9605308838638678, - -10.932799880696848, - 0.028157771758488992, - -3.0160456514314262, 0.0, + 0.25870863043271797, + -1.0385283598223651, + -0.25870863043271797, + 1.0385283598223651, + -9.011574972517224, + 4.59535774077078, + -3.0888821721242508, + -0.8862751281506647, + -1.9603496363737634, + -10.9319093354963, + 0.028161796268869943, + -3.0158125881806797, 0.0, - 0.06462474225171988, - -0.04346468945275905, - -1.799018346197947, - -0.9604487876225267, - -0.05797062518124818, - -1.0832442019763846, + 0.0, + 0.06464719014600195, + -0.04347962137929162, + -1.7990236975013012, + -0.9604538679363639, + -0.05795649932674607, + -1.0830078082714039, 0.0, 0.0, 0.0, @@ -1043,91 +1045,92 @@ def test_13Node_Circuit(dss): u"684.1", u"684.3", ] + np.testing.assert_array_almost_equal( dss.Circuit.YNodeVArray(), [ - 57502.68619173074, - 33189.47560805491, - -10.988873472977797, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493821, - -2079.717511753303, - -1200.3116004255198, - 2080.1419385890968, - 2536.35611735117, - -0.5793274158644572, - -1246.2598761513093, - -2157.487712670567, - -1267.587768293624, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562823, - -1300.0193437263497, - -2096.284412787372, - -1120.4211783202531, - 2128.6024323393126, - 273.12043190753747, - -15.65361248526227, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - -1295.6861264459185, - -2078.366153237622, - -1296.2432698471687, - -2073.159564606236, - -1121.7870803503154, - 2124.35121609006, - -1015.4001096022041, - 2083.111507606075, - 2350.0726913632457, - -221.08573234457813, - 2333.4937833387567, - -229.76132301856717, - -1347.983697350853, - -2110.4122812917276, - -1013.9611656277061, - 2078.643995579598, - -1002.1192290632007, - 2078.749054076744, - 2332.4226357124753, - -217.315297134126, - 2407.0510353037284, - -145.37621811101252, - -1312.3022035419074, - -2102.3714370042235, - -1082.9954874709558, - 2116.1047513838116, - 2433.8469441691063, - -107.52581738463108, - -1300.7631166862307, - -2101.2693421622225, - -1123.561604742316, - 2134.13662275953, - 2350.07274187478, - -221.085757156994, - -1338.405811708883, - -2109.799296204432, - -1015.4001197194411, - 2083.111559417907, - -1122.3854662972226, - 2129.5595912569565, - -1338.4057922959519, - -2109.7992630653525, - 2345.3836609834, - -221.6058883507038, - -1009.5621391710984, - 2080.528335732233, + 57502.68622482564, + 33189.47561163729, + -10.988868660972098, + -66394.86888242468, + -57491.697356164674, + 33205.39328374589, + 2401.562774320432, + -0.46690091155609226, + -1201.2376790663666, + -2079.7175126796437, + -1200.3116016198273, + 2080.1419403490627, + 2536.356120228099, + -0.5793286234950956, + -1246.2598772664523, + -2157.4877137350218, + -1267.5877694598496, + 2196.935539327288, + 2426.426283208282, + -109.96557825373475, + -1300.0178453618112, + -2096.2860825922016, + -1120.4252829545615, + 2128.6048961933866, + 273.1208520924334, + -15.653268696155022, + -149.22087189563985, + -236.28815213487727, + -124.73890495654813, + 242.00752558006548, + 2350.0787848280174, + -221.0796482325268, + -1338.403130602016, + -2109.8005657418075, + -1015.4071554561624, + 2083.115730276635, + -1295.6847720988385, + -2078.36830798424, + -1296.2419078314422, + -2073.161856729391, + -1121.791131783235, + 2124.3537662394715, + -1015.4071496666254, + 2083.115713199053, + 2350.078762918045, + -221.07964093085445, + 2333.5003985622425, + -229.7550420165232, + -1347.980749354996, + -2110.413577571908, + -1013.968224484203, + 2078.6483630432745, + -1002.1266180672616, + 2078.753428367296, + 2332.4291296649067, + -217.30934684181196, + 2407.055227539434, + -145.37221180195166, + -1312.3003350597062, + -2102.372937700745, + -1083.0006449663492, + 2116.1077231577597, + 2433.850246648693, + -107.5228592594183, + -1300.761594930117, + -2101.270878230695, + -1123.5656240409862, + 2134.1389201731336, + 2350.078813428112, + -221.07966574213293, + -1338.4031538526608, + -2109.8005932052947, + -1015.4071597837608, + 2083.1157650090267, + -1122.389508981748, + 2129.5620039280097, + -1338.4031344410685, + -2109.8005600677157, + 2345.3898452775716, + -221.5997955616163, + -1009.5693326805173, + 2080.5326334201427, ], decimal=4, ) @@ -1182,75 +1185,77 @@ def test_13Node_CktElement(dss): assert dss.CktElement.IsOpen(1, 0) assert dss.CktElement.Close(1, 0) is None assert not dss.CktElement.IsOpen(1, 0) + np.testing.assert_array_almost_equal( dss.CktElement.CplxSeqCurrents(), [ - 66.53192583719891, - 13.672570546468101, - 141.96269129938753, - -15.550054378231998, - 10.605415669810057, - -71.1403384338611, - -66.53192583719891, - -13.672570546468101, - -141.96269129938753, - 15.550054378231998, - -10.605415669810057, - 71.1403384338611, + 66.53162574768066, + 13.672725677490234, + 141.9624731550164, + -15.549381131404303, + 10.605624913220915, + -71.14006817889842, + -66.53162574768066, + -13.672725677490234, + -141.9624731550164, + 15.549381131404303, + -10.605624913220915, + 71.14006817889842, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.CplxSeqVoltages(), [ - -1.2443968584439062, - -82.59116123402828, - 2386.047643797686, - -162.49099543761832, - -34.73053366599282, - 23.996417025286178, - -1.244403511636449, - -82.59116260128519, - 2386.0476296014167, - -162.49099388261294, - -34.730534726534245, - 23.99642413931997, + -1.2438337433870856, + -82.58816123256645, + 2386.0519853836104, + -162.48665009879235, + -34.729366812206194, + 23.99516309883188, + -1.243840396549615, + -82.58816259983894, + 2386.051971187363, + -162.4866485438543, + -34.72936787276865, + 23.99517021283873, ], decimal=4, ) + np.testing.assert_array_almost_equal( dss.CktElement.Currents(), [ - 219.10003280639648, - -73.017822265625, - 38.39047050476074, - -56.740970611572266, - -57.89472579956055, - 170.77650451660156, - -219.10003280639648, - 73.017822265625, - -38.39047050476074, - 56.740970611572266, - 57.89472579956055, - -170.77650451660156, + 219.09972381591797, + -73.0167236328125, + 38.39052391052246, + -56.74091720581055, + -57.89537048339844, + 170.77581787109375, + -219.09972381591797, + 73.0167236328125, + -38.39052391052246, + 56.74091720581055, + 57.89537048339844, + -170.77581787109375, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.CurrentsMagAng(), [ - 230.9468050096784, - -18.431295569374065, - 68.50814529324387, - -55.91804381551418, - 180.32308163492308, - 108.72710746089945, - 230.9468050096784, - 161.56870442095442, - 68.50814529324387, - 124.08195617481427, - 180.32308163492308, - -71.27289252942901, + 230.9461645195305, + -18.431061226098382, + 68.50813098808815, + -55.91798179283929, + 180.32263832628155, + 108.72737150582326, + 230.9461645195305, + 161.56893876423007, + 68.50813098808815, + 124.08201819748916, + 180.32263832628155, + -71.2726284845052, ], decimal=4, ) @@ -1265,14 +1270,14 @@ def test_13Node_CktElement(dss): assert dss.CktElement.HasVoltControl() == 0 np.testing.assert_almost_equal( dss.CktElement.Losses(), - [0.00905452249571681, -1.4551915228366852e-11], + [0.009054574940819293, 0.0], decimal=4, ) assert dss.CktElement.Name() == u"Line.671692" assert dss.CktElement.NodeOrder() == [1, 2, 3, 1, 2, 3] np.testing.assert_almost_equal( dss.CktElement.TotalPowers(), - [1013.9070515856262, 19.023976609590814, -1013.9070425310053, -19.023976609590783], + [1013.9073121262952, 19.02222347205106, -1013.9073030717203, -19.02222347205106], decimal=5, ) assert dss.CktElement.NormalAmps() == 400.0 @@ -1286,11 +1291,11 @@ def test_13Node_CktElement(dss): np.testing.assert_array_almost_equal( dss.CktElement.PhaseLosses(), [ - 5.3332970710471275e-06, - 1.4551915228366852e-14, - 4.693326191045344e-07, + 5.333613138645887e-06, + 2.9103830456733704e-14, + 4.6933640260249376e-07, 0.0, - 3.2518928055651486e-06, + 3.251625457778573e-06, -2.9103830456733704e-14, ], decimal=4, @@ -1298,65 +1303,65 @@ def test_13Node_CktElement(dss): np.testing.assert_array_almost_equal( dss.CktElement.Powers(), [ - 531.0442078185483, - 123.15729887953721, - 68.33003035870593, - -156.93863010669907, - 414.5328159611783, - 52.80531186087565, - -531.0442024849057, - -123.15729887953721, - -68.33002988936931, - 156.93863010669907, - -414.53281270953687, - -52.80531186087562, + 531.0441242773005, + 123.15656327805627, + 68.33002183423334, + -156.9385702870313, + 414.5331660147614, + 52.80423048102608, + -531.0441189436874, + -123.15656327805624, + -68.33002136489694, + 156.9385702870313, + -414.5331627631359, + -52.80423048102611, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.Residuals(), - [203.766844870779, 11.612830692170245, 203.766844870779, -168.38716929815823], + [203.7660567138995, 11.613009831248048, 203.7660567138995, -168.3869901590804], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.SeqCurrents(), [ - 67.92228162359304, - 142.8117989247778, - 71.92650828459385, - 67.92228162359304, - 142.8117989247778, - 71.92650828459385, + 67.92201890463316, + 142.811508772432, + 71.92627183650107, + 67.92201890463316, + 142.811508772432, + 71.92627183650107, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.SeqPowers(), [ - -3.6360767939550196, - -16.43380473058689, - 1023.7694666913296, - 42.10653475759665, - -6.226334923023335, - -6.648749825544208, - 3.6360781779859073, - 16.43380473058686, - -1023.7694605727667, - -42.10653475759662, - 6.226336475050096, - 6.648749825544179, + -3.6358786615457435, + -16.433154110257448, + 1023.7692233179367, + 42.10387505212601, + -6.226032530095827, + -6.6484974698176496, + 3.635880045565927, + 16.433154110257433, + -1023.7692171993988, + -42.10387505212598, + 6.226034082112406, + 6.648497469817642, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.SeqVoltages(), [ - 82.60053533438243, - 2391.57410131294, - 42.214191911916366, - 82.60053680171639, - 2391.5740870438235, - 42.21419682837919, + 82.59752719154237, + 2391.5781376349373, + 42.212519130185925, + 82.59752865884985, + 2391.5781233658486, + 42.21252404660491, ], decimal=4, ) @@ -1376,36 +1381,36 @@ def test_13Node_CktElement(dss): np.testing.assert_array_almost_equal( dss.CktElement.Voltages(), [ - 2350.072713273249, - -221.08573964636037, - -1338.4057884569047, - -2109.79926873945, - -1015.4001153916768, - 2083.1115246837253, - 2350.0726913632457, - -221.08573234457813, - -1338.4057922959519, - -2109.7992630653525, - -1015.4001096022041, - 2083.111507606075, + 2350.0787848280174, + -221.0796482325268, + -1338.403130602016, + -2109.8005657418075, + -1015.4071554561624, + 2083.115730276635, + 2350.078762918045, + -221.07964093085445, + -1338.4031344410685, + -2109.8005600677157, + -1015.4071496666254, + 2083.115713199053, ], decimal=4, ) np.testing.assert_array_almost_equal( dss.CktElement.VoltagesMagAng(), [ - 2360.449250025611, - -5.3743473971090765, - 2498.5161614343156, - -122.39005677200043, - 2317.4104122074677, - 115.9866388766925, - 2360.4492275280204, - -5.3743472704625, - 2498.516158699491, - -122.39005691604211, - 2317.410394319708, - 115.98663893302955, + 2360.4547243616744, + -5.374186385394941, + 2498.5158328915445, + -122.38998937216338, + 2317.417277288994, + 115.98674977755289, + 2360.4547018641397, + -5.374186258749708, + 2498.51583015672, + -122.38998951620502, + 2317.4172594012716, + 115.98674983388848, ], decimal=4, ) @@ -1727,112 +1732,113 @@ def test_13Node_Lines(dss): assert dss.Lines.Spacing() == u"" assert dss.Lines.Units() == 5 assert dss.Lines.Xg() == 0.155081 + np.testing.assert_array_almost_equal(dss.Lines.Yprim(), [ - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, + 3.4336493324686748, + -9.89685369864876, + -1.4568442159669834, + 3.659044283989984, + -0.7977778406219831, + 2.7352828975550736, + -3.4336493324686748, + 9.896853765321925, + 1.4568442159669834, + -3.6590442982770908, + 0.7977778406219831, + -2.73528291184218, + -1.4568442159669834, + 3.659044283989984, + 3.0066302278661308, + -9.378246335904445, + -0.3787251308930535, + 2.089056295888508, + 1.4568442159669834, + -3.6590442982770908, + -3.0066302278661308, + 9.37824640257761, + 0.3787251308930535, + -2.0890563101756148, + -0.7977778406219831, + 2.7352828975550736, + -0.3787251308930535, + 2.089056295888508, + 2.6588258945971046, + -8.847357529237488, + 0.7977778406219831, + -2.73528291184218, + 0.3787251308930535, + -2.0890563101756148, + -2.6588258945971046, + 8.847357595910653, + -3.4336493324686748, + 9.896853765321925, + 1.4568442159669834, + -3.6590442982770908, + 0.7977778406219831, + -2.73528291184218, + 3.4336493324686748, + -9.89685369864876, + -1.4568442159669834, + 3.659044283989984, + -0.7977778406219831, + 2.7352828975550736, + 1.4568442159669834, + -3.6590442982770908, + -3.0066302278661308, + 9.37824640257761, + 0.3787251308930535, + -2.0890563101756148, + -1.4568442159669834, + 3.659044283989984, + 3.0066302278661308, + -9.378246335904445, + -0.3787251308930535, + 2.089056295888508, + 0.7977778406219831, + -2.73528291184218, + 0.3787251308930535, + -2.0890563101756148, + -2.6588258945971046, + 8.847357595910653, + -0.7977778406219831, + 2.7352828975550736, + -0.3787251308930535, + 2.089056295888508, + 2.6588258945971046, + -8.847357529237488 ]) with pt.raises(dss.DSSException): # This is not allowed at the moment (the value is/was ignored before) # so an exception was added in case someone was trying to use it dss.Lines.Yprim(dss.Lines.Yprim()) - assert dss.Lines.R0() == 3.378880258497484e-05 - assert dss.Lines.X0() == 7.664982290436836e-05 + assert dss.Lines.R0() == 3.378787878787879e-05 + assert dss.Lines.X0() == 7.664772727272727e-05 assert dss.Lines.RMatrix() == [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, + 6.5625e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 6.392045454545455e-05, + 2.9071969696969698e-05, + 2.9924242424242424e-05, + 2.9071969696969698e-05, + 6.46590909090909e-05, ] assert dss.Lines.XMatrix() == [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, + 0.00019278409090909093, + 9.50189393939394e-05, + 8.022727272727272e-05, + 9.50189393939394e-05, + 0.0001984469696969697, + 7.289772727272727e-05, + 8.022727272727272e-05, + 7.289772727272727e-05, + 0.00019598484848484847, ] - assert dss.Lines.R1() == 1.0985148822469399e-05 - assert dss.Lines.X1() == 2.2841533586031195e-05 + assert dss.Lines.R1() == 1.0984848484848486e-05 + assert dss.Lines.X1() == 2.284090909090909e-05 def test_13Node_Loads(dss): @@ -2465,121 +2471,121 @@ def test_lines_to_dataframe(dss): "692675": "675.1.2.3", }, "C0": { - "632633": 0.00030303858820605233, - "632645": 0.00030303858820605233, - "632670": 0.00030303858820605233, - "645646": 0.00030303858820605233, - "650632": 0.00030303858820605233, - "670671": 0.00030303858820605233, - "671680": 0.00030303858820605233, - "671684": 0.00030303858820605233, + "632633": 0.0003030303030303031, + "632645": 0.0003030303030303031, + "632670": 0.0003030303030303031, + "645646": 0.0003030303030303031, + "650632": 0.0003030303030303031, + "670671": 0.0003030303030303031, + "671680": 0.0003030303030303031, + "671684": 0.0003030303030303031, "671692": 0.0, - "684611": 0.0006439569999378611, - "684652": 0.0006439569999378611, - "692675": 0.00030303858820605233, + "684611": 0.0006439393939393939, + "684652": 0.0006439393939393939, + "692675": 0.0003030303030303031, }, "C1": { - "632633": 0.0006439569999378611, - "632645": 0.0006439569999378611, - "632670": 0.0006439569999378611, - "645646": 0.0006439569999378611, - "650632": 0.0006439569999378611, - "670671": 0.0006439569999378611, - "671680": 0.0006439569999378611, - "671684": 0.0006439569999378611, + "632633": 0.0006439393939393939, + "632645": 0.0006439393939393939, + "632670": 0.0006439393939393939, + "645646": 0.0006439393939393939, + "650632": 0.0006439393939393939, + "670671": 0.0006439393939393939, + "671680": 0.0006439393939393939, + "671684": 0.0006439393939393939, "671692": 0.0, - "684611": 0.0006439569999378611, - "684652": 0.0006439569999378611, - "692675": 0.0006439569999378611, + "684611": 0.0006439393939393939, + "684652": 0.0006439393939393939, + "692675": 0.0006439393939393939, }, "CMatrix": { - "650632": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "632633": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + ], + "632645": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], "632670": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], - "670671": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "645646": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], - "671680": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "650632": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], - "632633": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "670671": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], - "632645": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "671680": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], - "645646": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, + "671684": [ + 0.0005303030303030302, + -0.00011363636363636361, + -0.00011363636363636361, + 0.0005303030303030302, ], + "671692": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + "684611": [0.0005303030303030302], + "684652": [0.0446969696969697], "692675": [ - 0.07271941241533586, + 0.07271742424242425, 0.0, 0.0, 0.0, - 0.07271941241533586, + 0.07271742424242425, 0.0, 0.0, 0.0, - 0.07271941241533586, + 0.07271742424242425, ], - "671684": [ - 0.0005303175293605915, - -0.00011363947057726958, - -0.00011363947057726958, - 0.0005303175293605915, - ], - "684611": [0.0005303175293605915], - "684652": [0.04469819176039272], - "671692": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], }, "EmergAmps": { "632633": 600.0, @@ -2708,121 +2714,121 @@ def test_lines_to_dataframe(dss): "692675": 3, }, "R0": { - "650632": 3.378880258497484e-05, - "632670": 3.378880258497484e-05, - "670671": 3.378880258497484e-05, - "671680": 3.378880258497484e-05, - "632633": 3.378880258497484e-05, - "632645": 3.378880258497484e-05, - "645646": 3.378880258497484e-05, - "692675": 3.378880258497484e-05, - "671684": 3.378880258497484e-05, - "684611": 1.0985148822469399e-05, - "684652": 1.0985148822469399e-05, + "632633": 3.378787878787879e-05, + "632645": 3.378787878787879e-05, + "632670": 3.378787878787879e-05, + "645646": 3.378787878787879e-05, + "650632": 3.378787878787879e-05, + "670671": 3.378787878787879e-05, + "671680": 3.378787878787879e-05, + "671684": 3.378787878787879e-05, "671692": 0.0001, + "684611": 1.0984848484848486e-05, + "684652": 1.0984848484848486e-05, + "692675": 3.378787878787879e-05, }, "R1": { - "650632": 1.0985148822469399e-05, - "632670": 1.0985148822469399e-05, - "670671": 1.0985148822469399e-05, - "671680": 1.0985148822469399e-05, - "632633": 1.0985148822469399e-05, - "632645": 1.0985148822469399e-05, - "645646": 1.0985148822469399e-05, - "692675": 1.0985148822469399e-05, - "671684": 1.0985148822469399e-05, - "684611": 1.0985148822469399e-05, - "684652": 1.0985148822469399e-05, + "632633": 1.0984848484848486e-05, + "632645": 1.0984848484848486e-05, + "632670": 1.0984848484848486e-05, + "645646": 1.0984848484848486e-05, + "650632": 1.0984848484848486e-05, + "670671": 1.0984848484848486e-05, + "671680": 1.0984848484848486e-05, + "671684": 1.0984848484848486e-05, "671692": 0.0001, + "684611": 1.0984848484848486e-05, + "684652": 1.0984848484848486e-05, + "692675": 1.0984848484848486e-05, }, "RMatrix": { - "650632": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "632670": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "670671": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], - "671680": [ - 6.562679425837321e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 6.392220219971417e-05, - 2.9072764556018148e-05, - 2.992506058534767e-05, - 2.9072764556018148e-05, - 6.466085875846642e-05, - ], "632633": [ - 0.00014254177592742189, - 2.992506058534767e-05, - 2.9546262350090106e-05, - 2.992506058534767e-05, - 0.0001415758404275151, - 2.9072764556018148e-05, - 2.9546262350090106e-05, - 2.9072764556018148e-05, - 0.00014083718386876285, + 0.0001425378787878788, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 0.0001415719696969697, + 2.9071969696969698e-05, + 2.9545454545454545e-05, + 2.9071969696969698e-05, + 0.00014083333333333333, ], "632645": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, + 0.000250719696969697, + 3.912878787878788e-05, + 3.912878787878788e-05, + 0.000251780303030303, + ], + "632670": [ + 6.5625e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 6.392045454545455e-05, + 2.9071969696969698e-05, + 2.9924242424242424e-05, + 2.9071969696969698e-05, + 6.46590909090909e-05, ], "645646": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, + 0.000250719696969697, + 3.912878787878788e-05, + 3.912878787878788e-05, + 0.000251780303030303, ], - "692675": [ - 0.0001499512588081775, - 6.03190733859442e-05, - 5.368517989187846e-05, - 6.03190733859442e-05, - 0.0001480436308954204, - 6.03190733859442e-05, - 5.368517989187846e-05, - 6.03190733859442e-05, - 0.0001499512588081775, + "650632": [ + 6.5625e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 6.392045454545455e-05, + 2.9071969696969698e-05, + 2.9924242424242424e-05, + 2.9071969696969698e-05, + 6.46590909090909e-05, + ], + "670671": [ + 6.5625e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 6.392045454545455e-05, + 2.9071969696969698e-05, + 2.9924242424242424e-05, + 2.9071969696969698e-05, + 6.46590909090909e-05, + ], + "671680": [ + 6.5625e-05, + 2.9545454545454545e-05, + 2.9924242424242424e-05, + 2.9545454545454545e-05, + 6.392045454545455e-05, + 2.9071969696969698e-05, + 2.9924242424242424e-05, + 2.9071969696969698e-05, + 6.46590909090909e-05, ], "671684": [ - 0.0002507265519169826, - 3.912985770210651e-05, - 3.912985770210651e-05, - 0.00025178718697570375, + 0.000250719696969697, + 3.912878787878788e-05, + 3.912878787878788e-05, + 0.000251780303030303, ], - "684611": [0.000251749307152178], - "684652": [0.0002542683154166408], "671692": [0.0001, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0001], + "684611": [0.00025174242424242423], + "684652": [0.0002542613636363636], + "692675": [ + 0.00014994715909090909, + 6.0317424242424236e-05, + 5.368371212121212e-05, + 6.0317424242424236e-05, + 0.00014803958333333333, + 6.0317424242424236e-05, + 5.368371212121212e-05, + 6.0317424242424236e-05, + 0.00014994715909090909, + ], }, "Rg": { "632633": 0.01805, @@ -2881,121 +2887,121 @@ def test_lines_to_dataframe(dss): "692675": 5, }, "X0": { - "650632": 7.664982290436836e-05, - "632670": 7.664982290436836e-05, - "670671": 7.664982290436836e-05, - "671680": 7.664982290436836e-05, - "632633": 7.664982290436836e-05, - "632645": 7.664982290436836e-05, - "645646": 7.664982290436836e-05, - "692675": 7.664982290436836e-05, - "671684": 7.664982290436836e-05, - "684611": 2.2841533586031195e-05, - "684652": 2.2841533586031195e-05, + "632633": 7.664772727272727e-05, + "632645": 7.664772727272727e-05, + "632670": 7.664772727272727e-05, + "645646": 7.664772727272727e-05, + "650632": 7.664772727272727e-05, + "670671": 7.664772727272727e-05, + "671680": 7.664772727272727e-05, + "671684": 7.664772727272727e-05, "671692": 0.0, + "684611": 2.284090909090909e-05, + "684652": 2.284090909090909e-05, + "692675": 7.664772727272727e-05, }, "X1": { - "650632": 2.2841533586031195e-05, - "632670": 2.2841533586031195e-05, - "670671": 2.2841533586031195e-05, - "671680": 2.2841533586031195e-05, - "632633": 2.2841533586031195e-05, - "632645": 2.2841533586031195e-05, - "645646": 2.2841533586031195e-05, - "692675": 2.2841533586031195e-05, - "671684": 2.2841533586031195e-05, - "684611": 2.2841533586031195e-05, - "684652": 2.2841533586031195e-05, + "632633": 2.284090909090909e-05, + "632645": 2.284090909090909e-05, + "632670": 2.284090909090909e-05, + "645646": 2.284090909090909e-05, + "650632": 2.284090909090909e-05, + "670671": 2.284090909090909e-05, + "671680": 2.284090909090909e-05, + "671684": 2.284090909090909e-05, "671692": 0.0, + "684611": 2.284090909090909e-05, + "684652": 2.284090909090909e-05, + "692675": 2.284090909090909e-05, }, "XMatrix": { - "650632": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "632670": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "670671": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], - "671680": [ - 0.00019278936183433795, - 9.502153731436029e-05, - 8.022946622755235e-05, - 9.502153731436029e-05, - 0.00019845239545143855, - 7.289972037531847e-05, - 8.022946622755235e-05, - 7.289972037531847e-05, - 0.00019599020692226434, - ], "632633": [ - 0.00022375611756664392, - 8.022946622755235e-05, - 9.502153731436029e-05, - 8.022946622755235e-05, - 0.00022695696265457032, - 7.289972037531847e-05, - 9.502153731436029e-05, - 7.289972037531847e-05, - 0.00022940021127198165, + 0.00022375, + 8.022727272727272e-05, + 9.50189393939394e-05, + 8.022727272727272e-05, + 0.00022695075757575757, + 7.289772727272727e-05, + 9.50189393939394e-05, + 7.289772727272727e-05, + 0.00022939393939393942, ], "632645": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, + 0.00025698863636363636, + 8.695075757575758e-05, + 8.695075757575758e-05, + 0.00025513257575757577, + ], + "632670": [ + 0.00019278409090909093, + 9.50189393939394e-05, + 8.022727272727272e-05, + 9.50189393939394e-05, + 0.0001984469696969697, + 7.289772727272727e-05, + 8.022727272727272e-05, + 7.289772727272727e-05, + 0.00019598484848484847, ], "645646": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, + 0.00025698863636363636, + 8.695075757575758e-05, + 8.695075757575758e-05, + 0.00025513257575757577, ], - "692675": [ - 8.302348201081217e-05, - 5.243287292611695e-06, - -3.488807506369229e-06, - 5.243287292611695e-06, - 7.513406176598522e-05, - 5.243287292611695e-06, - -3.488807506369229e-06, - 5.243287292611695e-06, - 8.302348201081217e-05, + "650632": [ + 0.00019278409090909093, + 9.50189393939394e-05, + 8.022727272727272e-05, + 9.50189393939394e-05, + 0.0001984469696969697, + 7.289772727272727e-05, + 8.022727272727272e-05, + 7.289772727272727e-05, + 0.00019598484848484847, + ], + "670671": [ + 0.00019278409090909093, + 9.50189393939394e-05, + 8.022727272727272e-05, + 9.50189393939394e-05, + 0.0001984469696969697, + 7.289772727272727e-05, + 8.022727272727272e-05, + 7.289772727272727e-05, + 0.00019598484848484847, + ], + "671680": [ + 0.00019278409090909093, + 9.50189393939394e-05, + 8.022727272727272e-05, + 9.50189393939394e-05, + 0.0001984469696969697, + 7.289772727272727e-05, + 8.022727272727272e-05, + 7.289772727272727e-05, + 0.00019598484848484847, ], "671684": [ - 0.0002569956627104953, - 8.695313490337415e-05, - 8.695313490337415e-05, - 0.0002551395513577332, + 0.00025698863636363636, + 8.695075757575758e-05, + 8.695075757575758e-05, + 0.00025513257575757577, ], - "684611": [0.0002552153110047847], - "684652": [9.704810787298826e-05], "671692": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + "684611": [0.0002552083333333333], + "684652": [9.704545454545454e-05], + "692675": [ + 8.302121212121212e-05, + 5.24314393939394e-06, + -3.488712121212121e-06, + 5.24314393939394e-06, + 7.513200757575758e-05, + 5.24314393939394e-06, + -3.488712121212121e-06, + 5.24314393939394e-06, + 8.302121212121212e-05, + ], }, "Xg": { "632633": 0.155081, @@ -3013,476 +3019,476 @@ def test_lines_to_dataframe(dss): }, "Yprim": { "632633": [ - 5.564470386941076, - -7.133623601000619, - -1.495114717049371, - 1.5058679382212923, - -2.1394214811205607, - 1.6900708859940965, - -5.564470386941076, - 7.1336236509818685, - 1.495114717049371, - -1.50586794893156, - 2.1394214811205607, - -1.6900708967043643, - -1.495114717049371, - 1.5058679382212923, - 4.9084071780443566, - -7.063229336176304, - -1.0879942589622877, - 1.3823589025648546, - 1.495114717049371, - -1.50586794893156, - -4.9084071780443566, - 7.063229386157554, - 1.0879942589622877, - -1.3823589132751224, - -2.1394214811205607, - 1.6900708859940965, - -1.0879942589622877, - 1.3823589025648546, - 5.189061809545032, - -7.0854196238242695, - 2.1394214811205607, - -1.6900708967043643, - 1.0879942589622877, - -1.3823589132751224, - -5.189061809545032, - 7.085419673805519, - -5.564470386941076, - 7.1336236509818685, - 1.495114717049371, - -1.50586794893156, - 2.1394214811205607, - -1.6900708967043643, - 5.564470386941076, - -7.133623601000619, - -1.495114717049371, - 1.5058679382212923, - -2.1394214811205607, - 1.6900708859940965, - 1.495114717049371, - -1.50586794893156, - -4.9084071780443566, - 7.063229386157554, - 1.0879942589622877, - -1.3823589132751224, - -1.495114717049371, - 1.5058679382212923, - 4.9084071780443566, - -7.063229336176304, - -1.0879942589622877, - 1.3823589025648546, - 2.1394214811205607, - -1.6900708967043643, - 1.0879942589622877, - -1.3823589132751224, - -5.189061809545032, - 7.085419673805519, - -2.1394214811205607, - 1.6900708859940965, - -1.0879942589622877, - 1.3823589025648546, - 5.189061809545032, - -7.0854196238242695, + 5.564622525570931, + -7.133818641976722, + -1.495155595100418, + 1.5059091102776052, + -2.1394799752143716, + 1.6901170943579362, + -5.564622525570931, + 7.133818691956606, + 1.495155595100418, + -1.5059091209875801, + 2.1394799752143716, + -1.6901171050679111, + -1.495155595100418, + 1.5059091102776052, + 4.908541379197551, + -7.063422452497184, + -1.0880240059003325, + 1.3823966977507467, + 1.495155595100418, + -1.5059091209875801, + -4.908541379197551, + 7.063422502477067, + 1.0880240059003325, + -1.3823967084607216, + -2.1394799752143716, + 1.6901170943579362, + -1.0880240059003325, + 1.3823966977507467, + 5.189203684098949, + -7.085613346851578, + 2.1394799752143716, + -1.6901171050679111, + 1.0880240059003325, + -1.3823967084607216, + -5.189203684098949, + 7.085613396831461, + -5.564622525570931, + 7.133818691956606, + 1.495155595100418, + -1.5059091209875801, + 2.1394799752143716, + -1.6901171050679111, + 5.564622525570931, + -7.133818641976722, + -1.495155595100418, + 1.5059091102776052, + -2.1394799752143716, + 1.6901170943579362, + 1.495155595100418, + -1.5059091209875801, + -4.908541379197551, + 7.063422502477067, + 1.0880240059003325, + -1.3823967084607216, + -1.495155595100418, + 1.5059091102776052, + 4.908541379197551, + -7.063422452497184, + -1.0880240059003325, + 1.3823966977507467, + 2.1394799752143716, + -1.6901171050679111, + 1.0880240059003325, + -1.3823967084607216, + -5.189203684098949, + 7.085613396831461, + -2.1394799752143716, + 1.6901170943579362, + -1.0880240059003325, + 1.3823966977507467, + 5.189203684098949, + -7.085613346851578, ], "632645": [ - 4.3049233159489235, - -4.005143807731639, - -1.4446006150659336, - 0.5995892139073424, - -4.3049233159489235, - 4.005143857712889, - 1.4446006150659336, - -0.5995892246176102, - -1.4446006150659336, - 0.5995892139073424, - 4.334844320861555, - -3.9868570103932255, - 1.4446006150659336, - -0.5995892246176102, - -4.334844320861555, - 3.9868570603744753, - -4.3049233159489235, - 4.005143857712889, - 1.4446006150659336, - -0.5995892246176102, - 4.3049233159489235, - -4.005143807731639, - -1.4446006150659336, - 0.5995892139073424, - 1.4446006150659336, - -0.5995892246176102, - -4.334844320861555, - 3.9868570603744753, - -1.4446006150659336, - 0.5995892139073424, - 4.334844320861555, - -3.9868570103932255, + 4.3050410172015825, + -4.005253312691522, + -1.4446401120068793, + 0.5996056073245764, + -4.3050410172015825, + 4.0052533626714055, + 1.4446401120068793, + -0.5996056180345513, + -1.4446401120068793, + 0.5996056073245764, + 4.3349628401868, + -3.986966015372319, + 1.4446401120068793, + -0.5996056180345513, + -4.3349628401868, + 3.9869660653522025, + -4.3050410172015825, + 4.0052533626714055, + 1.4446401120068793, + -0.5996056180345513, + 4.3050410172015825, + -4.005253312691522, + -1.4446401120068793, + 0.5996056073245764, + 1.4446401120068793, + -0.5996056180345513, + -4.3349628401868, + 3.9869660653522025, + -1.4446401120068793, + 0.5996056073245764, + 4.3349628401868, + -3.986966015372319, ], "632670": [ - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -3.4335554553543783, - 9.896583182049687, - 1.4568043853617796, - -3.6589442587894965, - 0.7977560291105917, - -2.7352081282980016, - 3.4335554553543783, - -9.8965831153747, - -1.4568043853617796, - 3.658944244501999, - -0.7977560291105917, - 2.7352081140105042, - 1.4568043853617796, - -3.6589442587894965, - -3.006548025596122, - 9.377989998203086, - 0.3787147764220645, - -2.08899919468157, - -1.4568043853617796, - 3.658944244501999, - 3.006548025596122, - -9.377989931528099, - -0.3787147764220645, - 2.0889991803940724, - 0.7977560291105917, - -2.7352081282980016, - 0.3787147764220645, - -2.08899919468157, - -2.658753201413196, - 8.847115706212598, - -0.7977560291105917, - 2.7352081140105042, - -0.3787147764220645, - 2.0889991803940724, - 2.658753201413196, - -8.847115639537611, + 3.4336493324686748, + -9.89685369864876, + -1.4568442159669834, + 3.659044283989984, + -0.7977778406219831, + 2.7352828975550736, + -3.4336493324686748, + 9.896853765321925, + 1.4568442159669834, + -3.6590442982770908, + 0.7977778406219831, + -2.73528291184218, + -1.4568442159669834, + 3.659044283989984, + 3.0066302278661308, + -9.378246335904445, + -0.3787251308930535, + 2.089056295888508, + 1.4568442159669834, + -3.6590442982770908, + -3.0066302278661308, + 9.37824640257761, + 0.3787251308930535, + -2.0890563101756148, + -0.7977778406219831, + 2.7352828975550736, + -0.3787251308930535, + 2.089056295888508, + 2.6588258945971046, + -8.847357529237488, + 0.7977778406219831, + -2.73528291184218, + 0.3787251308930535, + -2.0890563101756148, + -2.6588258945971046, + 8.847357595910653, + -3.4336493324686748, + 9.896853765321925, + 1.4568442159669834, + -3.6590442982770908, + 0.7977778406219831, + -2.73528291184218, + 3.4336493324686748, + -9.89685369864876, + -1.4568442159669834, + 3.659044283989984, + -0.7977778406219831, + 2.7352828975550736, + 1.4568442159669834, + -3.6590442982770908, + -3.0066302278661308, + 9.37824640257761, + 0.3787251308930535, + -2.0890563101756148, + -1.4568442159669834, + 3.659044283989984, + 3.0066302278661308, + -9.378246335904445, + -0.3787251308930535, + 2.089056295888508, + 0.7977778406219831, + -2.73528291184218, + 0.3787251308930535, + -2.0890563101756148, + -2.6588258945971046, + 8.847357595910653, + -0.7977778406219831, + 2.7352828975550736, + -0.3787251308930535, + 2.089056295888508, + 2.6588258945971046, + -8.847357529237488, ], "645646": [ - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, + 7.175068362002635, + -6.675422241131079, + -2.407733520011465, + 0.9993426902982676, + -7.175068362002635, + 6.675422271119008, + 2.407733520011465, + -0.9993426967242526, + -2.407733520011465, + 0.9993426902982676, + 7.224938066978001, + -6.644943412265743, + 2.407733520011465, + -0.9993426967242526, + -7.224938066978001, + 6.644943442253672, + -7.175068362002635, + 6.675422271119008, + 2.407733520011465, + -0.9993426967242526, + 7.175068362002635, + -6.675422241131079, + -2.407733520011465, + 0.9993426902982676, + 2.407733520011465, + -0.9993426967242526, + -7.224938066978001, + 6.644943442253672, + -2.407733520011465, + 0.9993426902982676, + 7.224938066978001, + -6.644943412265743, ], "650632": [ - 1.145090744360685, - -3.300510291288572, - -0.48584426251815294, - 1.2202578674652254, - -0.2660516357083827, - 0.9121918679463129, - -1.145090744360685, - 3.3005104912135703, - 0.48584426251815294, - -1.2202579103062965, - 0.2660516357083827, - -0.912191910787384, - -0.48584426251815294, - 1.2202578674652254, - 1.0026837665363062, - -3.1275594644757296, - -0.12630137793675839, - 0.6966811885852322, - 0.48584426251815294, - -1.2202579103062965, - -1.0026837665363062, - 3.127559664400728, - 0.12630137793675839, - -0.6966812314263033, - -0.2660516357083827, - 0.9121918679463129, - -0.12630137793675839, - 0.6966811885852322, - 0.886694192671301, - -2.950512888096904, - 0.2660516357083827, - -0.912191910787384, - 0.12630137793675839, - -0.6966812314263033, - -0.886694192671301, - 2.950513088021902, - -1.145090744360685, - 3.3005104912135703, - 0.48584426251815294, - -1.2202579103062965, - 0.2660516357083827, - -0.912191910787384, - 1.145090744360685, - -3.300510291288572, - -0.48584426251815294, - 1.2202578674652254, - -0.2660516357083827, - 0.9121918679463129, - 0.48584426251815294, - -1.2202579103062965, - -1.0026837665363062, - 3.127559664400728, - 0.12630137793675839, - -0.6966812314263033, - -0.48584426251815294, - 1.2202578674652254, - 1.0026837665363062, - -3.1275594644757296, - -0.12630137793675839, - 0.6966811885852322, - 0.2660516357083827, - -0.912191910787384, - 0.12630137793675839, - -0.6966812314263033, - -0.886694192671301, - 2.950513088021902, - -0.2660516357083827, - 0.9121918679463129, - -0.12630137793675839, - 0.6966811885852322, - 0.886694192671301, - -2.950512888096904, + 1.1451220523783028, + -3.3006005308153292, + -0.485857546024989, + 1.22029123063551, + -0.26605890984743125, + 0.9122168082594669, + -1.1451220523783028, + 3.3006007307348617, + 0.485857546024989, + -1.2202912734754099, + 0.26605890984743125, + -0.9122168510993668, + -0.485857546024989, + 1.22029123063551, + 1.0027111809933547, + -3.1276449753401, + -0.12630483115283336, + 0.6967002366036674, + 0.485857546024989, + -1.2202912734754099, + -1.0027111809933547, + 3.1276451752596324, + 0.12630483115283336, + -0.6967002794435673, + -0.26605890984743125, + 0.9122168082594669, + -0.12630483115283336, + 0.6967002366036674, + 0.8867184358481343, + -2.95059355831667, + 0.26605890984743125, + -0.9122168510993668, + 0.12630483115283336, + -0.6967002794435673, + -0.8867184358481343, + 2.9505937582362023, + -1.1451220523783028, + 3.3006007307348617, + 0.485857546024989, + -1.2202912734754099, + 0.26605890984743125, + -0.9122168510993668, + 1.1451220523783028, + -3.3006005308153292, + -0.485857546024989, + 1.22029123063551, + -0.26605890984743125, + 0.9122168082594669, + 0.485857546024989, + -1.2202912734754099, + -1.0027111809933547, + 3.1276451752596324, + 0.12630483115283336, + -0.6967002794435673, + -0.485857546024989, + 1.22029123063551, + 1.0027111809933547, + -3.1276449753401, + -0.12630483115283336, + 0.6967002366036674, + 0.26605890984743125, + -0.9122168510993668, + 0.12630483115283336, + -0.6967002794435673, + -0.8867184358481343, + 2.9505937582362023, + -0.26605890984743125, + 0.9122168082594669, + -0.12630483115283336, + 0.6967002366036674, + 0.8867184358481343, + -2.95059355831667, ], "670671": [ - 1.7180656329492654, - -4.952003604504783, - -0.7289486309349635, - 1.8308445480500222, - -0.3991772478745428, - 1.3686299951334238, - -1.7180656329492654, - 4.9520037377547945, - 0.7289486309349635, - -1.8308445766035961, - 0.3991772478745428, - -1.3686300236869977, - -0.7289486309349635, - 1.8308445480500222, - 1.5044017502420202, - -4.69251249150727, - -0.18949944176557929, - 1.045283139377864, - 0.7289486309349635, - -1.8308445766035961, - -1.5044017502420202, - 4.692512624757282, - 0.18949944176557929, - -1.045283167931438, - -0.3991772478745428, - 1.3686299951334238, - -0.18949944176557929, - 1.045283139377864, - 1.3303738824775715, - -4.426876217870621, - 0.3991772478745428, - -1.3686300236869977, - 0.18949944176557929, - -1.045283167931438, - -1.3303738824775715, - 4.426876351120633, - -1.7180656329492654, - 4.9520037377547945, - 0.7289486309349635, - -1.8308445766035961, - 0.3991772478745428, - -1.3686300236869977, - 1.7180656329492654, - -4.952003604504783, - -0.7289486309349635, - 1.8308445480500222, - -0.3991772478745428, - 1.3686299951334238, - 0.7289486309349635, - -1.8308445766035961, - -1.5044017502420202, - 4.692512624757282, - 0.18949944176557929, - -1.045283167931438, - -0.7289486309349635, - 1.8308445480500222, - 1.5044017502420202, - -4.69251249150727, - -0.18949944176557929, - 1.045283139377864, - 0.3991772478745428, - -1.3686300236869977, - 0.18949944176557929, - -1.045283167931438, - -1.3303738824775715, - 4.426876351120633, - -0.3991772478745428, - 1.3686299951334238, - -0.18949944176557929, - 1.045283139377864, - 1.3303738824775715, - -4.426876217870621, + 1.718112606719134, + -4.952138997638645, + -0.7289685611777779, + 1.8308946053187896, + -0.39918816181159994, + 1.368667414957135, + -1.718112606719134, + 4.952139130885014, + 0.7289685611777779, + -1.8308946338715828, + 0.39918816181159994, + -1.3686674435099282, + -0.7289685611777779, + 1.8308946053187896, + 1.5044428822105846, + -4.6926407898738605, + -0.1895046228849712, + 1.045311718549333, + 0.7289685611777779, + -1.8308946338715828, + -1.5044428822105846, + 4.692640923120229, + 0.1895046228849712, + -1.0453117471021263, + -0.39918816181159994, + 1.368667414957135, + -0.1895046228849712, + 1.045311718549333, + 1.3304102563362856, + -4.42699725345461, + 0.39918816181159994, + -1.3686674435099282, + 0.1895046228849712, + -1.0453117471021263, + -1.3304102563362856, + 4.426997386700979, + -1.718112606719134, + 4.952139130885014, + 0.7289685611777779, + -1.8308946338715828, + 0.39918816181159994, + -1.3686674435099282, + 1.718112606719134, + -4.952138997638645, + -0.7289685611777779, + 1.8308946053187896, + -0.39918816181159994, + 1.368667414957135, + 0.7289685611777779, + -1.8308946338715828, + -1.5044428822105846, + 4.692640923120229, + 0.1895046228849712, + -1.0453117471021263, + -0.7289685611777779, + 1.8308946053187896, + 1.5044428822105846, + -4.6926407898738605, + -0.1895046228849712, + 1.045311718549333, + 0.39918816181159994, + -1.3686674435099282, + 0.1895046228849712, + -1.0453117471021263, + -1.3304102563362856, + 4.426997386700979, + -0.39918816181159994, + 1.368667414957135, + -0.1895046228849712, + 1.045311718549333, + 1.3304102563362856, + -4.42699725345461, ], "671680": [ - 2.29018148872137, - -6.601020882464641, - -0.9716885250363059, - 2.4405157991920574, - -0.5321032714167654, - 1.8243838001542325, - -2.29018148872137, - 6.601020982427141, - 0.9716885250363059, - -2.440515820612593, - 0.5321032714167654, - -1.824383821574768, - -0.9716885250363059, - 2.4405157991920574, - 2.0053675330726124, - -6.255119228838956, - -0.25260275587351677, - 1.393362441432071, - 0.9716885250363059, - -2.440515820612593, - -2.0053675330726124, - 6.255119328801456, - 0.25260275587351677, - -1.3933624628526067, - -0.5321032714167654, - 1.8243838001542325, - -0.25260275587351677, - 1.393362441432071, - 1.773388385342602, - -5.901026076081305, - 0.5321032714167654, - -1.824383821574768, - 0.25260275587351677, - -1.3933624628526067, - -1.773388385342602, - 5.901026176043804, - -2.29018148872137, - 6.601020982427141, - 0.9716885250363059, - -2.440515820612593, - 0.5321032714167654, - -1.824383821574768, - 2.29018148872137, - -6.601020882464641, - -0.9716885250363059, - 2.4405157991920574, - -0.5321032714167654, - 1.8243838001542325, - 0.9716885250363059, - -2.440515820612593, - -2.0053675330726124, - 6.255119328801456, - 0.25260275587351677, - -1.3933624628526067, - -0.9716885250363059, - 2.4405157991920574, - 2.0053675330726124, - -6.255119228838956, - -0.25260275587351677, - 1.393362441432071, - 0.5321032714167654, - -1.824383821574768, - 0.25260275587351677, - -1.3933624628526067, - -1.773388385342602, - 5.901026176043804, - -0.5321032714167654, - 1.8243838001542325, - -0.25260275587351677, - 1.393362441432071, - 1.773388385342602, - -5.901026076081305, + 2.2902441047566056, + -6.601201361509957, + -0.971715092049978, + 2.44058252553087, + -0.5321178196948625, + 1.8244336807787838, + -2.2902441047566056, + 6.601201461469723, + 0.971715092049978, + -2.4405825469508198, + 0.5321178196948625, + -1.8244337021987336, + -0.971715092049978, + 2.44058252553087, + 2.0054223619867093, + -6.255290250559498, + -0.2526096623056667, + 1.3934005374671847, + 0.971715092049978, + -2.4405825469508198, + -2.0054223619867093, + 6.255290350519265, + 0.2526096623056667, + -1.3934005588871345, + -0.5321178196948625, + 1.8244336807787838, + -0.2526096623056667, + 1.3934005374671847, + 1.7734368716962685, + -5.901187416512638, + 0.5321178196948625, + -1.8244337021987336, + 0.2526096623056667, + -1.3934005588871345, + -1.7734368716962685, + 5.901187516472405, + -2.2902441047566056, + 6.601201461469723, + 0.971715092049978, + -2.4405825469508198, + 0.5321178196948625, + -1.8244337021987336, + 2.2902441047566056, + -6.601201361509957, + -0.971715092049978, + 2.44058252553087, + -0.5321178196948625, + 1.8244336807787838, + 0.971715092049978, + -2.4405825469508198, + -2.0054223619867093, + 6.255290350519265, + 0.2526096623056667, + -1.3934005588871345, + -0.971715092049978, + 2.44058252553087, + 2.0054223619867093, + -6.255290250559498, + -0.2526096623056667, + 1.3934005374671847, + 0.5321178196948625, + -1.8244337021987336, + 0.2526096623056667, + -1.3934005588871345, + -1.7734368716962685, + 5.901187516472405, + -0.5321178196948625, + 1.8244336807787838, + -0.2526096623056667, + 1.3934005374671847, + 1.7734368716962685, + -5.901187416512638, ], "671684": [ - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -7.174872193248206, - 6.675239762854815, - 2.407667691776556, - -0.9993153743626844, - 7.174872193248206, - -6.675239732866065, - -2.407667691776556, - 0.9993153679365236, - 2.407667691776556, - -0.9993153743626844, - -7.224740534769255, - 6.644761767290793, - -2.407667691776556, - 0.9993153679365236, - 7.224740534769255, - -6.6447617373020424, + 7.175068362002635, + -6.675422241131079, + -2.407733520011465, + 0.9993426902982676, + -7.175068362002635, + 6.675422271119008, + 2.407733520011465, + -0.9993426967242526, + -2.407733520011465, + 0.9993426902982676, + 7.224938066978001, + -6.644943412265743, + 2.407733520011465, + -0.9993426967242526, + -7.224938066978001, + 6.644943442253672, + -7.175068362002635, + 6.675422271119008, + 2.407733520011465, + -0.9993426967242526, + 7.175068362002635, + -6.675422241131079, + -2.407733520011465, + 0.9993426902982676, + 2.407733520011465, + -0.9993426967242526, + -7.224938066978001, + 6.644943442253672, + -2.407733520011465, + 0.9993426902982676, + 7.224938066978001, + -6.644943412265743, ], "671692": [ 10000000.0, @@ -3559,98 +3565,98 @@ def test_lines_to_dataframe(dss): 0.0, ], "684611": [ - 6.529823239597013, - -6.6197237251699725, - -6.529823239597013, - 6.619723755158723, - -6.529823239597013, - 6.619723755158723, - 6.529823239597013, - -6.6197237251699725, + 6.5300017720164165, + -6.619904715567382, + -6.5300017720164165, + 6.619904745555312, + -6.5300017720164165, + 6.619904745555312, + 6.5300017720164165, + -6.619904715567382, ], "684652": [ - 4.290972612222875, - -1.6377544265266006, - -4.290972612222875, - 1.637761166855122, - -4.290972612222875, - 1.637761166855122, - 4.290972612222875, - -1.6377544265266006, + 4.291089932048226, + -1.6377992048699221, + -4.291089932048226, + 1.6378059450141607, + -4.291089932048226, + 1.6378059450141607, + 4.291089932048226, + -1.6377992048699221, ], "692675": [ - 10.412482684253026, - -7.836346738670522, - -2.4285352771370636, - 3.079311097832397, - -1.080921781180488, - 2.49252596573072, - -10.412482684253026, - 7.836353592313676, - 2.4285352771370636, - -3.079311097832397, - 1.080921781180488, - -2.49252596573072, - -2.4285352771370636, - 3.079311097832397, - 11.54642946546697, - -8.19720842103701, - -2.428535277137064, - 3.079311097832396, - 2.4285352771370636, - -3.079311097832397, - -11.54642946546697, - 8.197215274680165, - 2.428535277137064, - -3.079311097832396, - -1.080921781180488, - 2.49252596573072, - -2.428535277137064, - 3.079311097832396, - 10.412482684253028, - -7.83634673867052, - 1.080921781180488, - -2.49252596573072, - 2.428535277137064, - -3.079311097832396, - -10.412482684253028, - 7.8363535923136745, - -10.412482684253026, - 7.836353592313676, - 2.4285352771370636, - -3.079311097832397, - 1.080921781180488, - -2.49252596573072, - 10.412482684253026, - -7.836346738670522, - -2.4285352771370636, - 3.079311097832397, - -1.080921781180488, - 2.49252596573072, - 2.4285352771370636, - -3.079311097832397, - -11.54642946546697, - 8.197215274680165, - 2.428535277137064, - -3.079311097832396, - -2.4285352771370636, - 3.079311097832397, - 11.54642946546697, - -8.19720842103701, - -2.428535277137064, - 3.079311097832396, - 1.080921781180488, - -2.49252596573072, - 2.428535277137064, - -3.079311097832396, - -10.412482684253028, - 7.8363535923136745, - -1.080921781180488, - 2.49252596573072, - -2.428535277137064, - 3.079311097832396, - 10.412482684253028, - -7.83634673867052, + 10.412767372774814, + -7.836560993228165, + -2.428601675914292, + 3.079395289523384, + -1.0809513347493518, + 2.4925941140824843, + -10.412767372774814, + 7.836567846683939, + 2.428601675914292, + -3.079395289523384, + 1.0809513347493518, + -2.4925941140824843, + -2.428601675914292, + 3.079395289523384, + 11.546745157318384, + -8.197432541942769, + -2.4286016759142925, + 3.079395289523383, + 2.428601675914292, + -3.079395289523384, + -11.546745157318384, + 8.197439395398543, + 2.4286016759142925, + -3.079395289523383, + -1.0809513347493518, + 2.4925941140824843, + -2.4286016759142925, + 3.079395289523383, + 10.412767372774814, + -7.836560993228164, + 1.0809513347493518, + -2.4925941140824843, + 2.4286016759142925, + -3.079395289523383, + -10.412767372774814, + 7.836567846683938, + -10.412767372774814, + 7.836567846683939, + 2.428601675914292, + -3.079395289523384, + 1.0809513347493518, + -2.4925941140824843, + 10.412767372774814, + -7.836560993228165, + -2.428601675914292, + 3.079395289523384, + -1.0809513347493518, + 2.4925941140824843, + 2.428601675914292, + -3.079395289523384, + -11.546745157318384, + 8.197439395398543, + 2.4286016759142925, + -3.079395289523383, + -2.428601675914292, + 3.079395289523384, + 11.546745157318384, + -8.197432541942769, + -2.4286016759142925, + 3.079395289523383, + 1.0809513347493518, + -2.4925941140824843, + 2.4286016759142925, + -3.079395289523383, + -10.412767372774814, + 7.836567846683938, + -1.0809513347493518, + 2.4925941140824843, + -2.4286016759142925, + 3.079395289523383, + 10.412767372774814, + -7.836560993228164, ], }, "Idx": { @@ -4554,147 +4560,147 @@ def test_transformers_to_dataframe(dss): }, "WdgCurrents": { "sub": [ - 10.886841976909636, - -5.959137749538058, - -10.886837793241284, - 5.9591377488395665, - -521.2750911256298, - 285.33021885715425, - 521.2750910583418, - -285.33056578971446, - -7.0864411112852395, - -5.676524012698792, - 7.08643901895266, - 5.6765203900286, - 339.3068900331855, - 271.79902453906834, - -339.30719047319144, - -271.79885100666434, - -0.7712923191138543, - 13.032080353223137, - 0.7712902277708054, - -13.032076729854452, - 36.93081190716475, - -623.9914583135396, - -36.93051140662283, - 623.9916317127645, + 10.886838403101137, + -5.9590983105881605, + -10.886834219418233, + 5.959098309889669, + -521.274920007214, + 285.3283304721117, + 521.2749199396931, + -285.32867740653455, + -7.086427293397719, + -5.676531811608584, + 7.08642520106514, + 5.6765281889238395, + 339.30622841697186, + 271.79939795983955, + -339.3065288569778, + -271.7992244265042, + -0.771324589062715, + 13.032053531249403, + 0.771322497719666, + -13.03204990789527, + 36.93235703371465, + -623.9901740448549, + -36.932056532241404, + 623.9903474440798, ], "reg1": [ - 521.2750911260955, - -285.3302188576199, - -521.2750911936164, - 285.3298715483397, - -493.5148793202825, - 270.13442282844335, - 493.51487923646346, - -270.13478963123634, + 521.2749200067483, + -285.3283304735087, + -521.2749200742692, + 285.3279831642285, + -493.51471731392667, + 270.13263500947505, + 493.51471723010764, + -270.13300181226805, ], "reg2": [ - -339.3068900331855, - -271.799024539534, - 339.30658926814795, - 271.79919826006517, - 327.04218366835266, - 261.9753110844176, - -327.0424956800416, - -261.9751308527775, + -339.30622841604054, + -271.7993979600724, + 339.3059276519343, + 271.7995716808364, + 327.0415459657088, + 261.97567100822926, + -327.04185797739774, + -261.97549077658914, ], "reg3": [ - -36.93081190693192, - 623.9914583163336, - 36.93111273297109, - -623.9912847299129, - 34.96468480094336, - -590.7607963085175, - -34.96436708443798, - 590.7609796244651, + -36.93235703278333, + 623.9901740467176, + 36.932657858822495, + -623.9900004593655, + 34.966147642349824, + -590.7595804324374, + -34.965829925844446, + 590.759763748385, ], "xfm1": [ - 64.72170952697047, - -50.183159858127965, - -64.72171111559783, - 50.183124805561874, - -560.921513320438, - 434.92011862689833, - 560.9214963351824, - -434.9204149815341, - -57.872547335262425, - -22.049313062480678, - 57.87251705193739, - 22.049331842808215, - 501.56155806127936, - 191.0943712195276, - -501.5618144501241, - -191.0942093043377, - 10.60458044937559, - 62.68522749032809, - -10.604549699178278, - -62.68521130450972, - -91.90583479822817, - -543.2716959558966, - 91.90609739287902, - 543.2718313057558, + 64.7216815965744, + -50.18299905784306, + -64.7216831851581, + 50.182964005225585, + -560.9212712562512, + 434.91872502353, + 560.9212542713685, + -434.9190213786205, + -57.87251294138969, + -22.04935809275935, + 57.87248265804055, + 22.049376873065285, + 501.56125998063, + 191.0947614815741, + -501.56151636968207, + -191.0945995665661, + 10.604495125653102, + 62.685128147381874, + -10.60446437542032, + -62.68511196150439, + -91.90509532533542, + -543.2708349826607, + 91.90535792030641, + 543.2709703330329, ], }, "WdgVoltages": { "sub": [ - 2401.5627723087614, - -0.4669003619615109, - -1201.2376783493826, - -2079.7175117533034, - -1200.31160042552, - 2080.141938589097, + 2401.562774320432, + -0.46690091155609226, + -1201.2376790663666, + -2079.7175126796437, + -1200.3116016198273, + 2080.1419403490627, ], - "reg1": [2536.3561173511703, -0.5793274158645817], - "reg2": [-1246.25987615131, -2157.487712670567], - "reg3": [-1267.5877682936239, 2196.935536435069], + "reg1": [2536.356120228099, -0.5793286234950956], + "reg2": [-1246.2598772664523, -2157.4877137350218], + "reg3": [-1267.5877694598496, 2196.935539327288], "xfm1": [ - 273.12043190753747, - -15.653612485262295, - -149.22103967628902, - -236.2879586961411, - -124.73842715841117, - 242.00723011013307, + 273.1208520924334, + -15.653268696155022, + -149.22087189563985, + -236.28815213487727, + -124.73890495654813, + 242.00752558006548, ], }, "LossesByType": { "sub": [ - 32.287911165039986, - 262.46956554229837, - 32.287911165039986, - 262.46956554229837, + 32.28780525899492, + 262.4687364427373, + 32.28780525899492, + 262.4687364427373, 0.0, 0.0, ], "reg1": [ - 122.09431781526655, - 123.85874612047337, - 122.09431781526655, - 123.85874612047337, + 122.09388323919848, + 123.85831108468119, + 122.09388323919848, + 123.85831108468119, 0.0, 0.0, ], "reg2": [ - 65.34584129205905, - 67.07780241721775, - 65.34584129205905, - 67.07780241721775, + 65.34575459547341, + 67.07771651400253, + 65.34575459547341, + 67.07771651400253, 0.0, 0.0, ], "reg3": [ - 135.0899914202746, - 136.85448114364408, - 135.0899914202746, - 136.85448114364408, + 135.08947523473762, + 136.85396666557062, + 135.08947523473762, + 136.85396666557062, 0.0, 0.0, ], "xfm1": [ - 5552.672495756749, - 10096.271270538462, - 5552.672495756749, - 10096.271270538462, + 5552.6587844858295, + 10096.246342088038, + 5552.6587844858295, + 10096.246342088038, 0.0, 0.0, ], @@ -4925,780 +4931,348 @@ def test_linegeometry_class_to_dataframe(): def test_ymatrix(dss): expected_Y_data = ( - np.array( - [ - (8.178822742754986441e-01 + -4.636999108384913804e+00j), - (-1.305502544983652147e-01 + 1.483326906211292595e+00j), - (-1.305502544983652424e-01 + 1.483326906211292595e+00j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (-1.305502544983652147e-01 + 1.483326906211292595e+00j), - (8.178822742754985331e-01 + -4.636999108384913804e+00j), - (-1.305502544983652424e-01 + 1.483326906211292595e+00j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (-1.305502544983652424e-01 + 1.483326906211292595e+00j), - (-1.305502544983652424e-01 + 1.483326906211292595e+00j), - (8.178822742754985331e-01 + -4.636999108384912915e+00j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (1.890678734891013164e+03 + -5.002165990528294060e+03j), - (-1.369165023011177027e+03 + 1.369165023011177027e+03j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (1.890678734891013164e+03 + -5.002165990528294060e+03j), - (-1.393908969210174291e+03 + 1.393908969210174291e+03j), - (9.283352668986776024e+00 + -7.426682135189420819e+01j), - (-9.283352668986776024e+00 + 7.426682135189420819e+01j), - (1.890678734891013164e+03 + -5.002165990528294060e+03j), - (-1.369165023011177027e+03 + 1.369165023011177027e+03j), - (-1.369165023011177027e+03 + 1.369165023011177027e+03j), - (1.297396000104054792e+03 + -1.299551419795600850e+03j), - (-4.858442625181529362e-01 + 1.220257867465225354e+00j), - (-2.660516357083826944e-01 + 9.121918679463129065e-01j), - (-1.145090744360685031e+00 + 3.300510491213570319e+00j), - (4.858442625181529362e-01 + -1.220257910306296489e+00j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (-1.393908969210174291e+03 + 1.393908969210174291e+03j), - (-4.858442625181529362e-01 + 1.220257867465225354e+00j), - (1.344529401077547845e+03 + -1.346654276920105303e+03j), - (-1.263013779367583855e-01 + 6.966811885852322028e-01j), - (4.858442625181529362e-01 + -1.220257910306296489e+00j), - (-1.002683766536306198e+00 + 3.127559664400727968e+00j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-1.369165023011177027e+03 + 1.369165023011177027e+03j), - (-2.660516357083826944e-01 + 9.121918679463129065e-01j), - (-1.263013779367583855e-01 + 6.966811885852322028e-01j), - (1.297137603552365363e+03 + -1.299201422392409086e+03j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-8.866941926713010069e-01 + 2.950513088021902153e+00j), - (6.174482283725819975e+00 + -8.242736155055435887e+00j), - (-1.495114717049371045e+00 + 1.505867938221292279e+00j), - (-2.139421481120560742e+00 + 1.690070885994096495e+00j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (-5.564470386941075652e+00 + 7.133623650981868458e+00j), - (1.495114717049371045e+00 + -1.505867948931560063e+00j), - (2.139421481120560742e+00 + -1.690070896704364278e+00j), - (-1.495114717049371045e+00 + 1.505867938221292279e+00j), - (5.518419074829100879e+00 + -8.172341890231122008e+00j), - (-1.087994258962287741e+00 + 1.382358902564854608e+00j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (1.495114717049371045e+00 + -1.505867948931560063e+00j), - (-4.908407178044356556e+00 + 7.063229386157553691e+00j), - (1.087994258962287741e+00 + -1.382358913275122392e+00j), - (-2.139421481120560742e+00 + 1.690070885994096495e+00j), - (-1.087994258962287741e+00 + 1.382358902564854608e+00j), - (5.799073706329775924e+00 + -8.194532177879086277e+00j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (2.139421481120560742e+00 + -1.690070896704364278e+00j), - (1.087994258962287741e+00 + -1.382358913275122392e+00j), - (-5.189061809545031601e+00 + 7.085419673805518848e+00j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (4.790393247228868745e+01 + -8.474029329807029853e+01j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (4.738261719384117043e+01 + -8.447963565884653292e+01j), - (-5.286769772134452872e+00 + 9.612308676608098068e+00j), - (4.738261719384117043e+01 + -8.447963565884653292e+01j), - (1.000001122761358321e+07 + -1.825368951569347686e+01j), - (-1.722884289847009143e+00 + 4.284072995171073650e+00j), - (-3.361195344943603835e+00 + 4.205041811153174436e+00j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (-1.718065632949265398e+00 + 4.952003737754794521e+00j), - (7.289486309349635373e-01 + -1.830844576603596119e+00j), - (3.991772478745427843e-01 + -1.368630023686997710e+00j), - (-2.290181488721370062e+00 + 6.601020982427140638e+00j), - (9.716885250363058724e-01 + -2.440515820612592979e+00j), - (5.321032714167653888e-01 + -1.824383821574768083e+00j), - (-7.174872193248205576e+00 + 6.675239762854815240e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-1.722884289847009143e+00 + 4.284072995171073650e+00j), - (1.000000355426355079e+07 + -1.097305701620421559e+01j), - (-4.643493315148357059e-01 + 2.451358228738929057e+00j), - (7.289486309349635373e-01 + -1.830844576603596119e+00j), - (-1.504401750242020164e+00 + 4.692512624757282147e+00j), - (1.894994417655792851e-01 + -1.045283167931438051e+00j), - (9.716885250363058724e-01 + -2.440515820612592979e+00j), - (-2.005367533072612396e+00 + 6.255119328801455936e+00j), - (2.526027558735167711e-01 + -1.393362462852606676e+00j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (-3.361195344943603835e+00 + 4.205041811153174436e+00j), - (-4.643493315148357059e-01 + 2.451358228738929057e+00j), - (1.000001037299706973e+07 + -1.699808932711195553e+01j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (3.991772478745427843e-01 + -1.368630023686997710e+00j), - (1.894994417655792851e-01 + -1.045283167931438051e+00j), - (-1.330373882477571490e+00 + 4.426876351120633046e+00j), - (5.321032714167653888e-01 + -1.824383821574768083e+00j), - (2.526027558735167711e-01 + -1.393362462852606676e+00j), - (-1.773388385342602014e+00 + 5.901026176043804305e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-7.224740534769255262e+00 + 6.644761767290792598e+00j), - (1.158909874451969912e+01 + -1.065332013658415633e+01j), - (-7.224740534769255262e+00 + 6.644761767290792598e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-4.334844320861554579e+00 + 3.986857060374475292e+00j), - (1.444600615065933624e+00 + -5.995892246176102169e-01j), - (-3.852268306842489665e+00 + 1.598904581843866080e+00j), - (-7.224740534769255262e+00 + 6.644761767290792598e+00j), - (7.238031030331385729e+00 + -6.652389326059439334e+00j), - (-2.420958187338686063e+00 + 1.006942956693920088e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-2.420958187338686063e+00 + 1.006942956693920088e+00j), - (7.188162688810336043e+00 + -6.682867321623461976e+00j), - (-7.174872193248205576e+00 + 6.675239762854815240e+00j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (1.000001042230609432e+07 + -7.845072237930875048e+00j), - (-1.090745190943801735e+00 + 2.501251464991074869e+00j), - (1.080921781180488095e+00 + -2.492525965730719939e+00j), - (2.428535277137064075e+00 + -3.079311097832396094e+00j), - (-1.041248268425302825e+01 + 7.836353592313674454e+00j), - (-2.428535277137064075e+00 + 3.079311097832396094e+00j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (-1.090745190943801735e+00 + 2.501251464991074869e+00j), - (1.000001042230609432e+07 + -7.845072237930876824e+00j), - (-1.041248268425302648e+01 + 7.836353592313676231e+00j), - (2.428535277137063630e+00 + -3.079311097832396982e+00j), - (1.080921781180488095e+00 + -2.492525965730719939e+00j), - (-2.428535277137063630e+00 + 3.079311097832396982e+00j), - (1.080921781180488095e+00 + -2.492525965730719939e+00j), - (-1.041248268425302648e+01 + 7.836353592313676231e+00j), - (1.049668407314191576e+01 + -7.834661991793467450e+00j), - (-2.428535277137063630e+00 + 3.079311097832396982e+00j), - (-1.080921781180488095e+00 + 2.492525965730719939e+00j), - (2.428535277137063630e+00 + -3.079311097832396982e+00j), - (2.428535277137064075e+00 + -3.079311097832396094e+00j), - (2.428535277137063630e+00 + -3.079311097832396982e+00j), - (-2.428535277137063630e+00 + 3.079311097832396982e+00j), - (1.155823502102252576e+01 + -8.172954229715511332e+00j), - (-2.428535277137064075e+00 + 3.079311097832396094e+00j), - (-1.154642946546696969e+01 + 8.197215274680164754e+00j), - (-1.041248268425302825e+01 + 7.836353592313674454e+00j), - (1.080921781180488095e+00 + -2.492525965730719939e+00j), - (-1.080921781180488095e+00 + 2.492525965730719939e+00j), - (-2.428535277137064075e+00 + 3.079311097832396094e+00j), - (1.046282990647524969e+01 + -7.838481436237909605e+00j), - (2.428535277137064075e+00 + -3.079311097832396094e+00j), - (6.559337128485902113e+00 + -6.616251502947750218e+00j), - (-6.529823239597012829e+00 + 6.619723755158722689e+00j), - (4.313194834445097214e+00 + -1.652684982082156084e+00j), - (-4.290972612222875071e+00 + 1.637761166855121964e+00j), - (-1.718065632949265398e+00 + 4.952003737754794521e+00j), - (7.289486309349635373e-01 + -1.830844576603596119e+00j), - (3.991772478745427843e-01 + -1.368630023686997710e+00j), - (5.154572477192532531e+00 + -1.485032283099059214e+01j), - (-2.185753016296743123e+00 + 5.489788792552021235e+00j), - (-1.196933276985134409e+00 + 4.103838109143928214e+00j), - (-3.433555455354378338e+00 + 9.896583182049687011e+00j), - (1.456804385361779586e+00 + -3.658944258789496473e+00j), - (7.977560291105917356e-01 + -2.735208128298001640e+00j), - (7.289486309349635373e-01 + -1.830844576603596119e+00j), - (-1.504401750242020164e+00 + 4.692512624757282147e+00j), - (1.894994417655792851e-01 + -1.045283167931438051e+00j), - (-2.185753016296743123e+00 + 5.489788792552021235e+00j), - (4.522408109171475843e+00 + -1.407709964525759005e+01j), - (-5.682142181876438380e-01 + 3.134282319771936720e+00j), - (1.456804385361779586e+00 + -3.658944258789496473e+00j), - (-3.006548025596122109e+00 + 9.377989998203085875e+00j), - (3.787147764220645252e-01 + -2.088999194681569804e+00j), - (3.991772478745427843e-01 + -1.368630023686997710e+00j), - (1.894994417655792851e-01 + -1.045283167931438051e+00j), - (-1.330373882477571490e+00 + 4.426876351120633046e+00j), - (-1.196933276985134409e+00 + 4.103838109143928214e+00j), - (-5.682142181876438380e-01 + 3.134282319771936720e+00j), - (4.009439583890767267e+00 + -1.328579741296378813e+01j), - (7.977560291105917356e-01 + -2.735208128298001640e+00j), - (3.787147764220645252e-01 + -2.088999194681569804e+00j), - (-2.658753201413195821e+00 + 8.847115706212598241e+00j), - (-1.145090744360685031e+00 + 3.300510491213570319e+00j), - (4.858442625181529362e-01 + -1.220257910306296489e+00j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (-5.564470386941075652e+00 + 7.133623650981868458e+00j), - (1.495114717049371045e+00 + -1.505867948931560063e+00j), - (2.139421481120560742e+00 + -1.690070896704364278e+00j), - (-3.433555455354378338e+00 + 9.896583182049687011e+00j), - (1.456804385361779586e+00 + -3.658944258789496473e+00j), - (7.977560291105917356e-01 + -2.735208128298001640e+00j), - (1.014311658665613791e+01 + -2.033071700766388901e+01j), - (-3.437763364929303567e+00 + 6.385070050188516255e+00j), - (-3.203229145939535449e+00 + 5.337470867950913522e+00j), - (4.858442625181529362e-01 + -1.220257910306296489e+00j), - (-1.002683766536306198e+00 + 3.127559664400727968e+00j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (1.495114717049371045e+00 + -1.505867948931560063e+00j), - (-4.908407178044356556e+00 + 7.063229386157553691e+00j), - (1.087994258962287741e+00 + -1.382358913275122392e+00j), - (-4.334844320861554579e+00 + 3.986857060374475292e+00j), - (1.456804385361779586e+00 + -3.658944258789496473e+00j), - (-3.006548025596122109e+00 + 9.377989998203085875e+00j), - (3.787147764220645252e-01 + -2.088999194681569804e+00j), - (-3.437763364929303567e+00 + 6.385070050188516255e+00j), - (1.325248329103833989e+01 + -2.355563574257336157e+01j), - (-3.037611028387044332e+00 + 4.767628485451501419e+00j), - (1.444600615065933624e+00 + -5.995892246176102169e-01j), - (2.660516357083826944e-01 + -9.121919107873840415e-01j), - (1.263013779367583855e-01 + -6.966812314263033379e-01j), - (-8.866941926713010069e-01 + 2.950513088021902153e+00j), - (2.139421481120560742e+00 + -1.690070896704364278e+00j), - (1.087994258962287741e+00 + -1.382358913275122392e+00j), - (-5.189061809545031601e+00 + 7.085419673805518848e+00j), - (1.444600615065933624e+00 + -5.995892246176102169e-01j), - (7.977560291105917356e-01 + -2.735208128298001640e+00j), - (3.787147764220645252e-01 + -2.088999194681569804e+00j), - (-2.658753201413195821e+00 + 8.847115706212598241e+00j), - (-3.203229145939535449e+00 + 5.337470867950913522e+00j), - (-3.037611028387044332e+00 + 4.767628485451501419e+00j), - (1.303943251957845106e+01 + -2.288819195919042215e+01j), - (-4.304923315948923523e+00 + 4.005143857712888611e+00j), - (-2.290181488721370062e+00 + 6.601020982427140638e+00j), - (9.716885250363058724e-01 + -2.440515820612592979e+00j), - (5.321032714167653888e-01 + -1.824383821574768083e+00j), - (2.290181488721370062e+00 + -6.601020882464641026e+00j), - (-9.716885250363058724e-01 + 2.440515799192057411e+00j), - (-5.321032714167653888e-01 + 1.824383800154232516e+00j), - (9.716885250363058724e-01 + -2.440515820612592979e+00j), - (-2.005367533072612396e+00 + 6.255119328801455936e+00j), - (2.526027558735167711e-01 + -1.393362462852606676e+00j), - (-9.716885250363058724e-01 + 2.440515799192057411e+00j), - (2.005367533072612396e+00 + -6.255119228838956325e+00j), - (-2.526027558735167711e-01 + 1.393362441432071108e+00j), - (5.321032714167653888e-01 + -1.824383821574768083e+00j), - (2.526027558735167711e-01 + -1.393362462852606676e+00j), - (-1.773388385342602014e+00 + 5.901026176043804305e+00j), - (-5.321032714167653888e-01 + 1.824383800154232516e+00j), - (-2.526027558735167711e-01 + 1.393362441432071108e+00j), - (1.773388385342602014e+00 + -5.901026076081304694e+00j), - (-3.852268306842489665e+00 + 1.598904581843866080e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-7.174872193248205576e+00 + 6.675239762854815240e+00j), - (1.444600615065933624e+00 + -5.995892246176102169e-01j), - (-4.304923315948923523e+00 + 4.005143857712888611e+00j), - (1.147979550919712821e+01 + -1.068038354059770434e+01j), - (-1.000000000000000000e+07 + 0.000000000000000000e+00j), - (-2.428535277137064075e+00 + 3.079311097832396094e+00j), - (-2.428535277137063630e+00 + 3.079311097832396982e+00j), - (2.428535277137063630e+00 + -3.079311097832396982e+00j), - (-1.154642946546696969e+01 + 8.197215274680164754e+00j), - (2.428535277137064075e+00 + -3.079311097832396094e+00j), - (1.000001154642946459e+07 + -8.197208421037009529e+00j), - (-7.174872193248205576e+00 + 6.675239762854815240e+00j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-4.290972612222875071e+00 + 1.637761166855121964e+00j), - (1.146584480547108065e+01 + -8.312994159392665949e+00j), - (-2.407667691776556040e+00 + 9.993153679365236464e-01j), - (2.407667691776556040e+00 + -9.993153743626843610e-01j), - (-7.224740534769255262e+00 + 6.644761767290792598e+00j), - (-6.529823239597012829e+00 + 6.619723755158722689e+00j), - (-2.407667691776556040e+00 + 9.993153679365236464e-01j), - (1.375456377436626809e+01 + -1.326448546247201499e+01j), - ] - ), - np.array( - [ - 0, - 1, - 2, - 3, - 4, - 0, - 1, - 2, - 4, - 5, - 0, - 1, - 2, - 3, - 5, - 0, - 2, - 3, - 6, - 0, - 1, - 4, - 7, - 1, - 2, - 5, - 8, - 3, - 6, - 7, - 8, - 31, - 32, - 33, - 4, - 6, - 7, - 8, - 31, - 32, - 33, - 5, - 6, - 7, - 8, - 31, - 32, - 33, - 9, - 10, - 11, - 12, - 31, - 32, - 33, - 9, - 10, - 11, - 13, - 31, - 32, - 33, - 9, - 10, - 11, - 14, - 31, - 32, - 33, - 9, - 12, - 10, - 13, - 11, - 14, - 15, - 16, - 17, - 22, - 28, - 29, - 30, - 34, - 35, - 36, - 39, - 40, - 15, - 16, - 17, - 28, - 29, - 30, - 34, - 35, - 36, - 38, - 15, - 16, - 17, - 21, - 28, - 29, - 30, - 34, - 35, - 36, - 39, - 40, - 18, - 19, - 20, - 32, - 33, - 37, - 18, - 19, - 20, - 37, - 18, - 19, - 20, - 37, - 17, - 21, - 22, - 23, - 24, - 25, - 38, - 15, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 21, - 22, - 23, - 24, - 25, - 38, - 26, - 40, - 27, - 39, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 15, - 16, - 17, - 28, - 29, - 30, - 31, - 32, - 33, - 6, - 7, - 8, - 9, - 10, - 11, - 28, - 29, - 30, - 31, - 32, - 33, - 6, - 7, - 8, - 9, - 10, - 11, - 18, - 28, - 29, - 30, - 31, - 32, - 33, - 37, - 6, - 7, - 8, - 9, - 10, - 11, - 18, - 28, - 29, - 30, - 31, - 32, - 33, - 37, - 15, - 16, - 17, - 34, - 35, - 36, - 15, - 16, - 17, - 34, - 35, - 36, - 15, - 16, - 17, - 34, - 35, - 36, - 18, - 19, - 20, - 32, - 33, - 37, - 16, - 21, - 22, - 23, - 24, - 25, - 38, - 15, - 17, - 27, - 39, - 40, - 15, - 17, - 26, - 39, - 40, - ] - ), - np.array( - [ - 0, - 5, - 10, - 15, - 19, - 23, - 27, - 34, - 41, - 48, - 55, - 62, - 69, - 71, - 73, - 75, - 87, - 97, - 109, - 115, - 119, - 123, - 130, - 137, - 143, - 149, - 155, - 157, - 159, - 168, - 177, - 186, - 198, - 212, - 226, - 232, - 238, - 244, - 250, - 257, - 262, - 267, - ] - ), + np.array([ + 0.8178822742754986-4.636999108384914j, + -0.13055025449836521+1.4833269062112926j, + -0.13055025449836524+1.4833269062112926j, + -9.283352668986776+74.26682135189421j, + 9.283352668986776-74.26682135189421j, + -0.13055025449836521+1.4833269062112926j, + 0.8178822742754985-4.636999108384914j, + -0.13055025449836524+1.4833269062112926j, + -9.283352668986776+74.26682135189421j, + 9.283352668986776-74.26682135189421j, + -0.13055025449836524+1.4833269062112926j, + -0.13055025449836524+1.4833269062112926j, + 0.8178822742754985-4.636999108384913j, + 9.283352668986776-74.26682135189421j, + -9.283352668986776+74.26682135189421j, + -9.283352668986776+74.26682135189421j, + 9.283352668986776-74.26682135189421j, + 1890.6787348910132-5002.165990528294j, + -1369.165023011177+1369.165023011177j, + 9.283352668986776-74.26682135189421j, + -9.283352668986776+74.26682135189421j, + 1890.6787348910132-5002.165990528294j, + -1393.9089692101743+1393.9089692101743j, + 9.283352668986776-74.26682135189421j, + -9.283352668986776+74.26682135189421j, + 1890.6787348910132-5002.165990528294j, + -1369.165023011177+1369.165023011177j, + -1369.165023011177+1369.165023011177j, + 1297.3960314120725-1299.5515100351274j, + -0.485857546024989+1.22029123063551j, + -0.26605890984743125+0.9122168082594669j, + -1.1451220523783028+3.3006007307348617j, + 0.485857546024989-1.2202912734754099j, + 0.26605890984743125-0.9122168510993668j, + -1393.9089692101743+1393.9089692101743j, + -0.485857546024989+1.22029123063551j, + 1344.5294284920049-1346.6543624309695j, + -0.12630483115283336+0.6967002366036674j, + 0.485857546024989-1.2202912734754099j, + -1.0027111809933547+3.1276451752596324j, + 0.12630483115283336-0.6967002794435673j, + -1369.165023011177+1369.165023011177j, + -0.26605890984743125+0.9122168082594669j, + -0.12630483115283336+0.6967002366036674j, + 1297.1376277955421-1299.201503062629j, + 0.26605890984743125-0.9122168510993668j, + 0.12630483115283336-0.6967002794435673j, + -0.8867184358481343+2.9505937582362023j, + 6.174634422355675-8.24293119603154j, + -1.495155595100418+1.5059091102776052j, + -2.1394799752143716+1.6901170943579362j, + -5.286769772134453+9.612308676608098j, + -5.564622525570931+7.133818691956606j, + 1.495155595100418-1.5059091209875801j, + 2.1394799752143716-1.6901171050679111j, + -1.495155595100418+1.5059091102776052j, + 5.5185532759822955-8.172535006552001j, + -1.0880240059003325+1.3823966977507467j, + -5.286769772134453+9.612308676608098j, + 1.495155595100418-1.5059091209875801j, + -4.908541379197551+7.063422502477067j, + 1.0880240059003325-1.3823967084607216j, + -2.1394799752143716+1.6901170943579362j, + -1.0880240059003325+1.3823966977507467j, + 5.799215580883693-8.194725900906395j, + -5.286769772134453+9.612308676608098j, + 2.1394799752143716-1.6901171050679111j, + 1.0880240059003325-1.3823967084607216j, + -5.189203684098949+7.085613396831461j, + -5.286769772134453+9.612308676608098j, + 47.90393247228869-84.7402932980703j, + -5.286769772134453+9.612308676608098j, + 47.38261719384117-84.47963565884653j, + -5.286769772134453+9.612308676608098j, + 47.38261719384117-84.47963565884653j, + 10000011.227919342-18.25418789613767j, + -1.7229307871034956+4.284189778778654j, + -3.3612866353936672+4.205156433963181j, + -10000000+0j, + -1.718112606719134+4.952139130885014j, + 0.7289685611777779-1.8308946338715828j, + 0.39918816181159994-1.3686674435099282j, + -2.2902441047566056+6.601201461469723j, + 0.971715092049978-2.4405825469508198j, + 0.5321178196948625-1.8244337021987336j, + -7.175068362002635+6.675422271119008j, + 2.407733520011465-0.9993426967242526j, + -1.7229307871034956+4.284189778778654j, + 10000003.554359512-10.973356336291346j, + -0.46436141906637757+2.4514249039455116j, + 0.7289685611777779-1.8308946338715828j, + -1.5044428822105846+4.692640923120229j, + 0.1895046228849712-1.0453117471021263j, + 0.971715092049978-2.4405825469508198j, + -2.0054223619867093+6.255290350519265j, + 0.2526096623056667-1.3934005588871345j, + -10000000+0j, + -3.3612866353936672+4.205156433963181j, + -0.46436141906637757+2.4514249039455116j, + 10000010.373279463-16.99855337809098j, + -10000000+0j, + 0.39918816181159994-1.3686674435099282j, + 0.1895046228849712-1.0453117471021263j, + -1.3304102563362856+4.426997386700979j, + 0.5321178196948625-1.8244337021987336j, + 0.2526096623056667-1.3934005588871345j, + -1.7734368716962685+5.901187516472405j, + 2.407733520011465-0.9993426967242526j, + -7.224938066978001+6.644943442253672j, + 11.58941479605369-10.653610816526951j, + -7.224938066978001+6.644943442253672j, + 2.407733520011465-0.9993426967242526j, + -4.3349628401868+3.9869660653522025j, + 1.4446401120068793-0.5996056180345513j, + -3.8523736320183444+1.598948297622844j, + -7.224938066978001+6.644943442253672j, + 7.238228562540131-6.65257100102314j, + -2.421024015573595+1.006970279055664j, + 2.407733520011465-0.9993426967242526j, + 2.407733520011465-0.9993426967242526j, + -2.421024015573595+1.006970279055664j, + 7.188358857564766-6.683049829888476j, + -7.175068362002635+6.675422271119008j, + -10000000+0j, + 10000010.422590783-7.845286492488519j, + -1.0907747445126654+2.5013196133428393j, + 1.0809513347493518-2.4925941140824843j, + 2.4286016759142925-3.079395289523383j, + -10.412767372774814+7.836567846683938j, + -2.4286016759142925+3.079395289523383j, + -10000000+0j, + -1.0907747445126654+2.5013196133428393j, + 10000010.422590783-7.84528649248852j, + -10.412767372774814+7.836567846683939j, + 2.428601675914292-3.079395289523384j, + 1.0809513347493518-2.4925941140824843j, + -2.428601675914292+3.079395289523384j, + 1.0809513347493518-2.4925941140824843j, + -10.412767372774814+7.836567846683939j, + 10.496968761663704-7.834876246351111j, + -2.428601675914292+3.079395289523384j, + -1.0809513347493518+2.4925941140824843j, + 2.428601675914292-3.079395289523384j, + 2.4286016759142925-3.079395289523383j, + 2.428601675914292-3.079395289523384j, + -2.428601675914292+3.079395289523384j, + 11.55855071287394-8.17317835062127j, + -2.4286016759142925+3.079395289523383j, + -11.546745157318384+8.197439395398543j, + -10.412767372774814+7.836567846683938j, + 1.0809513347493518-2.4925941140824843j, + -1.0809513347493518+2.4925941140824843j, + -2.4286016759142925+3.079395289523383j, + 10.463114594997036-7.838695690795554j, + 2.4286016759142925-3.079395289523383j, + 6.559515660905306-6.61643249334516j, + -6.5300017720164165+6.619904745555312j, + 4.313312154270448-1.6527297604254776j, + -4.291089932048226+1.6378059450141607j, + -1.718112606719134+4.952139130885014j, + 0.7289685611777779-1.8308946338715828j, + 0.39918816181159994-1.3686674435099282j, + 5.1547133280766975-14.850728807398516j, + -2.1858127771447613+5.489938889308774j, + -1.196966002433583+4.103950312512208j, + -3.4336493324686748+9.896853765321925j, + 1.4568442159669834-3.6590442982770908j, + 0.7977778406219831-2.73528291184218j, + 0.7289685611777779-1.8308946338715828j, + -1.5044428822105846+4.692640923120229j, + 0.1895046228849712-1.0453117471021263j, + -2.1858127771447613+5.489938889308774j, + 4.522531443410049-14.077484348000528j, + -0.5682297537780246+3.1343680144378414j, + 1.4568442159669834-3.6590442982770908j, + -3.0066302278661308+9.37824640257761j, + 0.3787251308930535-2.0890563101756148j, + 0.39918816181159994-1.3686674435099282j, + 0.1895046228849712-1.0453117471021263j, + -1.3304102563362856+4.426997386700979j, + -1.196966002433583+4.103950312512208j, + -0.5682297537780246+3.1343680144378414j, + 4.00954865093339-13.286160338247655j, + 0.7977778406219831-2.73528291184218j, + 0.3787251308930535-2.0890563101756148j, + -2.6588258945971046+8.847357595910653j, + -1.1451220523783028+3.3006007307348617j, + 0.485857546024989-1.2202912734754099j, + 0.26605890984743125-0.9122168510993668j, + -5.564622525570931+7.133818691956606j, + 1.495155595100418-1.5059091209875801j, + 2.1394799752143716-1.6901171050679111j, + -3.4336493324686748+9.896853765321925j, + 1.4568442159669834-3.6590442982770908j, + 0.7977778406219831-2.73528291184218j, + 10.143393910417908-20.33127287144081j, + -3.4378573570923905+6.3852446249031j, + -3.203316725683786+5.337616800172476j, + 0.485857546024989-1.2202912734754099j, + -1.0027111809933547+3.1276451752596324j, + 0.12630483115283336-0.6967002794435673j, + 1.495155595100418-1.5059091209875801j, + -4.908541379197551+7.063422502477067j, + 1.0880240059003325-1.3823967084607216j, + -4.3349628401868+3.9869660653522025j, + 1.4568442159669834-3.6590442982770908j, + -3.0066302278661308+9.37824640257761j, + 0.3787251308930535-2.0890563101756148j, + -3.4378573570923905+6.3852446249031j, + 13.252845628243836-23.55627977911405j, + -3.0376940799530985+4.767758837567499j, + 1.4446401120068793-0.5996056180345513j, + 0.26605890984743125-0.9122168510993668j, + 0.12630483115283336-0.6967002794435673j, + -0.8867184358481343+2.9505937582362023j, + 2.1394799752143716-1.6901171050679111j, + 1.0880240059003325-1.3823967084607216j, + -5.189203684098949+7.085613396831461j, + 1.4446401120068793-0.5996056180345513j, + 0.7977778406219831-2.73528291184218j, + 0.3787251308930535-2.0890563101756148j, + -2.6588258945971046+8.847357595910653j, + -3.203316725683786+5.337616800172476j, + -3.0376940799530985+4.767758837567499j, + 13.03978903174577-22.888817747097256j, + -4.3050410172015825+4.0052533626714055j, + -2.2902441047566056+6.601201461469723j, + 0.971715092049978-2.4405825469508198j, + 0.5321178196948625-1.8244337021987336j, + 2.2902441047566056-6.601201361509957j, + -0.971715092049978+2.44058252553087j, + -0.5321178196948625+1.8244336807787838j, + 0.971715092049978-2.4405825469508198j, + -2.0054223619867093+6.255290350519265j, + 0.2526096623056667-1.3934005588871345j, + -0.971715092049978+2.44058252553087j, + 2.0054223619867093-6.255290250559498j, + -0.2526096623056667+1.3934005374671847j, + 0.5321178196948625-1.8244337021987336j, + 0.2526096623056667-1.3934005588871345j, + -1.7734368716962685+5.901187516472405j, + -0.5321178196948625+1.8244336807787838j, + -0.2526096623056667+1.3934005374671847j, + 1.7734368716962685-5.901187416512638j, + -3.8523736320183444+1.598948297622844j, + 2.407733520011465-0.9993426967242526j, + -7.175068362002635+6.675422271119008j, + 1.4446401120068793-0.5996056180345513j, + -4.3050410172015825+4.0052533626714055j, + 11.480109379204219-10.680675553822601j, + -10000000+0j, + -2.4286016759142925+3.079395289523383j, + -2.428601675914292+3.079395289523384j, + 2.428601675914292-3.079395289523384j, + -11.546745157318384+8.197439395398543j, + 2.4286016759142925-3.079395289523383j, + 10000011.546745157-8.197432541942769j, + -7.175068362002635+6.675422271119008j, + 2.407733520011465-0.9993426967242526j, + -4.291089932048226+1.6378059450141607j, + 11.46615829405086-8.313221446001002j, + -2.407733520011465+0.9993426902982676j, + 2.407733520011465-0.9993426967242526j, + -7.224938066978001+6.644943442253672j, + -6.5300017720164165+6.619904745555312j, + -2.407733520011465+0.9993426902982676j, + 13.754939838994417-13.264848127833126j + ], dtype=complex), + np.array([ + 0, 1, 2, 3, 4, 0, 1, 2, 4, 5, 0, 1, 2, 3, 5, 0, 2, + 3, 6, 0, 1, 4, 7, 1, 2, 5, 8, 3, 6, 7, 8, 31, 32, 33, + 4, 6, 7, 8, 31, 32, 33, 5, 6, 7, 8, 31, 32, 33, 9, 10, 11, + 12, 31, 32, 33, 9, 10, 11, 13, 31, 32, 33, 9, 10, 11, 14, 31, 32, + 33, 9, 12, 10, 13, 11, 14, 15, 16, 17, 22, 28, 29, 30, 34, 35, 36, + 39, 40, 15, 16, 17, 28, 29, 30, 34, 35, 36, 38, 15, 16, 17, 21, 28, + 29, 30, 34, 35, 36, 39, 40, 18, 19, 20, 32, 33, 37, 18, 19, 20, 37, + 18, 19, 20, 37, 17, 21, 22, 23, 24, 25, 38, 15, 21, 22, 23, 24, 25, + 38, 21, 22, 23, 24, 25, 38, 21, 22, 23, 24, 25, 38, 21, 22, 23, 24, + 25, 38, 26, 40, 27, 39, 15, 16, 17, 28, 29, 30, 31, 32, 33, 15, 16, + 17, 28, 29, 30, 31, 32, 33, 15, 16, 17, 28, 29, 30, 31, 32, 33, 6, + 7, 8, 9, 10, 11, 28, 29, 30, 31, 32, 33, 6, 7, 8, 9, 10, 11, + 18, 28, 29, 30, 31, 32, 33, 37, 6, 7, 8, 9, 10, 11, 18, 28, 29, + 30, 31, 32, 33, 37, 15, 16, 17, 34, 35, 36, 15, 16, 17, 34, 35, 36, + 15, 16, 17, 34, 35, 36, 18, 19, 20, 32, 33, 37, 16, 21, 22, 23, 24, + 25, 38, 15, 17, 27, 39, 40, 15, 17, 26, 39, 40], dtype=np.int32), + np.array([ + 0, 5, 10, 15, 19, 23, 27, 34, 41, 48, 55, 62, 69, + 71, 73, 75, 87, 97, 109, 115, 119, 123, 130, 137, 143, 149, + 155, 157, 159, 168, 177, 186, 198, 212, 226, 232, 238, 244, 250, + 257, 262, 267], dtype=np.int32) ) - + expected_V = [ - 0.0, - 0.0, - 57502.68619173075, - 33189.47560805494, - -10.988873472980917, - -66394.8688498055, - -57491.69731825776, - 33205.39325470909, - 2401.562772308761, - -0.46690036196087287, - -1201.2376783493826, - -2079.717511753304, - -1200.3116004255196, - 2080.1419385890968, - 2536.35611735117, - -0.579327415864084, - -1246.25987615131, - -2157.4877126705674, - -1267.5877682936236, - 2196.9355364350686, - 2426.4227635494685, - -109.96859964562768, - -1300.0193437263497, - -2096.2844127873727, - -1120.421178320253, - 2128.602432339312, - 273.12043190753747, - -15.653612485262233, - -149.221039676289, - -236.28795869614112, - -124.73842715841113, - 242.00723011013307, - 2350.072713273249, - -221.08573964636037, - -1338.4057884569054, - -2109.799268739451, - -1015.4001153916763, - 2083.1115246837244, - -1295.686126445919, - -2078.3661532376227, - -1296.2432698471694, - -2073.1595646062365, - -1121.7870803503151, - 2124.3512160900596, - -1015.4001096022037, - 2083.111507606074, - 2350.0726913632457, - -221.08573234457813, - 2333.493783338756, - -229.76132301856697, - -1347.9836973508538, - -2110.4122812917285, - -1013.9611656277061, - 2078.6439955795977, - -1002.1192290632004, - 2078.7490540767426, - 2332.4226357124753, - -217.315297134126, - 2407.051035303729, - -145.3762181110123, - -1312.3022035419076, - -2102.371437004225, - -1082.9954874709554, - 2116.1047513838107, - 2433.846944169107, - -107.52581738463071, - -1300.7631166862307, - -2101.2693421622234, - -1123.5616047423157, - 2134.1366227595295, - 2350.0727418747815, - -221.08575715699388, - -1338.4058117088837, - -2109.7992962044323, - -1015.4001197194408, - 2083.111559417906, - -1122.3854662972221, - 2129.559591256956, - -1338.4057922959526, - -2109.7992630653534, - 2345.3836609834, - -221.6058883507038, - -1009.562139171098, - 2080.528335732232, + 0.0, 0.0, 57502.68622482564, 33189.47561163729, -10.988868660972098, -66394.86888242468, + -57491.697356164674, 33205.39328374589, 2401.562774320432, -0.46690091155609226, + -1201.2376790663666, -2079.7175126796437, -1200.3116016198273, 2080.1419403490627, + 2536.356120228099, -0.5793286234950956, -1246.2598772664523, -2157.4877137350218, + -1267.5877694598496, 2196.935539327288, 2426.426283208282, -109.96557825373475, + -1300.0178453618112, -2096.2860825922016, -1120.4252829545615, 2128.6048961933866, + 273.1208520924334, -15.653268696155022, -149.22087189563985, -236.28815213487727, + -124.73890495654813, 242.00752558006548, 2350.0787848280174, -221.0796482325268, + -1338.403130602016, -2109.8005657418075, -1015.4071554561624, 2083.115730276635, + -1295.6847720988385, -2078.36830798424, -1296.2419078314422, -2073.161856729391, + -1121.791131783235, 2124.3537662394715, -1015.4071496666254, 2083.115713199053, + 2350.078762918045, -221.07964093085445, 2333.5003985622425, -229.7550420165232, + -1347.980749354996, -2110.413577571908, -1013.968224484203, 2078.6483630432745, + -1002.1266180672616, 2078.753428367296, 2332.4291296649067, -217.30934684181196, + 2407.055227539434, -145.37221180195166, -1312.3003350597062, -2102.372937700745, + -1083.0006449663492, 2116.1077231577597, 2433.850246648693, -107.5228592594183, + -1300.761594930117, -2101.270878230695, -1123.5656240409862, 2134.1389201731336, + 2350.078813428112, -221.07966574213293, -1338.4031538526608, -2109.8005932052947, + -1015.4071597837608, 2083.1157650090267, -1122.389508981748, 2129.5620039280097, + -1338.4031344410685, -2109.8005600677157, 2345.3898452775716, -221.5997955616163, + -1009.5693326805173, 2080.5326334201427 ] - + expected_I = [ - 45.06951001842762, - 24.808808468443384, - 69802.42815021457, - -72191.08720767738, - -97420.52952591189, - -24355.132407117453, - 27618.101397342507, - 96546.21962200984, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - -13.83538249862238, - 10.728150694675719, - -8.968242194252525, - -3.416980064483795, - -3.1253287196529413, - -18.472388556181386, - -2.6675923553345626, - 3.832535275459094, - -0.4671256788091469, - -1.9482821746922525, - 3.1347180341437095, - -1.8842531007668413, - -3.3143940171116526, - -1.32120707207174, - 7.105427357601002e-15, - 7.105427357601002e-15, - -7.105427357601002e-15, - -7.105427357601002e-15, - 0.2587373173690999, - -1.0386532600475533, - -0.2587373173690999, - 1.0386532600475533, - -9.012548999300577, - 4.595887907960702, - -3.0888978934500315, - -0.8862753821772245, - -1.9605308838638749, - -10.932799880696791, - 0.028157771758481887, - -3.016045651431398, - 0.0, - 0.0, - 0.06462474225171722, - -0.04346468945275728, - -1.7990183461979612, - -0.9604487876225356, - -0.05797062518124507, - -1.0832442019763704, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, - 0.0, + 45.06668904138904, 24.807535582766718, 69802.42815021734, -72191.08720768025, + -97420.52952591579, -24355.13240711842, 27618.10139734361, 96546.21962201368, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, -13.833771377298945, 10.726871597152865, -8.968504770843197, + -3.417089130031627, -3.12498992294411, -18.470505046170956, -2.667048628795584, + 3.832056283537952, -0.46758569533298555, -1.9484679417918613, 3.1346343241285695, + -1.8835883417461048, -3.31446662403701, -1.321239610087268, -7.105427357601002e-15, + 0.0, 7.105427357601002e-15, 0.0, 0.25870863043271797, -1.0385283598223651, + -0.25870863043271797, 1.0385283598223651, -9.011574972517224, 4.59535774077078, + -3.0888821721242508, -0.8862751281506647, -1.9603496363737634, -10.9319093354963, + 0.028161796268869943, -3.0158125881806797, 0.0, 0.0, 0.06464719014600195, + -0.04347962137929162, -1.7990236975013012, -0.9604538679363639, -0.05795649932674607, + -1.0830078082714039, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] actual_Y_data = dss.YMatrix.getYsparse() + np.testing.assert_array_almost_equal( expected_Y_data[0], actual_Y_data[0], decimal=4 ) - np.testing.assert_array_almost_equal( - expected_Y_data[1], actual_Y_data[1], decimal=4 - ) - np.testing.assert_array_almost_equal( - expected_Y_data[2], actual_Y_data[2], decimal=4 - ) + assert np.all(expected_Y_data[1] == actual_Y_data[1]) + assert np.all(expected_Y_data[2] == actual_Y_data[2]) + np.testing.assert_array_almost_equal(expected_V, dss.YMatrix.getV(), decimal=4) np.testing.assert_array_almost_equal(expected_I, dss.YMatrix.getI(), decimal=4) From d3eabf6f423da92fe07a0952076360fab38751ee Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Thu, 14 Apr 2022 07:06:09 -0300 Subject: [PATCH 4/9] test_evaluate_expression: move import inside the function. See comment at https://github.com/dss-extensions/OpenDSSDirect.py/issues/112#issuecomment-1098533105 --- tests/test_evaluate_expression.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_evaluate_expression.py b/tests/test_evaluate_expression.py index 9b40549..8094457 100644 --- a/tests/test_evaluate_expression.py +++ b/tests/test_evaluate_expression.py @@ -1,8 +1,5 @@ -from opendssdirect.utils import _evaluate_expression as ee - - - def test_ee(): + from opendssdirect.utils import _evaluate_expression as ee assert ee('1') == '1' assert ee('1.0') == '1.0' From ce6c8b5e258ae96f0270c04f0dc972069cbda4f4 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Thu, 21 Apr 2022 13:08:43 -0300 Subject: [PATCH 5/9] PVSystems: Update units in `Irradiance` docstring Ref: https://github.com/dss-extensions/OpenDSSDirect.py/issues/102 --- opendssdirect/PVsystems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendssdirect/PVsystems.py b/opendssdirect/PVsystems.py index ebb44e7..9797d91 100644 --- a/opendssdirect/PVsystems.py +++ b/opendssdirect/PVsystems.py @@ -26,7 +26,7 @@ def First(): def Irradiance(*args): - """Get/set the present value of the Irradiance property in W/m²""" + """Get/set the present value of the Irradiance property in kW/m²""" # Getter if len(args) == 0: return CheckForError(lib.PVSystems_Get_Irradiance()) From 725171aacf70806dfbed174a2629f0c3a2f95b4f Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Fri, 15 Jul 2022 15:48:10 -0300 Subject: [PATCH 6/9] Clean-up old Python 2.7 code Closes #114 --- opendssdirect/ActiveClass.py | 2 -- opendssdirect/Basic.py | 2 -- opendssdirect/Bus.py | 2 -- opendssdirect/CNData.py | 2 -- opendssdirect/CapControls.py | 2 -- opendssdirect/Capacitors.py | 2 -- opendssdirect/Circuit.py | 2 -- opendssdirect/CktElement.py | 2 -- opendssdirect/CmathLib.py | 2 -- opendssdirect/CtrlQueue.py | 2 -- opendssdirect/DSSCore.py | 1 - opendssdirect/DSSEvents.py | 3 --- opendssdirect/DSSimComs.py | 2 -- opendssdirect/Element.py | 2 -- opendssdirect/Error.py | 2 -- opendssdirect/Executive.py | 2 -- opendssdirect/Fuses.py | 2 -- opendssdirect/Generators.py | 2 -- opendssdirect/Isource.py | 2 -- opendssdirect/LineCodes.py | 2 -- opendssdirect/LineGeometries.py | 2 -- opendssdirect/LineSpacings.py | 2 -- opendssdirect/Lines.py | 2 -- opendssdirect/LoadShape.py | 2 -- opendssdirect/Loads.py | 2 -- opendssdirect/Meters.py | 2 -- opendssdirect/Monitors.py | 2 -- opendssdirect/PDElements.py | 2 -- opendssdirect/PVsystems.py | 2 -- opendssdirect/Parser.py | 2 -- opendssdirect/Progress.py | 2 -- opendssdirect/Properties.py | 2 -- opendssdirect/Reactors.py | 2 -- opendssdirect/Reclosers.py | 2 -- opendssdirect/ReduceCkt.py | 2 -- opendssdirect/RegControls.py | 2 -- opendssdirect/Relays.py | 2 -- opendssdirect/Sensors.py | 2 -- opendssdirect/Settings.py | 2 -- opendssdirect/Solution.py | 2 -- opendssdirect/SwtControls.py | 2 -- opendssdirect/TSData.py | 2 -- opendssdirect/Text.py | 2 -- opendssdirect/Topology.py | 2 -- opendssdirect/Transformers.py | 2 -- opendssdirect/Vsources.py | 2 -- opendssdirect/WireData.py | 2 -- opendssdirect/XYCurves.py | 2 -- opendssdirect/YMatrix.py | 2 -- opendssdirect/__init__.py | 2 -- opendssdirect/_utils.py | 6 +----- opendssdirect/dss/__init__.py | 1 - opendssdirect/utils.py | 2 -- setup.py | 2 +- tests/test_opendssdirect.py | 6 ++---- 55 files changed, 4 insertions(+), 113 deletions(-) diff --git a/opendssdirect/ActiveClass.py b/opendssdirect/ActiveClass.py index 913a120..ffbe518 100644 --- a/opendssdirect/ActiveClass.py +++ b/opendssdirect/ActiveClass.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Basic.py b/opendssdirect/Basic.py index fb91d86..1ad6d16 100644 --- a/opendssdirect/Basic.py +++ b/opendssdirect/Basic.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Bus.py b/opendssdirect/Bus.py index f49b733..3b2740f 100644 --- a/opendssdirect/Bus.py +++ b/opendssdirect/Bus.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, CheckForError, diff --git a/opendssdirect/CNData.py b/opendssdirect/CNData.py index 37cc9c3..58ee253 100644 --- a/opendssdirect/CNData.py +++ b/opendssdirect/CNData.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/CapControls.py b/opendssdirect/CapControls.py index cda1083..dced252 100644 --- a/opendssdirect/CapControls.py +++ b/opendssdirect/CapControls.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Capacitors.py b/opendssdirect/Capacitors.py index dd0748b..da118f3 100644 --- a/opendssdirect/Capacitors.py +++ b/opendssdirect/Capacitors.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Circuit.py b/opendssdirect/Circuit.py index 27d5115..11306d2 100644 --- a/opendssdirect/Circuit.py +++ b/opendssdirect/Circuit.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/CktElement.py b/opendssdirect/CktElement.py index 60d2818..f9dde40 100644 --- a/opendssdirect/CktElement.py +++ b/opendssdirect/CktElement.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import import warnings from ._utils import ( lib, diff --git a/opendssdirect/CmathLib.py b/opendssdirect/CmathLib.py index 00b130b..c3e0d18 100644 --- a/opendssdirect/CmathLib.py +++ b/opendssdirect/CmathLib.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, get_float64_array diff --git a/opendssdirect/CtrlQueue.py b/opendssdirect/CtrlQueue.py index 51609b6..029747e 100644 --- a/opendssdirect/CtrlQueue.py +++ b/opendssdirect/CtrlQueue.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, CheckForError, get_string_array diff --git a/opendssdirect/DSSCore.py b/opendssdirect/DSSCore.py index 27f64f0..e80381b 100644 --- a/opendssdirect/DSSCore.py +++ b/opendssdirect/DSSCore.py @@ -1,3 +1,2 @@ -from __future__ import absolute_import # For OpenDSSDirect.jl, import YMatrix and exposed it as DSSCore from .YMatrix import * diff --git a/opendssdirect/DSSEvents.py b/opendssdirect/DSSEvents.py index b129a50..87382a1 100644 --- a/opendssdirect/DSSEvents.py +++ b/opendssdirect/DSSEvents.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import - _columns = [] __all__ = [] diff --git a/opendssdirect/DSSimComs.py b/opendssdirect/DSSimComs.py index ad887b4..0f29841 100644 --- a/opendssdirect/DSSimComs.py +++ b/opendssdirect/DSSimComs.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, CheckForError, get_float64_array diff --git a/opendssdirect/Element.py b/opendssdirect/Element.py index aa5de11..fef5d77 100644 --- a/opendssdirect/Element.py +++ b/opendssdirect/Element.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Error.py b/opendssdirect/Error.py index 1972d90..bb8da16 100644 --- a/opendssdirect/Error.py +++ b/opendssdirect/Error.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, get_string diff --git a/opendssdirect/Executive.py b/opendssdirect/Executive.py index e1c8873..dd9ea05 100644 --- a/opendssdirect/Executive.py +++ b/opendssdirect/Executive.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, CheckForError, get_string diff --git a/opendssdirect/Fuses.py b/opendssdirect/Fuses.py index a3bb645..77bae58 100644 --- a/opendssdirect/Fuses.py +++ b/opendssdirect/Fuses.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Generators.py b/opendssdirect/Generators.py index e3b7486..4f61173 100644 --- a/opendssdirect/Generators.py +++ b/opendssdirect/Generators.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Isource.py b/opendssdirect/Isource.py index f36fb3b..eba3d3e 100644 --- a/opendssdirect/Isource.py +++ b/opendssdirect/Isource.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/LineCodes.py b/opendssdirect/LineCodes.py index add1e34..176f48e 100644 --- a/opendssdirect/LineCodes.py +++ b/opendssdirect/LineCodes.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/LineGeometries.py b/opendssdirect/LineGeometries.py index bf0fcda..c1ce1ef 100644 --- a/opendssdirect/LineGeometries.py +++ b/opendssdirect/LineGeometries.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/LineSpacings.py b/opendssdirect/LineSpacings.py index f325ba4..2c53bf7 100644 --- a/opendssdirect/LineSpacings.py +++ b/opendssdirect/LineSpacings.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Lines.py b/opendssdirect/Lines.py index 9432e4b..c9a5384 100644 --- a/opendssdirect/Lines.py +++ b/opendssdirect/Lines.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/LoadShape.py b/opendssdirect/LoadShape.py index 8ae1e2b..ded5462 100644 --- a/opendssdirect/LoadShape.py +++ b/opendssdirect/LoadShape.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Loads.py b/opendssdirect/Loads.py index e616f4f..d9fa5a0 100644 --- a/opendssdirect/Loads.py +++ b/opendssdirect/Loads.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Meters.py b/opendssdirect/Meters.py index 446562b..7b4d97e 100644 --- a/opendssdirect/Meters.py +++ b/opendssdirect/Meters.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Monitors.py b/opendssdirect/Monitors.py index 3aad110..0531304 100644 --- a/opendssdirect/Monitors.py +++ b/opendssdirect/Monitors.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import import numpy as np from ._utils import ( api_util, diff --git a/opendssdirect/PDElements.py b/opendssdirect/PDElements.py index 83cc5b5..5769226 100644 --- a/opendssdirect/PDElements.py +++ b/opendssdirect/PDElements.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/PVsystems.py b/opendssdirect/PVsystems.py index 9797d91..a6d8296 100644 --- a/opendssdirect/PVsystems.py +++ b/opendssdirect/PVsystems.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Parser.py b/opendssdirect/Parser.py index b7948d7..54dc3c8 100644 --- a/opendssdirect/Parser.py +++ b/opendssdirect/Parser.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_float64_array diff --git a/opendssdirect/Progress.py b/opendssdirect/Progress.py index 1f6820a..c80895c 100644 --- a/opendssdirect/Progress.py +++ b/opendssdirect/Progress.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError diff --git a/opendssdirect/Properties.py b/opendssdirect/Properties.py index e25691e..f4ce2fd 100644 --- a/opendssdirect/Properties.py +++ b/opendssdirect/Properties.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string diff --git a/opendssdirect/Reactors.py b/opendssdirect/Reactors.py index 3fa57a5..6e19fa9 100644 --- a/opendssdirect/Reactors.py +++ b/opendssdirect/Reactors.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Reclosers.py b/opendssdirect/Reclosers.py index 64bc3f2..f18cd8c 100644 --- a/opendssdirect/Reclosers.py +++ b/opendssdirect/Reclosers.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/ReduceCkt.py b/opendssdirect/ReduceCkt.py index fcad57c..0ce73e2 100644 --- a/opendssdirect/ReduceCkt.py +++ b/opendssdirect/ReduceCkt.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string diff --git a/opendssdirect/RegControls.py b/opendssdirect/RegControls.py index b1bd77f..8ca4ad2 100644 --- a/opendssdirect/RegControls.py +++ b/opendssdirect/RegControls.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Relays.py b/opendssdirect/Relays.py index 775d79e..ef9acd8 100644 --- a/opendssdirect/Relays.py +++ b/opendssdirect/Relays.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Sensors.py b/opendssdirect/Sensors.py index c0b57d9..2879b89 100644 --- a/opendssdirect/Sensors.py +++ b/opendssdirect/Sensors.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Settings.py b/opendssdirect/Settings.py index 2dc8340..b582256 100644 --- a/opendssdirect/Settings.py +++ b/opendssdirect/Settings.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Solution.py b/opendssdirect/Solution.py index fa69a76..1ded658 100644 --- a/opendssdirect/Solution.py +++ b/opendssdirect/Solution.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/SwtControls.py b/opendssdirect/SwtControls.py index ee60672..220d044 100644 --- a/opendssdirect/SwtControls.py +++ b/opendssdirect/SwtControls.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/TSData.py b/opendssdirect/TSData.py index 2c9d6e8..b920c45 100644 --- a/opendssdirect/TSData.py +++ b/opendssdirect/TSData.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Text.py b/opendssdirect/Text.py index e92b8e2..78e0cd8 100644 --- a/opendssdirect/Text.py +++ b/opendssdirect/Text.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, get_string, CheckForError from ._utils import codec diff --git a/opendssdirect/Topology.py b/opendssdirect/Topology.py index ec134d8..8fd6e36 100644 --- a/opendssdirect/Topology.py +++ b/opendssdirect/Topology.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/Transformers.py b/opendssdirect/Transformers.py index cbdbd54..5ff472f 100644 --- a/opendssdirect/Transformers.py +++ b/opendssdirect/Transformers.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/Vsources.py b/opendssdirect/Vsources.py index 571ed0f..b7297cb 100644 --- a/opendssdirect/Vsources.py +++ b/opendssdirect/Vsources.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/WireData.py b/opendssdirect/WireData.py index 73c4096..63ebafb 100644 --- a/opendssdirect/WireData.py +++ b/opendssdirect/WireData.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import lib, codec, CheckForError, get_string, get_string_array diff --git a/opendssdirect/XYCurves.py b/opendssdirect/XYCurves.py index 72d626c..3462830 100644 --- a/opendssdirect/XYCurves.py +++ b/opendssdirect/XYCurves.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import from ._utils import ( lib, codec, diff --git a/opendssdirect/YMatrix.py b/opendssdirect/YMatrix.py index 0f62d46..e68ff4b 100644 --- a/opendssdirect/YMatrix.py +++ b/opendssdirect/YMatrix.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import import numpy as np from .Circuit import NumNodes from ._utils import lib, ffi, CheckForError diff --git a/opendssdirect/__init__.py b/opendssdirect/__init__.py index 0693fe2..e89d95c 100644 --- a/opendssdirect/__init__.py +++ b/opendssdirect/__init__.py @@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- """ This package tries to implement the OpenDSSDirect.py API using dss_CAPI instead of the official OpenDSS Direct DLL. """ -from __future__ import absolute_import from ._version import __version__ from . import dss, utils from .dss import ( diff --git a/opendssdirect/_utils.py b/opendssdirect/_utils.py index 06eade1..b637507 100644 --- a/opendssdirect/_utils.py +++ b/opendssdirect/_utils.py @@ -1,8 +1,4 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import - -# Import dss_python, exposing only OpenDSS v7 while v8 is still considered -# experimental (at least with Free Pascal) +# Import dss_python import dss as dss_py import numpy as np import warnings diff --git a/opendssdirect/dss/__init__.py b/opendssdirect/dss/__init__.py index 05255c9..427d178 100644 --- a/opendssdirect/dss/__init__.py +++ b/opendssdirect/dss/__init__.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from .._utils import lib as dss_lib from .._utils import ffi as dss_ffi from .._utils import DSSException diff --git a/opendssdirect/utils.py b/opendssdirect/utils.py index 5a7faf3..049c353 100644 --- a/opendssdirect/utils.py +++ b/opendssdirect/utils.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import import inspect import warnings diff --git a/setup.py b/setup.py index 63f2dda..6b5f526 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def run(self): author_email="me@kdheepak.com", license="BSD-compatible", packages=find_packages(), - install_requires=["future", "six", "dss_python==0.10.7.post1"], + install_requires=["dss_python==0.12.0"], extras_require={ "extras": ["pandas", "matplotlib", "networkx"], "dev": [ diff --git a/tests/test_opendssdirect.py b/tests/test_opendssdirect.py index cb6ecdc..0164938 100644 --- a/tests/test_opendssdirect.py +++ b/tests/test_opendssdirect.py @@ -304,10 +304,9 @@ def test_13Node_Basic(dss): assert dss.Basic.Reset() is None assert dss.Basic.Start(1) == 1 assert dss.Basic.UserClasses() == [] - from six import string_types # u'Version xxxx (64-bit build); License Status: Open ' - assert isinstance(dss.Basic.Version(), string_types) + assert isinstance(dss.Basic.Version(), str) def test_13Node_Bus(dss): @@ -1263,9 +1262,8 @@ def test_13Node_CktElement(dss): assert dss.CktElement.EmergAmps() == 600.0 assert dss.CktElement.Enabled() == 1 assert dss.CktElement.EnergyMeter() == u"" - from six import string_types - assert isinstance(dss.CktElement.GUID(), string_types) + assert isinstance(dss.CktElement.GUID(), str) assert dss.CktElement.HasSwitchControl() == 0 assert dss.CktElement.HasVoltControl() == 0 np.testing.assert_almost_equal( From 889b29dfa4dafb7a385e66d8d95b89436559c404 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Fri, 15 Jul 2022 16:12:32 -0300 Subject: [PATCH 7/9] Add Storages, Parallel, and ZIP modules --- opendssdirect/Parallel.py | 99 +++++++++++++++++++++++++++++++ opendssdirect/Storages.py | 108 ++++++++++++++++++++++++++++++++++ opendssdirect/ZIP.py | 88 +++++++++++++++++++++++++++ opendssdirect/__init__.py | 5 +- opendssdirect/dss/__init__.py | 4 ++ 5 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 opendssdirect/Parallel.py create mode 100644 opendssdirect/Storages.py create mode 100644 opendssdirect/ZIP.py diff --git a/opendssdirect/Parallel.py b/opendssdirect/Parallel.py new file mode 100644 index 0000000..1745e47 --- /dev/null +++ b/opendssdirect/Parallel.py @@ -0,0 +1,99 @@ +from ._utils import lib, CheckForError, get_int32_array + + +def CreateActor(): + CheckForError(lib.Parallel_CreateActor()) + + +def Wait(): + CheckForError(lib.Parallel_Wait()) + + +def ActiveActor(*args): + """Gets/sets the ID of the Active Actor""" + # Getter + if len(args) == 0: + return CheckForError(lib.Parallel_Get_ActiveActor()) + + # Setter + Value, = args + CheckForError(lib.Parallel_Set_ActiveActor(Value)) + + +def ActiveParallel(*args): + """ + (read) Sets ON/OFF (1/0) Parallel features of the Engine + (write) Delivers if the Parallel features of the Engine are Active + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Parallel_Get_ActiveParallel()) + + # Setter + Value, = args + CheckForError(lib.Parallel_Set_ActiveParallel(Value)) + + +def ActorCPU(*args): + """Gets/sets the CPU of the Active Actor""" + # Getter + if len(args) == 0: + return CheckForError(lib.Parallel_Get_ActorCPU()) + + # Setter + Value, = args + CheckForError(lib.Parallel_Set_ActorCPU(Value)) + + +def ActorProgress(): + """(read-only) Gets the progress of all existing actors in pct""" + return get_int32_array(lib.Parallel_Get_ActorProgress) + + +def ActorStatus(): + """(read-only) Gets the status of each actor""" + return get_int32_array(lib.Parallel_Get_ActorStatus) + + +def ConcatenateReports(*args): + """ + Controls the ConcatenateReports option (1=enabled, 0=disabled) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Parallel_Get_ConcatenateReports()) + + # Setter + Value, = args + CheckForError(lib.Parallel_Set_ConcatenateReports(Value)) + + +def NumCPUs(): + """(read-only) Delivers the number of CPUs on the current PC""" + return CheckForError(lib.Parallel_Get_NumCPUs()) + + +def NumCores(): + """(read-only) Delivers the number of Cores of the local PC""" + return CheckForError(lib.Parallel_Get_NumCores()) + + +def NumOfActors(): + """(read-only) Gets the number of Actors created""" + return CheckForError(lib.Parallel_Get_NumOfActors()) + + +_columns = [] +__all__ = [ + "CreateActor", + "Wait", + "ActiveActor", + "ActiveParallel", + "ActorCPU", + "ActorProgress", + "ActorStatus", + "ConcatenateReports", + "NumCPUs", + "NumCores", + "NumOfActors", +] diff --git a/opendssdirect/Storages.py b/opendssdirect/Storages.py new file mode 100644 index 0000000..bfe7347 --- /dev/null +++ b/opendssdirect/Storages.py @@ -0,0 +1,108 @@ +from ._utils import ( + lib, + codec, + CheckForError, + get_string, + get_float64_array, + get_string_array, +) + + +def AllNames(): + """(read-only) List of strings with all Storage names""" + return CheckForError(get_string_array(lib.Storages_Get_AllNames)) + + +def Count(): + """(read-only) Number of Storages""" + return CheckForError(lib.Storages_Get_Count()) + + +def Idx(*args): + """ + Get/set active Storage by index; 1..Count + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Storages_Get_idx()) + + # Setter + Value, = args + CheckForError(lib.Storages_Set_idx(Value)) + + +def First(): + """Set first Storage active; returns 0 if none.""" + return CheckForError(lib.Storages_Get_First()) + + +def Next(): + """Sets next Storage active; returns 0 if no more.""" + return CheckForError(lib.Storages_Get_Next()) + + +def Name(*args): + """ + Get/set the name of the active Storage + """ + # Getter + if len(args) == 0: + return CheckForError(get_string(lib.Storages_Get_Name())) + + # Setter + Value, = args + if type(Value) is not bytes: + Value = Value.encode(codec) + + CheckForError(lib.Storages_Set_Name(Value)) + + +def puSOC(*args): + """Per unit state of charge""" + # Getter + if len(args) == 0: + return CheckForError(lib.Storages_Get_puSOC()) + + # Setter + Value, = args + CheckForError(lib.Storages_Set_puSOC(Value)) + + +def State(*args): + """ + Get/set state: 0=Idling; 1=Discharging; -1=Charging; + + Related enumeration: StorageStates + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Storages_Get_State()) + + # Setter + Value, = args + CheckForError(lib.Storages_Set_State(Value)) + + +def RegisterNames(): + """Array of Names of all Storage energy meter registers""" + return CheckForError(get_string_array(lib.Storages_Get_RegisterNames)) + + +def RegisterValues(): + """Array of values in Storage registers.""" + return get_float64_array(lib.Storages_Get_RegisterValues) + + +_columns = ["Name", "Idx", "RegisterNames", "RegisterValues", "puSOC", "State"] +__all__ = [ + "puSOC", + "State", + "RegisterNames", + "RegisterValues", + "Idx", + "First", + "Next", + "AllNames", + "Count", + "Name", +] diff --git a/opendssdirect/ZIP.py b/opendssdirect/ZIP.py new file mode 100644 index 0000000..67655a2 --- /dev/null +++ b/opendssdirect/ZIP.py @@ -0,0 +1,88 @@ +from ._utils import lib, ffi, api_util, codec, CheckForError, get_string_array + + +def Open(FileName): + """ + Opens and prepares a ZIP file to be used by the DSS text parser. + Currently, the ZIP format support is limited by what is provided in the Free Pascal distribution. + Besides that, the full filenames inside the ZIP must be shorter than 256 characters. + The limitations should be removed in a future revision. + + (API Extension) + """ + if type(FileName) is not bytes: + FileName = FileName.encode(codec) + CheckForError(lib.ZIP_Open(FileName)) + + +def Close(): + """ + Closes the current open ZIP file + + (API Extension) + """ + CheckForError(lib.ZIP_Close()) + + +def Redirect(FileInZip): + """ + Runs a "Redirect" command inside the current (open) ZIP file. + In the current implementation, all files required by the script must + be present inside the ZIP, using relative paths. The only exceptions are + memory-mapped files. + + (API Extension) + """ + if type(FileInZip) is not bytes: + FileName = FileInZip.encode(codec) + CheckForError(lib.ZIP_Redirect(FileInZip)) + + +def Extract(FileName): + """ + Extracts the contents of the file "FileName" from the current (open) ZIP file. + Returns a byte-string. + + (API Extension) + """ + api_util = self._api_util + ptr = api_util.ffi.new("int8_t**") + cnt = api_util.ffi.new("int32_t[4]") + if type(FileName) is not bytes: + FileName = FileName.encode(api_util.codec) + CheckForError(lib.ZIP_Extract(ptr, cnt, FileName)) + result = bytes(api_util.ffi.buffer(ptr[0], cnt[0])) + lib.DSS_Dispose_PByte(ptr) + return result + + +def List(regexp=None): + """ + List of strings consisting of all names match the regular expression provided in regexp. + If no expression is provided, all names in the current open ZIP are returned. + + See https://regex.sorokin.engineer/en/latest/regular_expressions.html for information on + the expression syntax and options. + + (API Extension) + """ + if regexp is None or not regexp: + regexp = ffi.NULL + elif type(regexp) is not bytes: + regexp = regexp.encode(codec) + return CheckForError(get_string_array(lib.ZIP_List, regexp)) + + +def Contains(Name): + """ + Check if the given path name is present in the current ZIP file. + + (API Extension) + """ + if type(Name) is not bytes: + Name = Name.encode(codec) + return CheckForError(lib.ZIP_Contains(Name)) != 0 + + +_columns = [] +__all__ = ["Open", "Close", "Redirect", "Extract", "List", "Contains"] diff --git a/opendssdirect/__init__.py b/opendssdirect/__init__.py index e89d95c..ee03047 100644 --- a/opendssdirect/__init__.py +++ b/opendssdirect/__init__.py @@ -1,5 +1,5 @@ """ -This package tries to implement the OpenDSSDirect.py API using dss_CAPI instead +This package implements the OpenDSSDirect.py API using DSS C-API instead of the official OpenDSS Direct DLL. """ from ._version import __version__ @@ -32,6 +32,7 @@ Monitors, PDElements, PVsystems, + Parallel, Parser, Progress, Properties, @@ -41,6 +42,7 @@ Sensors, Settings, Solution, + Storages, SwtControls, Text, Topology, @@ -48,6 +50,7 @@ Vsources, XYCurves, YMatrix, + ZIP, dss_lib, DSSException, ) diff --git a/opendssdirect/dss/__init__.py b/opendssdirect/dss/__init__.py index 427d178..d44276f 100644 --- a/opendssdirect/dss/__init__.py +++ b/opendssdirect/dss/__init__.py @@ -28,6 +28,7 @@ from .. import Monitors from .. import PDElements from .. import PVsystems +from .. import Parallel from .. import Parser from .. import Progress from .. import Properties @@ -49,6 +50,9 @@ from .. import LineSpacings from .. import Reactors from .. import ReduceCkt +from .. import Storages from .. import TSData from .. import WireData +from .. import ZIP + From e4dcd671db5868ceedb8a31ea4c7699f60569faf Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Sat, 16 Jul 2022 08:08:19 -0300 Subject: [PATCH 8/9] Sync methods with dss_python --- opendssdirect/ActiveClass.py | 15 ++++ opendssdirect/Basic.py | 31 +++++++- opendssdirect/Bus.py | 2 + opendssdirect/Circuit.py | 2 +- opendssdirect/CktElement.py | 20 +++++ opendssdirect/Element.py | 14 +++- opendssdirect/Generators.py | 146 +++++++++++++++++++++++++++++++++++ opendssdirect/Meters.py | 1 + opendssdirect/Settings.py | 27 ++++++- opendssdirect/Solution.py | 10 +-- 10 files changed, 257 insertions(+), 11 deletions(-) diff --git a/opendssdirect/ActiveClass.py b/opendssdirect/ActiveClass.py index ffbe518..32d5083 100644 --- a/opendssdirect/ActiveClass.py +++ b/opendssdirect/ActiveClass.py @@ -49,6 +49,20 @@ def ActiveClassParent(): return get_string(CheckForError(lib.ActiveClass_Get_ActiveClassParent())) +def ToJSON(options=0): + """ + Returns the data (as a list) of all elements from the active class as a JSON-encoded string. + + The `options` parameter contains bit-flags to toggle specific features. + See `Obj_ToJSON` (C-API) for more. + + Additionally, the `ExcludeDisabled` flag can be used to excluded disabled elements from the output. + + (API Extension) + """ + return get_string(CheckForError(lib.ActiveClass_ToJSON(options))) + + _columns = ["ActiveClassName", "Name", "NumElements", "ActiveClassParent"] __all__ = [ "ActiveClassName", @@ -59,4 +73,5 @@ def ActiveClassParent(): "Next", "NumElements", "ActiveClassParent", + "ToJSON", ] diff --git a/opendssdirect/Basic.py b/opendssdirect/Basic.py index 1ad6d16..9381eec 100644 --- a/opendssdirect/Basic.py +++ b/opendssdirect/Basic.py @@ -122,10 +122,12 @@ def LegacyModels(*args): or contact the authors from DSS Extensions: https://github.com/dss-extensions/ After toggling LegacyModels, run a "clear" command and the models will be loaded accordingly. - Defaults to False. + Defaults to False. This can also be enabled by setting the environment variable DSS_CAPI_LEGACY_MODELS to 1. + NOTE: this option will be removed in a future release. + (API Extension) """ # Getter @@ -134,7 +136,31 @@ def LegacyModels(*args): # Setter Value, = args - return CheckForError(lib.DSS_Set_LegacyModels(Value)) + CheckForError(lib.DSS_Set_LegacyModels(Value)) + + +def AllowChangeDir(*args): + """ + If disabled, the engine will not change the active working directory during execution. E.g. a "compile" + command will not "chdir" to the file path. + + If you have issues with long paths, enabling this might help in some scenarios. + + Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API. + This might change to False in future versions. + + This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to + disallow changing the active working directory. + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.DSS_Get_AllowChangeDir()) != 0 + + # Setter + Value, = args + CheckForError(lib.DSS_Set_AllowChangeDir(Value)) _columns = [ @@ -165,4 +191,5 @@ def LegacyModels(*args): "NewCircuit", "AllowEditor", "LegacyModels", + "AllowChangeDir", ] diff --git a/opendssdirect/Bus.py b/opendssdirect/Bus.py index 3b2740f..0545fbe 100644 --- a/opendssdirect/Bus.py +++ b/opendssdirect/Bus.py @@ -229,6 +229,8 @@ def AllPDEatBus(): "PuVoltage", "X", "Y", + "AllPCEatBus", + "AllPDEatBus", ] __all__ = [ "AllPCEatBus", diff --git a/opendssdirect/Circuit.py b/opendssdirect/Circuit.py index 11306d2..1b7e5ca 100644 --- a/opendssdirect/Circuit.py +++ b/opendssdirect/Circuit.py @@ -203,7 +203,7 @@ def SystemY(): def TotalPower(): - """(read-only) Total power, kw delivered to the circuit""" + """(read-only) Total power, kW delivered to the circuit""" return get_float64_array(lib.Circuit_Get_TotalPower) diff --git a/opendssdirect/CktElement.py b/opendssdirect/CktElement.py index f9dde40..ab10dd3 100644 --- a/opendssdirect/CktElement.py +++ b/opendssdirect/CktElement.py @@ -304,6 +304,23 @@ def IsIsolated(): return CheckForError(lib.CktElement_Get_IsIsolated()) != 0 +def setVariableByIndex(Idx, Value): + Code = ffi.new("int32_t*") + CheckForError(lib.CktElement_Set_Variablei(Idx, Code, Value)) + return Code[0] + + +def setVariableByName(Idx, Value): + Code = ffi.new("int32_t*") + CheckForError(lib.CktElement_Set_Variable(Idx, Code, Value)) + return Code[0] + + +def NodeRef(): + """Array of integers, a copy of the internal NodeRef of the CktElement.""" + return get_int32_array(lib.CktElement_Get_NodeRef) + + _columns = [ "BusNames", "CplxSeqCurrents", @@ -392,4 +409,7 @@ def IsIsolated(): "VoltagesMagAng", "YPrim", "IsIsolated", + "setVariableByIndex", + "setVariableByName", + "NodeRef", ] diff --git a/opendssdirect/Element.py b/opendssdirect/Element.py index fef5d77..c10c596 100644 --- a/opendssdirect/Element.py +++ b/opendssdirect/Element.py @@ -16,5 +16,17 @@ def NumProperties(): return CheckForError(lib.DSSElement_Get_NumProperties()) +def ToJSON(options=0): + """ + Returns the properties of the active DSS object as a JSON-encoded string. + + The `options` parameter contains bit-flags to toggle specific features. + See `Obj_ToJSON` (C-API) for more. + + (API Extension) + """ + return get_string(CheckForError(lib.DSSElement_ToJSON(options))) + + _columns = ["Name", "NumProperties", "AllPropertyNames"] -__all__ = ["AllPropertyNames", "Name", "NumProperties"] +__all__ = ["AllPropertyNames", "Name", "NumProperties", "ToJSON"] diff --git a/opendssdirect/Generators.py b/opendssdirect/Generators.py index 4f61173..4cbf44b 100644 --- a/opendssdirect/Generators.py +++ b/opendssdirect/Generators.py @@ -176,6 +176,136 @@ def kvar(*args): CheckForError(lib.Generators_Set_kvar(Value)) +def daily(*args): + """ + Name of the loadshape for a daily generation profile. + + (API Extension) + """ + # Getter + if len(args) == 0: + return get_string(CheckForError(lib.Generators_Get_daily())) + + # Setter + Value, = args + if type(Value) is not bytes: + Value = Value.encode(codec) + CheckForError(lib.Generators_Set_daily(Value)) + + +def duty(*args): + """ + Name of the loadshape for a duty cycle simulation. + + (API Extension) + """ + # Getter + if len(args) == 0: + return get_string(CheckForError(lib.Generators_Get_duty())) + + # Setter + Value, = args + if type(Value) is not bytes: + Value = Value.encode(codec) + CheckForError(lib.Generators_Set_duty(Value)) + + +def Yearly(*args): + """ + Name of yearly loadshape + + (API Extension) + """ + # Getter + if len(args) == 0: + return get_string(CheckForError(lib.Generators_Get_Yearly())) + + # Setter + Value, = args + if type(Value) is not bytes: + Value = Value.encode(codec) + CheckForError(lib.Generators_Set_Yearly(Value)) + + +def Status(*args): + """ + Response to dispatch multipliers: Fixed=1 (dispatch multipliers do not apply), Variable=0 (follows curves). + + Related enumeration: GeneratorStatus + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Generators_Get_Status()) + + # Setter + Value, = args + CheckForError(lib.Generators_Set_Status(Value)) + + +def IsDelta(*args): + """ + Generator connection. True/1 if delta connection, False/0 if wye. + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Generators_Get_IsDelta()) != 0 + + # Setter + Value, = args + CheckForError(lib.Generators_Set_IsDelta(Value)) + + +def kva(*args): + """ + kVA rating of electrical machine. Applied to machine or inverter definition for Dynamics mode solutions. + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Generators_Get_kva()) + + # Setter + Value, = args + CheckForError(lib.Generators_Set_kva(Value)) + + +def Class(*args): + """ + An arbitrary integer number representing the class of Generator so that Generator values may be segregated by class. + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Generators_Get_Class_()) + + # Setter + Value, = args + CheckForError(lib.Generators_Set_Class_(Value)) + + +def Bus1(*args): + """ + Bus to which the Generator is connected. May include specific node specification. + + (API Extension) + """ + # Getter + if len(args) == 0: + return get_string(CheckForError(lib.Generators_Get_Bus1())) + + # Setter + Value, = args + if type(Value) is not bytes: + Value = Value.encode(codec) + CheckForError(lib.Generators_Set_Bus1(Value)) + + _columns = [ "ForcedON", "Model", @@ -191,6 +321,14 @@ def kvar(*args): "kVARated", "kW", "kvar", + "Bus1", + "Class", + "kva", + "IsDelta", + "Status", + "daily", + "duty", + "Yearly", ] __all__ = [ "AllNames", @@ -211,4 +349,12 @@ def kvar(*args): "kVARated", "kW", "kvar", + "daily", + "duty", + "Yearly", + "Status", + "IsDelta", + "kva", + "Class", + "Bus1", ] diff --git a/opendssdirect/Meters.py b/opendssdirect/Meters.py index 7b4d97e..fde29b0 100644 --- a/opendssdirect/Meters.py +++ b/opendssdirect/Meters.py @@ -269,6 +269,7 @@ def Totals(): """(read-only) Totals of all registers of all meters""" return get_float64_array(lib.Meters_Get_Totals) + def ZonePCE(): """Returns the list of all PCE within the area covered by the energy meter""" return CheckForError(get_string_array(lib.Meters_Get_ZonePCE)) diff --git a/opendssdirect/Settings.py b/opendssdirect/Settings.py index b582256..5448acd 100644 --- a/opendssdirect/Settings.py +++ b/opendssdirect/Settings.py @@ -35,7 +35,7 @@ def AutoBusList(*args): def CktModel(*args): - """{dssMultiphase * | dssPositiveSeq} IIndicate if the circuit model is positive sequence.""" + """{dssMultiphase (0) * | dssPositiveSeq (1) } IIndicate if the circuit model is positive sequence.""" # Getter if len(args) == 0: return CheckForError(lib.Settings_Get_CktModel()) @@ -222,7 +222,27 @@ def LoadsTerminalCheck(*args): # Setter Value, = args - return CheckForError(lib.Settings_Set_LoadsTerminalCheck(Value)) + CheckForError(lib.Settings_Set_LoadsTerminalCheck(Value)) + + +def IterateDisabled(*args): + """ + Controls whether `First`/`Next` iteration includes or skips disabled circuit elements. + The default behavior from OpenDSS is to skip those. The user can still activate the element by name or index. + + The default value for IterateDisabled is 0, keeping the original behavior. + Set it to 1 (or `True`) to include disabled elements. + Other numeric values are reserved for other potential behaviors. + + (API Extension) + """ + # Getter + if len(args) == 0: + return CheckForError(lib.Settings_Get_IterateDisabled()) + + # Setter + Value, = args + CheckForError(lib.Settings_Set_IterateDisabled(int(Value))) _columns = [ @@ -243,6 +263,8 @@ def LoadsTerminalCheck(*args): "VoltageBases", "ZoneLock", "AllowDuplicates", + "LoadsTerminalCheck", + "IterateDisabled", ] __all__ = [ "AllowDuplicates", @@ -264,4 +286,5 @@ def LoadsTerminalCheck(*args): "ZoneLock", "AllocationFactors", "LoadsTerminalCheck", + "IterateDisabled", ] diff --git a/opendssdirect/Solution.py b/opendssdirect/Solution.py index 1ded658..63c450b 100644 --- a/opendssdirect/Solution.py +++ b/opendssdirect/Solution.py @@ -324,8 +324,8 @@ def Mode(*args): return CheckForError(lib.Solution_Get_Mode()) # Setter - Mode, = args - CheckForError(lib.Solution_Set_Mode(Mode)) + Value, = args + CheckForError(lib.Solution_Set_Mode(Value)) def ModeID(): @@ -361,8 +361,8 @@ def Random(*args): return CheckForError(lib.Solution_Get_Random()) # Setter - Random, = args - CheckForError(lib.Solution_Set_Random(Random)) + Value, = args + CheckForError(lib.Solution_Set_Random(Value)) def Seconds(*args): @@ -389,7 +389,7 @@ def StepSize(*args): def SystemYChanged(): """(read-only) Flag that indicates if elements of the System Y have been changed by recent activity.""" - return CheckForError(lib.Solution_Get_SystemYChanged()) != 0 + return CheckForError(lib.Solution_Get_SystemYChanged() != 0) def TimeTimeStep(): From f4982d230cf946581adba93181672799f5d457a2 Mon Sep 17 00:00:00 2001 From: Paulo Meira <10246101+PMeira@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:59:02 -0300 Subject: [PATCH 9/9] Update AppVeyor, use dss_python==0.12.1, increment version to 0.7.0 --- .appveyor.yml | 12 ++++++------ opendssdirect/_version.py | 2 +- setup.py | 6 ++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 681f56e..ac59a5f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,6 +5,9 @@ build: false environment: matrix: + - PYTHON_VERSION: 3.10 + TARGET_ARCH: "x64" + MINICONDA: C:\Miniconda3-x64 - PYTHON_VERSION: 3.9 TARGET_ARCH: "x64" MINICONDA: C:\Miniconda3-x64 @@ -17,9 +20,9 @@ environment: - PYTHON_VERSION: 3.6 TARGET_ARCH: "x64" MINICONDA: C:\Miniconda3-x64 - - PYTHON_VERSION: 3.5 - TARGET_ARCH: "x64" - MINICONDA: C:\Miniconda3-x64 + - PYTHON_VERSION: 3.10 + TARGET_ARCH: "x86" + MINICONDA: C:\Miniconda3 - PYTHON_VERSION: 3.9 TARGET_ARCH: "x86" MINICONDA: C:\Miniconda3 @@ -32,9 +35,6 @@ environment: - PYTHON_VERSION: 3.6 TARGET_ARCH: "x86" MINICONDA: C:\Miniconda3 - - PYTHON_VERSION: 3.5 - TARGET_ARCH: "x86" - MINICONDA: C:\Miniconda3 install: - "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%" diff --git a/opendssdirect/_version.py b/opendssdirect/_version.py index d80eedc..04c3f80 100644 --- a/opendssdirect/_version.py +++ b/opendssdirect/_version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = "0.6.1" +__version__ = "0.7.0" diff --git a/setup.py b/setup.py index 6b5f526..1c884b0 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def run(self): author_email="me@kdheepak.com", license="BSD-compatible", packages=find_packages(), - install_requires=["dss_python==0.12.0"], + install_requires=["dss_python==0.12.1"], extras_require={ "extras": ["pandas", "matplotlib", "networkx"], "dev": [ @@ -74,13 +74,11 @@ def run(self): "Topic :: Software Development :: Build Tools", # Pick your license as you wish (should match "license" above) "License :: Other/Proprietary License", - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], cmdclass={"develop": PostDevelopCommand}, )