-
Notifications
You must be signed in to change notification settings - Fork 7
Use ThermalStorageTypes for type safety #1557
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
Conversation
There was a problem hiding this 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
ThermalStorageTypeandStorageWithStatesealed trait hierarchies with specific case classes for different storage types - Creates
ThermalResultsealed trait with specific result types for different thermal components - Refactors
ThermalGridto 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.
There was a problem hiding this 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.
src/main/scala/edu/ie3/simona/model/thermal/ThermalResult.scala
Outdated
Show resolved
Hide resolved
src/main/scala/edu/ie3/simona/model/thermal/ThermalStorageType.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
resolves #1556