@@ -696,32 +696,9 @@ def take_snapshot(self, timestamp: datetime) -> None:
696696 def snapshot_buses (self ) -> pd .DataFrame :
697697 """Capture current bus state from PyPSA.
698698
699- Builds a Pandas DataFrame of the current bus state for the loaded PyPSA network.
700- The DataFrame is formatted according to the GridState specification and includes
701- bus voltage, power injection, and control data.
702-
703699 Returns:
704- pd.DataFrame: DataFrame with columns: bus, bus_name, type, p, q, v_mag,
705- angle_deg, Vbase. Index represents individual buses.
706-
707- Notes:
708- The following PyPSA network data is used to create bus snapshots:
709-
710- link - https://pypsa.readthedocs.io/en/stable/user-guide/components.html#bus
711-
712- Bus Information:
713- - Bus names and numbers "name" (converted from string indices) [dimensionless]
714- - Bus control types "type"(PQ, PV, Slack) [string]
715- - Base voltage levels "v_nom" [kV]
716-
717- Electrical Quantities:
718- - Active and reactive power injections "p", "q" [MW], [MVAr] → [pu]
719- - Voltage magnitude "v_mag_pu" [pu] of v_nom
720- - Voltage angle "v_ang" [radians] → [degrees]
721-
722- Time Series Data:
723- - Uses latest snapshot from network.snapshots
724- - Defaults to steady-state values if no time series available
700+ DataFrame with columns: bus, bus_name, type, p, q, v_mag,
701+ angle_deg, vbase.
725702 """
726703 n = self .network
727704 buses = n .buses # index = bus names (strings)
@@ -785,30 +762,8 @@ def snapshot_buses(self) -> pd.DataFrame:
785762 def snapshot_generators (self ) -> pd .DataFrame :
786763 """Capture current generator state from PyPSA.
787764
788- Builds a Pandas DataFrame of the current generator state for the loaded PyPSA network.
789- The DataFrame includes generator power output, base power, and status information.
790-
791765 Returns:
792- pd.DataFrame: DataFrame with columns: gen, bus, p, q, base, status.
793- Generator names are formatted as "bus_count" (e.g., "1_1", "1_2").
794-
795- Notes:
796- The following PyPSA network data is used to create generator snapshots:
797- link - https://pypsa.readthedocs.io/en/stable/user-guide/components.html#generator
798-
799- Generator Information:
800- - Generator names and bus assignments [dimensionless]
801- - Active and reactive power output [MW], [MVAr] → [pu]
802- - Generator status and availability [dimensionless]
803-
804- Time Series Data:
805- - Uses latest snapshot from generators_t for power values
806- - Uses generator 'active' attribute for status if available
807- - Per-bus counter for consistent naming convention
808-
809- Power Conversion:
810- - All power values converted to per-unit on system base
811- - System base MVA used for normalization [MVA]
766+ DataFrame with columns: gen, gen_name, bus, p, q, Mbase, status.
812767 """
813768
814769 n = self .network
@@ -980,32 +935,8 @@ def snapshot_lines(self) -> pd.DataFrame:
980935 def snapshot_loads (self ) -> pd .DataFrame :
981936 """Capture current load state from PyPSA.
982937
983- Builds a Pandas DataFrame of the current load state for the loaded PyPSA network.
984- The DataFrame includes load power consumption and status information for all
985- buses with loads.
986-
987938 Returns:
988- pd.DataFrame: DataFrame with columns: load, bus, p, q, base, status.
989- Load names are formatted as "Load_bus_count".
990-
991- Notes:
992- The following PyPSA network data is used to create load snapshots:
993-
994- link - https://pypsa.readthedocs.io/en/stable/user-guide/components.html#load
995-
996- Load Information:
997- - Load names and bus assignments [dimensionless]
998- - Active and reactive power consumption [MW], [MVAr] → [pu]
999- - Load status from 'active' attribute [dimensionless]
1000-
1001- Time Series Data:
1002- - Uses latest snapshot from loads_t for power values
1003- - Defaults to steady-state values if no time series available
1004- - Per-bus counter for consistent naming convention
1005-
1006- Power Conversion:
1007- - All power values converted to per-unit on system base
1008- - System base MVA used for normalization [MVA]
939+ DataFrame with columns: load, load_name, bus, p, q, status.
1009940 """
1010941 n = self .network
1011942 sbase = float (self .sbase )
0 commit comments