diff --git a/src/gsy_e/gsy_e_core/user_profile_handler.py b/src/gsy_e/gsy_e_core/user_profile_handler.py index 78b84d298..defedb213 100644 --- a/src/gsy_e/gsy_e_core/user_profile_handler.py +++ b/src/gsy_e/gsy_e_core/user_profile_handler.py @@ -480,7 +480,11 @@ def _read_new_datapoints_from_buffer_or_rotate_profile( ) def rotate_profile( - self, profile_type: InputProfileTypes, profile, profile_uuid: str = None + self, + profile_type: InputProfileTypes, + profile, + profile_uuid: str = None, + input_profile_path: str = None, ) -> Dict[DateTime, float]: """Reads a new chunk of profile if the buffer does not contain the current time stamp Profile chunks are either generated from single values, input daily profiles or profiles @@ -491,11 +495,14 @@ def rotate_profile( profile (any of str, dict, float): Any arbitrary input (same input as for read_arbitrary_profile) profile_uuid (str): optional, if set the profiles is read from the DB + input_profile_path (str), optional, for profiles provided by files Returns: Profile chunk as dictionary """ if profile_uuid is None and self.should_create_profile(profile): + if input_profile_path: + profile = input_profile_path return read_arbitrary_profile( profile_type, profile, current_timestamp=self.current_timestamp ) diff --git a/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py b/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py index 99757b070..9a4a2e81a 100644 --- a/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py +++ b/src/gsy_e/models/strategy/energy_parameters/heatpump/heat_pump.py @@ -1,5 +1,6 @@ from abc import ABC, abstractmethod from typing import Optional, Dict, Union, List +from statistics import mean from gsy_framework.constants_limits import ConstSettings, GlobalConfig, FLOATING_POINT_TOLERANCE from gsy_framework.read_user_profile import InputProfileTypes @@ -44,6 +45,7 @@ def get_results_dict(self, current_time_slot: DateTime) -> dict: return { "tanks": tanks_state, **self._hp_state.get_results_dict(current_time_slot), + "storage_temp_C": mean([tank["storage_temp_C"] for tank in tanks_state]), } return {**self._hp_state.get_results_dict(current_time_slot), **tanks_state} diff --git a/src/gsy_e/models/strategy/strategy_profile.py b/src/gsy_e/models/strategy/strategy_profile.py index 8bd670bfb..90eac7df1 100644 --- a/src/gsy_e/models/strategy/strategy_profile.py +++ b/src/gsy_e/models/strategy/strategy_profile.py @@ -128,7 +128,10 @@ def read_or_rotate_profiles(self, reconfigure=False): profile = self.profile self.profile = global_objects.profiles_handler.rotate_profile( - profile_type=self.profile_type, profile=profile, profile_uuid=self.input_profile_uuid + profile_type=self.profile_type, + profile=profile, + profile_uuid=self.input_profile_uuid, + input_profile_path=self.input_profile, )