edisgo.network.heat
¶
Module Contents¶
Classes¶
Data container for all heat pump data. |
- class edisgo.network.heat.HeatPump(**kwargs)[source]¶
Data container for all heat pump data.
This class holds data on heat pump COP, heat demand time series, and thermal storage data.
- property cop_df¶
DataFrame with COP time series of heat pumps.
- Parameters
df (pandas.DataFrame) – DataFrame with COP time series of heat pumps in p.u.. Index of the dataframe is a time index and should contain all time steps given in
timeindex
. Column names are names of heat pumps as inloads_df
.- Returns
DataFrame with COP time series of heat pumps in p.u.. For more information on the dataframe see input parameter df.
- Return type
- property heat_demand_df¶
DataFrame with heat demand time series of heat pumps.
- Parameters
df (pandas.DataFrame) – DataFrame with heat demand time series of heat pumps in MW. Index of the dataframe is a time index and should contain all time steps given in
timeindex
. Column names are names of heat pumps as inloads_df
.- Returns
DataFrame with heat demand time series of heat pumps in MW. For more information on the dataframe see input parameter df.
- Return type
- property thermal_storage_units_df¶
DataFrame with heat pump’s thermal storage information.
- Parameters
df (pandas.DataFrame) –
DataFrame with thermal storage information. Index of the dataframe are names of heat pumps as in
loads_df
. Columns of the dataframe are:- capacityfloat
Thermal storage capacity in MWh.
- efficiencyfloat
Charging and discharging efficiency in p.u..
- state_of_charge_initialfloat
Initial state of charge in p.u..
- Returns
DataFrame with thermal storage information. For more information on the dataframe see input parameter df.
- Return type
- set_cop(edisgo_object, ts_cop, **kwargs)[source]¶
Write COP time series for heat pumps to py:attr:~cop_df.
COP time series can either be given to this function or be obtained from the OpenEnergy DataBase. In case they are obtained from the OpenEnergy DataBase the heat pumps need to already be integrated into the grid, i.e. given in
loads_df
.In case COP time series are set for heat pumps that were already assigned a COP time series, their existing COP time series is overwritten by this function.
- Parameters
edisgo_object (
EDisGo
) –ts_cop (str or pandas.DataFrame) –
Defines option used to set COP time series. Possible options are:
’oedb’
COP / efficiency data are obtained from the OpenEnergy DataBase. In case of heat pumps weather cell specific hourly COP time series are obtained (see
edisgo.io.timeseries_import.cop_oedb()
for more information). Using information on which weather cell each heat pump is in, the weather cell specific time series are mapped to each heat pump. In case of resistive heaters a constant efficiency is set (seeedisgo.io.heat_pump_import.efficiency_resistive_heaters_oedb()
).Weather cell information of heat pumps is obtained from column ‘weather_cell_id’ in
loads_df
. In case no heat pump has weather cell information, this function will throw an error. In case only some heat pumps are missing weather cell information, a random existing weather cell is used to fill missing information.This option requires that the parameter engine is provided as keyword argument. For further settings, the parameters timeindex and heat_pump_names can also be provided as keyword arguments.
-
DataFrame with self-provided COP time series per heat pump. See
cop_df
on information on the required dataframe format.
engine (sqlalchemy.Engine) – Database engine. This parameter is required in case ts_cop is ‘oedb’.
heat_pump_names (list(str) or None) – Defines for which heat pumps to set COP time series in case ts_cop is ‘oedb’. If None, all heat pumps in
loads_df
(type is ‘heat_pump’) are used. Default: None.timeindex (pandas.DatetimeIndex or None) – Specifies time steps for which to set data in case ts_cop is ‘oedb’. Leap years can currently not be handled. In case the given timeindex contains a leap year, the data will be indexed using the default year 2011 and returned for the whole year. If no timeindex is provided, the timeindex set in
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year 2011 and returned for the whole year.
- set_heat_demand(edisgo_object, ts_heat_demand, **kwargs)[source]¶
Write heat demand time series of heat pumps to py:attr:~heat_demand_df.
Heat demand time series can either be given to this function or be obtained from the OpenEnergy DataBase. In case they are obtained from the OpenEnergy DataBase the heat pumps need to already be integrated into the grid, i.e. given in
loads_df
.In case heat demand time series are set for heat pumps that were already assigned a heat demand time series, their existing heat demand time series is overwritten by this function.
- Parameters
edisgo_object (
EDisGo
) –ts_heat_demand (str or pandas.DataFrame) –
Defines option used to set heat demand time series. Possible options are:
’oedb’
Heat demand time series are obtained from the OpenEnergy DataBase (see
edisgo.io.timeseries_import.heat_demand_oedb()
for more information). Time series are only obtained for heat pumps that are already integrated into the grid. This option requires that the parameters engine and scenario are provided as keyword arguments. For further settings, the parameters timeindex and heat_pump_names can also be provided as keyword arguments.-
DataFrame with self-provided heat demand time series per heat pump. See
heat_demand_df
for information on the required dataframe format.
scenario (str) – Scenario for which to retrieve heat demand data. This parameter is required in case ts_heat_demand is ‘oedb’. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database engine. This parameter is required in case ts_heat_demand is ‘oedb’.
heat_pump_names (list(str) or None) – Defines for which heat pumps to get heat demand time series for in case ts_heat_demand is ‘oedb’. If None, all heat pumps in
loads_df
(type is ‘heat_pump’) are used. Default: None.timeindex (pandas.DatetimeIndex or None) – Specifies time steps for which to set data in case ts_heat_demand is ‘oedb’. Leap years can currently not be handled. In case the given timeindex contains a leap year, the data will be indexed using the default year (2035 in case of the ‘eGon2035’ and to 2045 in case of the ‘eGon100RE’ scenario) and returned for the whole year. If no timeindex is provided, the timeindex set in
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year and returned for the whole year.
- reduce_memory(attr_to_reduce=None, to_type='float32')[source]¶
Reduces size of dataframes to save memory.
See
reduce_memory
for more information.- Parameters
attr_to_reduce (list(str), optional) – List of attributes to reduce size for. Per default, the following attributes are reduced if they exist: cop_df, heat_demand_df.
to_type (str, optional) – Data type to convert time series data to. This is a tradeoff between precision and memory. Default: “float32”.
- to_csv(directory, reduce_memory=False, **kwargs)[source]¶
Exports heat pump data to csv files.
The following attributes are exported:
‘cop_df’
Attribute
cop_df
is saved to cop.csv.‘heat_demand_df’
Attribute
heat_demand_df
is saved to heat_demand.csv.‘thermal_storage_units_df’
Attribute
thermal_storage_units_df
is saved to thermal_storage_units.csv.
- Parameters
directory (str) – Path to save data to.
reduce_memory (bool, optional) – If True, size of dataframes is reduced using
reduce_memory
. Optional parameters ofreduce_memory
can be passed as kwargs to this function. Default: False.kwargs – Kwargs may contain arguments of
reduce_memory
.
- resample_timeseries(method: str = 'ffill', freq: str | pd.Timedelta = '15min')[source]¶
Resamples COP and heat demand time series to a desired resolution.
Both up- and down-sampling methods are possible.
- Parameters
method (str, optional) – See
resample_timeseries
for more information.freq (str, optional) – See
resample_timeseries
for more information.