edisgo.network.heat.HeatPump ============================ .. py:class:: edisgo.network.heat.HeatPump(**kwargs) Data container for all heat pump data. This class holds data on heat pump COP, heat demand time series, and thermal storage data. .. py:property:: cop_df DataFrame with COP time series of heat pumps. :param df: 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 :attr:`~.network.timeseries.TimeSeries.timeindex`. Column names are names of heat pumps as in :attr:`~.network.topology.Topology.loads_df`. :type df: :pandas:`pandas.DataFrame` :returns: DataFrame with COP time series of heat pumps in p.u.. For more information on the dataframe see input parameter `df`. :rtype: :pandas:`pandas.DataFrame` .. py:property:: heat_demand_df DataFrame with heat demand time series of heat pumps. :param df: 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 :attr:`~.network.timeseries.TimeSeries.timeindex`. Column names are names of heat pumps as in :attr:`~.network.topology.Topology.loads_df`. :type df: :pandas:`pandas.DataFrame` :returns: DataFrame with heat demand time series of heat pumps in MW. For more information on the dataframe see input parameter `df`. :rtype: :pandas:`pandas.DataFrame` .. py:property:: thermal_storage_units_df DataFrame with heat pump's thermal storage information. :param df: DataFrame with thermal storage information. Index of the dataframe are names of heat pumps as in :attr:`~.network.topology.Topology.loads_df`. Columns of the dataframe are: capacity : float Thermal storage capacity in MWh. efficiency : float Charging and discharging efficiency in p.u.. state_of_charge_initial : float Initial state of charge in p.u.. :type df: :pandas:`pandas.DataFrame` :returns: DataFrame with thermal storage information. For more information on the dataframe see input parameter `df`. :rtype: :pandas:`pandas.DataFrame` .. py:method:: set_cop(edisgo_object, ts_cop, **kwargs) 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 :attr:`~.network.topology.Topology.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. :param edisgo_object: :type edisgo_object: :class:`~.EDisGo` :param ts_cop: 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 :func:`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 (see :func:`edisgo.io.heat_pump_import.efficiency_resistive_heaters_oedb`). Weather cell information of heat pumps is obtained from column 'weather_cell_id' in :attr:`~.network.topology.Topology.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. * :pandas:`pandas.DataFrame` DataFrame with self-provided COP time series per heat pump. See :py:attr:`~cop_df` on information on the required dataframe format. :type ts_cop: str or :pandas:`pandas.DataFrame` :param engine: Database engine. This parameter is required in case `ts_cop` is 'oedb'. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param heat_pump_names: Defines for which heat pumps to set COP time series in case `ts_cop` is 'oedb'. If None, all heat pumps in :attr:`~.network.topology.Topology.loads_df` (type is 'heat_pump') are used. Default: None. :type heat_pump_names: list(str) or None :param timeindex: 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 :py:attr:`~.network.timeseries.TimeSeries.timeindex` is used. If :py:attr:`~.network.timeseries.TimeSeries.timeindex` is not set, the data is indexed using the default year 2011 and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None .. py:method:: set_heat_demand(edisgo_object, ts_heat_demand, **kwargs) 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 :attr:`~.network.topology.Topology.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. :param edisgo_object: :type edisgo_object: :class:`~.EDisGo` :param ts_heat_demand: Defines option used to set heat demand time series. Possible options are: * 'oedb' Heat demand time series are obtained from the `OpenEnergy DataBase `_ (see :func:`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. * :pandas:`pandas.DataFrame` DataFrame with self-provided heat demand time series per heat pump. See :py:attr:`~heat_demand_df` for information on the required dataframe format. :type ts_heat_demand: str or :pandas:`pandas.DataFrame` :param scenario: 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'. :type scenario: str :param engine: Database engine. This parameter is required in case `ts_heat_demand` is 'oedb'. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param heat_pump_names: 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 :attr:`~.network.topology.Topology.loads_df` (type is 'heat_pump') are used. Default: None. :type heat_pump_names: list(str) or None :param timeindex: 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 :py:attr:`~.network.timeseries.TimeSeries.timeindex` is used. If :py:attr:`~.network.timeseries.TimeSeries.timeindex` is not set, the data is indexed using the default year and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None .. py:method:: reduce_memory(attr_to_reduce=None, to_type='float32') Reduces size of dataframes to save memory. See :attr:`~.edisgo.EDisGo.reduce_memory` for more information. :param attr_to_reduce: List of attributes to reduce size for. Per default, the following attributes are reduced if they exist: cop_df, heat_demand_df. :type attr_to_reduce: list(str), optional :param to_type: Data type to convert time series data to. This is a tradeoff between precision and memory. Default: "float32". :type to_type: str, optional .. py:method:: to_csv(directory, reduce_memory=False, **kwargs) Exports heat pump data to csv files. The following attributes are exported: * 'cop_df' Attribute :py:attr:`~cop_df` is saved to `cop.csv`. * 'heat_demand_df' Attribute :py:attr:`~heat_demand_df` is saved to `heat_demand.csv`. * 'thermal_storage_units_df' Attribute :py:attr:`~thermal_storage_units_df` is saved to `thermal_storage_units.csv`. :param directory: Path to save data to. :type directory: str :param reduce_memory: If True, size of dataframes is reduced using :attr:`~.network.heat.HeatPump.reduce_memory`. Optional parameters of :attr:`~.network.heat.HeatPump.reduce_memory` can be passed as kwargs to this function. Default: False. :type reduce_memory: bool, optional :param kwargs: Kwargs may contain arguments of :attr:`~.network.heat.HeatPump.reduce_memory`. .. py:method:: from_csv(data_path, from_zip_archive=False) Restores heat pump data from csv files. :param data_path: Path to heat pump csv files. :type data_path: str :param from_zip_archive: Set True if data is archived in a zip archive. Default: False :type from_zip_archive: bool, optional .. py:method:: resample_timeseries(method = 'ffill', freq = '15min') Resamples COP and heat demand time series to a desired resolution. Both up- and down-sampling methods are possible. :param method: See :attr:`~.EDisGo.resample_timeseries` for more information. :type method: str, optional :param freq: See :attr:`~.EDisGo.resample_timeseries` for more information. :type freq: str, optional .. py:method:: check_integrity() Check data integrity. Checks for duplicated and missing labels as well as implausible values.