Using ActiveClass interface

Using ActiveClass interface#

The interface described below requires the extras dependencies. Please see installation instructions.

The OpenDSSDirect.py interface may not support all classes or element by default, however you can access these values by using the class_to_dataframe interface.

An example is shown below for the Storage class.

from opendssdirect import dss

dss('Redirect "../../tests/data/13Bus/IEEE13Nodeckt.dss"')

dss.Circuit.AllBusNames()

dss.Command(
    "New Storage.{bus_name} Bus1={bus_name} phases=1 kV=2.2 kWRated={rating} kWhRated={kwh_rating} kWhStored={initial_state} %IdlingkW=0 %reserve=0 %EffCharge=100 %EffDischarge=100 State=CHARGING".format(
        bus_name='675',
        rating=20,
        kwh_rating=20,
        initial_state=20
    ))


dss.Command(
    "New Storage.{bus_name} Bus1={bus_name} phases=1 kV=2.2 kWRated={rating} kWhRated={kwh_rating} kWhStored={initial_state} %IdlingkW=0 %reserve=0 %EffCharge=100 %EffDischarge=100 State=CHARGING".format(
        bus_name='611',
        rating=20,
        kwh_rating=20,
        initial_state=20
    ))

dss.Solution.Solve()
dss.utils.class_to_dataframe('Storage').transpose()
/tmp/ipykernel_1599/608750254.py:1: DeprecationWarning: class_to_dataframe is deprecated; it will not be removed any time soon, using JSON exports is preferable. Watch AltDSS-Python for future alternatives, including native dataframes.
  dss.utils.class_to_dataframe('Storage').transpose()
Storage.675 Storage.611
Phases 1 1
Bus1 675 611
kV 2.2 2.2
Conn wye wye
kW 0 0
... ... ...
AmpLimitGain 0.8 0.8
Spectrum
BaseFreq 60 60
Enabled Yes Yes
Like

65 rows × 2 columns