Skip to content

Batch Loader

pyconvexity.solvers.pypsa.batch_loader

PyPSA Batch Data Loader Simplified to always create MultiIndex timeseries for consistent multi-period optimization.

PyPSABatchLoader

Simplified batch data loader for PyPSA network construction. Always creates MultiIndex timeseries for consistent multi-period optimization.

batch_load_component_attributes(conn, component_ids: List[int], scenario_id: Optional[int]) -> Dict[int, Dict[str, Any]]

Batch load all static attributes for multiple components to avoid N+1 queries (single network per database)

batch_load_component_connections(conn) -> Dict[str, Dict[str, str]]

Batch load bus and carrier connections to avoid individual lookups (single network per database)

batch_load_component_timeseries(conn, component_ids: List[int], scenario_id: Optional[int]) -> Dict[int, Dict[str, pd.Series]]

Batch load all timeseries attributes - always create MultiIndex for consistency (single network per database)

batch_load_all_component_timeseries_by_type(conn, component_type: str, scenario_id: Optional[int]) -> Dict[str, pd.DataFrame]

Load all timeseries attributes for a component type and organize by attribute name (single network per database). This is a compatibility method for the existing _load_all_component_timeseries interface.