powersimdata.input.exporter package

Submodules

powersimdata.input.exporter.export_to_pypsa module

powersimdata.input.exporter.export_to_pypsa.export_to_pypsa(scenario_or_grid, add_all_columns=False, add_substations=False, add_load_shedding=True)[source]

Export a Scenario/Grid instance to a PyPSA network.

:param powersimdata.scenario.scenario.Scenario/powersimdata.input.grid.Grid

scenario_or_grid: input object. If a Grid instance is passed, operational values will be used for the single snapshot “now”. If a Scenario instance is passed, all available time-series will be imported.

Parameters:
  • add_all_columns (bool) – whether to add all columns of the corresponding component. If true, this will also import columns that PyPSA does not process. The default is False.

  • add_substations (bool) – whether to export substations. If set to True, artificial links of infinite capacity are added from each bus to its substation. This is necessary as the substations are imported as regualar buses in pypsa and thus require a connection to the network. If set to False, the substations will not be exported. This is helpful when there are no branches or dclinks connecting the substations. Note that the voltage level of the substation buses is set to the first bus connected to that substation. The default is False.

  • add_load_shedding (bool) – whether to add artificial load shedding generators to the exported pypsa network. This ensures feasibility when optimizing the exported pypsa network as is. The default is True.

Returns:

(pypsa.components.Network) – the exported Network object.

Raises:

TypeError – if scenario_or_grid is not a Grid/Scenario object.

powersimdata.input.exporter.export_to_pypsa.restore_original_columns(df, overwrite=None)[source]

Restore original columns in data frame

Parameters:
  • df (pandas.DataFrame) – data frame to modify.

  • overwrite (list/set/tuple) – array of column(s) in df to overwrite.

Returns:

(pandas.DataFrame) – data frame with original columns.

powersimdata.input.exporter.export_to_reise module

powersimdata.input.exporter.export_to_reise.export_grid(grid, file_path)[source]

Save a grid object locally.

Parameters:
powersimdata.input.exporter.export_to_reise.export_transformed_profile(kind, scenario_info, grid, ct, file_path, slice=True)[source]

Apply transformation to the given kind of profile and save the result locally.

Parameters:
  • kind (str) – which profile to export. This parameter is passed to TransformProfile.get_profile().

  • scenario_info (dict) – a dict containing the profile version, with key in the form base_{kind}

  • grid (powersimdata.input.grid.Grid) – a Grid object previously transformed.

  • ct (dict) – change table.

  • file_path (str) – path to save the result, including the filename

  • slice (bool) – whether to slice the profiles by the Scenario’s time range.

Module contents