Skip to content

Conversation

danielfeismann
Copy link
Member

resolves #1556

@danielfeismann danielfeismann added the code quality Code readability or efficiency is improved label Sep 26, 2025
@danielfeismann danielfeismann self-assigned this Sep 26, 2025
@danielfeismann danielfeismann added this to the Version 4.1 milestone Sep 26, 2025
@danielfeismann danielfeismann marked this pull request as ready for review September 26, 2025 17:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces type safety for thermal storage types by creating specific sealed trait hierarchies to distinguish between different types of thermal storage (heat storage vs hot water storage) rather than using a generic ThermalStorage type.

Key changes:

  • Introduces ThermalStorageType and StorageWithState sealed trait hierarchies with specific case classes for different storage types
  • Creates ThermalResult sealed trait with specific result types for different thermal components
  • Refactors ThermalGrid to use specific storage types and improve result handling with better separation of concerns

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ThermalStorageType.scala New file defining sealed traits for type-safe thermal storage handling
ThermalResult.scala New file defining sealed traits for thermal result types
ThermalGrid.scala Major refactoring to use specific storage types and improved result handling
HpInputTestData.scala Updated parameter type from generic to specific storage type
CHANGELOG.md Added entry documenting the type safety enhancement

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@staudtMarius staudtMarius left a comment

Choose a reason for hiding this comment

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

Some questions and remarks from my side.

Copy link
Member

@staudtMarius staudtMarius left a comment

Choose a reason for hiding this comment

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

LGTM.

@staudtMarius staudtMarius merged commit e436c7a into dev Oct 7, 2025
4 checks passed
@staudtMarius staudtMarius deleted the df/#1556-thermalStorageTypes branch October 7, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Code readability or efficiency is improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use ThermalStorageTypes for type safety

2 participants