-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
In #328 a comment was raised to implement a check_setpoints method for all assets and implement it in the AssetAbstract.
Main question: How to get the necessary setpoints per asset? Would that be a call to a _variable also defined in AssetAbstract?
`
def check_setpoints(self, setpoints: Dict) -> None:
"""Check if all necessary setpoints are provided.
:param Dict setpoints: The setpoints that should be set for the asset.
"""
# Default keys required
necessary_setpoints = {
PROPERTY_TEMPERATURE_IN,
PROPERTY_TEMPERATURE_OUT,
PROPERTY_HEAT_DEMAND,
}
# Create set of keys in the provided setpoints
setpoints_set = set(setpoints.keys())
# Check if all setpoints are in the setpoints
if any(necessary_setpoints.difference(setpoints_set)):
# Print missing setpoints
raise ValueError(
f"The setpoints {necessary_setpoints.difference(setpoints_set)} are missing."
)`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status