pypsa.Network.madd

Contents

pypsa.Network.madd#

Network.madd(class_name: str, names: Sequence, suffix: str = '', **kwargs: Any) Index#

Add multiple components to the network, along with their attributes.

Deprecated since version 0.31: n.madd is deprecated and will be removed in a future version. Use pypsa.Network.add() instead. It can handle both single and multiple removal of components.

Make sure when adding static attributes as pandas Series that they are indexed by names. Make sure when adding time-varying attributes as pandas DataFrames that their index is a superset of n.snapshots and their columns are a subset of names.

Any attributes which are not specified will be given the default value from Components.

Parameters:
  • class_name (string) – Component class name in (“Bus”, “Generator”, “Load”, “StorageUnit”, “Store”, “ShuntImpedance”, “Line”, “Transformer”, “Link”).

  • names (list-like or pandas.Index) – Component names

  • suffix (string, default '') – All components are named after names with this added suffix. It is assumed that all Series and DataFrames are indexed by the original names.

  • kwargs – Component attributes, e.g. x=[0.1, 0.2], can be list, pandas.Series of pandas.DataFrame for time-varying

Deprecated since version 0.31: This will be removed in 1.0. Use n.add as a drop-in replacement instead.