Skip to content

Feature/gsye 891 - #1919

Merged
hannesdiedrich merged 17 commits into
masterfrom
feature/GSYE-891
May 29, 2026
Merged

Feature/gsye 891#1919
hannesdiedrich merged 17 commits into
masterfrom
feature/GSYE-891

Conversation

@hannesdiedrich

Copy link
Copy Markdown
Member

Reason for the proposed changes

Please describe what we want to achieve and why.

Proposed changes

INTEGRATION_TESTS_BRANCH=master
GSY_FRAMEWORK_BRANCH=master
SCM_ENGINE_BRANCH=master

@hannesdiedrich
hannesdiedrich requested a review from spyrostz May 13, 2026 12:43
Comment thread src/gsy_e/models/strategy/heatpump_with_sortes_tank.py
Comment thread src/gsy_e/constants.py Outdated
CAPACITY_KWH = 25
COP_HEAT_SOURCE = 1
COP_CONDENSER = 1
COP_EVAPORATOR = 1 # to be updated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We need to ask for this again

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indeed this needs to be clarified

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.37288% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.69%. Comparing base (9111fd3) to head (991d9d9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1919      +/-   ##
==========================================
+ Coverage   71.12%   71.69%   +0.57%     
==========================================
  Files         149      150       +1     
  Lines       14309    14644     +335     
  Branches     1892     1908      +16     
==========================================
+ Hits        10177    10499     +322     
- Misses       3593     3601       +8     
- Partials      539      544       +5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +123 to +124
self._average_trade_rate.get_value(time_slot)
< GlobalConfig.market_maker_rate[time_slot]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we discussed also privately, this can be optimized to look at the future values, similar to this (pseydocode):

Suggested change
self._average_trade_rate.get_value(time_slot)
< GlobalConfig.market_maker_rate[time_slot]
all(self._average_trade_rate.get_value(t) < GlobalConfig.market_maker_rate[t] for t in [
time_slot.add(interval * i)
for i in range(0, time_horizon_mins / slot_length_mins)
if time_slot.add(interval * i) <= interval + time_horizon_mins
])

"COP",
"heat demand [kJ]",
"SOC",
"total_charged_energy_kWh",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for now since we do not have KPIs for this, but it would make sense to also separate the electricity consumption (traded energy) in 2 components: the electricity consumption of the condenser / evaporator, and the consumption required to produce the heat. Nothing to do of course, just for the sake of the argument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea. Let me even do it now, because I foresee that we have to investigate the results a bit more (already saw some unusual numbers in the KELVIN results).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done e940291

Comment on lines +87 to +88
self._get_tank_soc(time_slot) >= self.MAX_SOC_TOLERANCE
and self._current_state == HeatPumpChargingState.CHARGE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, now I see in detail what you meant in our discussion. Essentially if the SOC has overshoot to a value greater than the MAX_SOC_TOLERANCE, and the state changed to DISCHARGE for some reason, then the state would not switch to MAINTAIN_SOC. For SorTES where we do not care about interrupting the charging / discharging state I think this is ok, however for FractLES I think that the former implementation is valid. The storage should not switch to MAINTAIN_SOC in this case, it should just discharge, unless I misunderstood something.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I spend some time to remember why I added these changes here. Unfortunately, I am not sure, but I think we saw a case, when the status was changed to DISCHARGE before, but the SOC was still higher than the MAX value. This lead this section to change the status again to MAINTAIN_SOC and the storage was never discharged.
How about I move this implementation to SorTesTankMinimiseSwitchStrategy and leave the original implementation here for the fractLES?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Did that here 5e53114

self._update_soc(time_slot, -discharge_energy_kWh)
self._state.update_total_charged_energy_kWh(-discharge_energy_kWh)

def _update_soc(self, time_slot: DateTime, heat_energy_kWh: float):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit, but if the heat_energy_kWh can be negative, please leave a comment to indicate so. Thanks!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

spyrostz
spyrostz previously approved these changes May 26, 2026

@spyrostz spyrostz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some comments, LGTM already

spyrostz
spyrostz previously approved these changes May 29, 2026

@spyrostz spyrostz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hannesdiedrich
hannesdiedrich merged commit ab358e7 into master May 29, 2026
5 checks passed
@hannesdiedrich
hannesdiedrich deleted the feature/GSYE-891 branch May 29, 2026 13:55
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