Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gsye 810 #1818

Merged
merged 15 commits into from
Dec 17, 2024
Merged

Feature/gsye 810 #1818

merged 15 commits into from
Dec 17, 2024

Conversation

hannesdiedrich
Copy link
Member

@hannesdiedrich hannesdiedrich commented Nov 29, 2024

Reason for the proposed changes

Please describe what we want to achieve and why.

Proposed changes

INTEGRATION_TESTS_BRANCH=feature/GSYE-810
GSY_FRAMEWORK_BRANCH=feature/GSYE-810

@hannesdiedrich hannesdiedrich requested a review from a team November 29, 2024 07:41
@@ -28,59 +28,59 @@ def setup_method(self):
self._datetime = datetime(2023, 1, 1, 0, 0)

def test_increase_tanks_temp_from_heat_energy(self):
self._tanks.increase_tanks_temp_from_heat_energy(1, self._datetime)
self._tanks.increase_tanks_temp_from_heat_energy(5000, self._datetime)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spyrostz You need 4186 J to heat up one liter of water by 1 degree. Hence, in our cases where we talk about hundrets of liters we should change to use kJ as unit for the heat demand profile in order to not have too large numbers, for the input as well as for the output. What do you think?
If you agree, I will add a ticket for this.

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 72.98701% with 104 lines in your changes missing coverage. Please review.

Project coverage is 69.56%. Comparing base (b1dab79) to head (63444ac).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1818      +/-   ##
==========================================
+ Coverage   69.50%   69.56%   +0.06%     
==========================================
  Files         148      150       +2     
  Lines       14181    14227      +46     
  Branches     2656     2666      +10     
==========================================
+ Hits         9856     9897      +41     
- Misses       3800     3801       +1     
- Partials      525      529       +4     

Comment on lines 26 to 27
TIME_FORMAT,
DATE_FORMAT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these 2 and the NOQA required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to check myself again, too.
yes, we have a lot of imports in other modules that source these ones:

from gsy_e.constants import TIME_ZONE

I am not sure whether this is good practice. Should I remove them and directly import from gsy-framework?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the best practice is to remove them from here actually and directly import them. I checked too and I think that the only reason why we had them like these were in order to use them as gsy_e.constants.TIME_FORMAT, however unless I do not see something, this can be replaced by a direct import. Therefore I would reecommend to take the time and remove them, and thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will do.

return 0
electrical_power_kW = self._calc_power(source_temp_C, tank_temp_C, heat_demand_kW)
if electrical_power_kW <= 0:
log.debug(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write an error here, and also I would prepend the configuration / simulation id in case this error will be logged in deployed environment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might clutter or logs, but OK, let's do it and see how often this happens.

return 0
cop = heat_demand_kW / electrical_power_kW
if cop > 6:
log.debug(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, an error log and a reference to the configuration uuid will be nice to have

Comment on lines +315 to +318
return self._cop_model.calc_cop(
source_temp_C=self._source_temp_C.get_value(time_slot),
tank_temp_C=self._state.tanks.get_average_tank_temperature(time_slot),
heat_demand_kW=heat_demand_kW,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to do here, I took a long time reviewing whether this will break the existing strategies, but as far as I saw the old strategies should operate like before so all good!

Copy link
Member

@spyrostz spyrostz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, LGTM already

@hannesdiedrich hannesdiedrich merged commit 296caf0 into master Dec 17, 2024
4 checks passed
@hannesdiedrich hannesdiedrich deleted the feature/GSYE-810 branch December 17, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants